Horoscope.
Daily horoscope. Deadpan. Symbols are correct — we checked. The predictions are not. The stars are very far away. They are not thinking about your texts.
For entertainment only. Mercury is in retrograde, or it isn't. Either way, drink water. If your horoscope comes true, that is a coincidence. If it doesn't, that is also a coincidence.
Horoscope Backend — Proposed Architecture
Right now this page is local-only — all 12 signs + all 3 horoscopes per sign live in JS (signs), the choice lives in memory in horoChoice, and “What is my sign?” is just date math in findSign(). This is the map to make it real: same deadpan voice, same 3-per-sign choice + rotate, but reads live on the server, the choice is saved per member, and a new day / new variant needs no code change.
01 / Files to create
api/horoscope/signs.php GET /api/horoscope/signs api/horoscope/today.php GET /api/horoscope/today?sign=aries&variant=1 api/horoscope/pick.php POST /api/horoscope/pick api/horoscope/find_sign.php GET /api/horoscope/find_sign?birth=1990-04-15 sql/horoscope_tables.sql
Keep the tinyfiles PHP pattern: each endpoint loads /api/bootstrap.php, uses json_in() / json_out(), member session for auth, prepared PDO statements.
02 / Database tables
-- sql/horoscope_tables.sql
horoscope_signs
id VARCHAR(20) PRIMARY KEY -- e.g. 'aries'
symbol VARCHAR(8) NOT NULL -- e.g. Aries symbol
name VARCHAR(20) NOT NULL
date_range VARCHAR(30) NOT NULL -- 'Mar 21 — Apr 19'
start_month TINYINT NOT NULL
start_day TINYINT NOT NULL
element ENUM('Fire','Earth','Air','Water') NOT NULL
lucky_number TINYINT NOT NULL
mood VARCHAR(30) NOT NULL
horoscope_reads
sign_id VARCHAR(20) NOT NULL
variant TINYINT NOT NULL -- 1, 2, or 3 — the choice on the card
text TEXT NOT NULL -- the deadpan reading + Lucky action
active TINYINT NOT NULL DEFAULT 1
PRIMARY KEY (sign_id, variant)
FOREIGN KEY (sign_id) REFERENCES horoscope_signs(id)
user_horoscope_prefs
member VARCHAR(80) PRIMARY KEY
sign_id VARCHAR(20) NOT NULL
variant TINYINT NOT NULL DEFAULT 1 -- last picked 1/2/3, so it sticks across devices
birth_date DATE NULL -- only if member saves it for find_sign
updated_at DATETIME NOT NULL
Seed horoscope_reads from the reads:[...] arrays already in this page — variant 1 = the original, 2 + 3 = the two new ones. Adding a 4th variant later is one row, no front-end change.
03 / API endpoints & request flow
GET /api/horoscope/signs
- returns all 12 signs + their 3 reads each
- front-end renders the same cards: symbol, name, tag, dates, lucky, mood, choice 1/2/3 + Rotate
GET /api/horoscope/today?sign=aries&variant=2
- returns { "sign": "aries", "variant": 2, "text": "...", "lucky_number": 4, "mood": "Impatient" }
- variant must be 1..3, else 400 — never trust a variant=99 from the browser
POST /api/horoscope/pick
{ "sign_id": "aries", "variant": 2 }
- upserts into user_horoscope_prefs (member, sign, variant)
- Rotate is just pick with variant = (current % 3) + 1 — same endpoint, no separate rotate endpoint
- returns { "ok": true, "variant": 2 }
GET /api/horoscope/find_sign?birth=1990-04-15
- same date math as findSign() today, but server-side so the ranges live in one place
- returns { "sign_id": "aries", "name": "Aries" }
Front-end contract stays the same: pickHoroscope(i, n) calls pick.php + updateHoroscopeCard(), rotateHoroscope(i) calls pick.php with the next variant. If the API is down, the page falls back to the built-in signs array exactly as today.
04 / Validation & rules
// Server owns the truth. Browser submits intent only. - sign_id must exist in horoscope_signs, variant must be 1..3 and active=1. - Symbols + date ranges are fixed data, never user input. Do not let a client overwrite a sign's symbol, dates, or element. - Reads are editorial, not computed: server returns the stored text verbatim. No per-user astrology, no birth-chart math, no personalized prediction. - birth_date, if saved, is only used for find_sign. Never use it to change a read. - Rate-limit pick.php (1/sec per member) — it is a preference save, not a vote.
05 / Adding a new horoscope
-- Add a new variant for one sign:
INSERT INTO horoscope_reads (sign_id, variant, text) VALUES
('aries', 4, 'You will... Lucky action: ...');
-- New copy needs no code change — one row is a new choice.
New copy needs no code change — one row in horoscope_reads is a new choice. Keep the voice: deadpan, symbols correct, predictions not real, always end with a Lucky action.