Skip to content

LindseyB/astro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

344 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✦ Astro Horoscope

🔮

Your cosmic vibe check

A web-based astrological horoscope for only the chillest of humans

Features

  • 🌟 Natal chart calculations — Sun, Moon, and Ascendant signs
  • 🪐 Full birth chart with a rendered chart wheel, house placements, and aspects
  • 🔮 AI-powered daily horoscope, streamed in real time (Claude)
  • 💬 "Ask the stars" — ask anything and get an answer tuned to the current sky
  • 🌮 Personalized Taco Bell order based on your chart
  • 🎵 Music-genre preference with AI song recommendations
  • 📡 Current Mercury retrograde status
  • 🌗 Light and dark mode
  • 📱 Responsive design

Installation

Option 1: GitHub Codespaces (Recommended)

  1. Click the "Code" button on GitHub
  2. Select the "Codespaces" tab
  3. Click "Create codespace on main"
  4. Set required environment variables:
export SECRET_KEY="replace-with-a-long-random-secret"
export ANTHROPIC_TOKEN="your-api-key-here"
  1. Run the app:
python main.py

The environment will automatically set up Python 3.10 and install all dependencies. The app will be available on port 5000 with automatic port forwarding.

Option 2: Local Setup

  1. Install dependencies:
pip install -r requirements.txt

For local development and running tests, install dev dependencies instead (this includes runtime dependencies):

pip install -r requirements-dev.txt
  1. Set required environment variables. The easiest way for local development is a .env file (loaded automatically on startup):

The app loads .env from the project root during startup for both python run.py and import-based servers like gunicorn main:app.

cp .env.example .env           # macOS/Linux
# Copy-Item .env.example .env  # Windows PowerShell

Then open .env and set your values:

SECRET_KEY=replace-with-a-long-random-secret
ANTHROPIC_TOKEN=your-api-key-here

SECRET_KEY is required at startup, and .env is git-ignored so secrets stay out of version control. Alternatively, you can export variables in your shell instead of using a file:

export SECRET_KEY="replace-with-a-long-random-secret"     # macOS/Linux
export ANTHROPIC_TOKEN="your-api-key-here"                # macOS/Linux
# $env:SECRET_KEY = "replace-with-a-long-random-secret"   # Windows PowerShell
# $env:ANTHROPIC_TOKEN = "your-api-key-here"              # Windows PowerShell

Optional: set LAST_FM_API_KEY (from https://www.last.fm/api/account/create) to enable real song recommendations. Without it, the app still runs and falls back to AI-suggested songs.

  1. Run the Flask app:
python run.py
  1. Open your browser to: http://localhost:8080

Location Format Examples

  • New York City: 40n42, 74w00, -05:00 (EST) / -04:00 (EDT)
  • Los Angeles: 34n03, 118w15, -08:00 (PST) / -07:00 (PDT)
  • London: 51n30, 0w10, +00:00 (GMT) / +01:00 (BST)
  • Paris: 48n52, 2e20, +01:00 (CET) / +02:00 (CEST)

Example outputs

Horoscope

Today’s vibe: 🔥🦁 Moody but bold—emotions are deep, but don’t be afraid to shine your true self!

Do:
- Hang with friends or do something creative 🎨
- Reflect on your feelings but don’t get stuck in them 🤔
- Try something new or quirky that makes you stand out 🌈

Don’t:
- Start intense convos with family (could get dramatic) 🥲
- Overshare secrets or dig too deep today 🕵️‍♀️
- Expect work/tasks to go perfectly (Mercury rx chaos) 💻

Song: Midwest Pen Pals – “Movies Like Juno” 🎸
Beverage: Iced matcha latte—refreshing but comforting like Cancer season, with that Leo pop 💚🤩

Full Chart

🦀🌙✨ Deep feels and empathy (Sun in Cancer 12H) but secretly—total softie, kinda mysterious, lowkey psychic.
🦁👑🔥 Big Leo rising energy—charisma! Venus in 1H = gorgeous vibes and main character moments, even if you’re shy inside.
🧠🌊 Moon in Aquarius 7H = quirky, unique tastes in friends/love. Needs independence in relationships, loves the oddballs.
💪🏽🏆 Mars/Neptune in Capricorn (6H): hardworking, dreamy realist, but also risk of burnout from helping everyone.
🎢 Uranus/Saturn in 5H = creative rebel but needs structure; probs has some weird hobbies or unconventional romantic adventures.
🦂🏠 Pluto in 4H = deep family stuff, possible emo backstory. Transformation happens at home.
💔🗣️ Chiron in 11H = past friendship hurts, longing for your soul tribe.
🌧️🎸 Overall theme: sensitive outsider with a fierce heart, balancing deep feels & eccentric social vibes.

🛏️ Song Rec: "Never Meant" by American Football fits your vibe perfectly!

Personalized Taco Bell Order

OMG yessss let’s Taco-Bell-astro-vibe it out for this Cancer Sun/Moon Aquarius/Cancer Rising moodboard 🌊💡🥰:

✨Big Soup Mama Cancer/Double Water Vibes: Homey & nurturing, living their best comfort food life
🔌Moon in Aqua: Unexpected WEIRD; likes a side of eccentric with their wrapper
💕Venus in Leo in 1st: Main character energy, give ‘em drama and flare
🏍️Mars Cap/Neptune Cap (6th House Elite Productivity): Serious efficiency snacker

Your Cosmic Taco Bell Order:

Quesarito, but Custom: Double everything inside 🌯🌊 (Cancers need that hug-in-a-wrap; you love extra comfort. Plus, it’s hidden and gooey like a true Crab)

Cheesy Fiesta Potatoes: Because tbh, these are unique af, and Moon in Aqua loves unpredictable sides, okay?? 🥔

Doritos Locos Taco Supreme w/ cool ranch 🌈🤪 (Spice up your emotions, and let your uranusian side go wildyyyho!!)

Nachos BellGrande but make it aesthetic 🧀🔥 (Cancer Sun+Venus Leo = MAXIMUM drama cheese, please, AND sharable for your homebody heart)

Baja Blast Freeze: For pure “I am my own party” Uranian Quirked Up Silliness ✨🧊💙

Side of Guac: Because Pluto in 4th = lowkey you want depth with that basic chip. 🥑

Total Vibes: Chaotic cozy inventor energy, high on sauce, extra Drama-Luv.
Skip the tacos if you’re working late, triple up on sides if you’re friendship-brained tonight! 🤍👾

#LuncheonLagoon #MainCharacterMeal 🌊🦀🪐🔥

Screenshots

Home — light

Home page in light mode showing bento-style grid of ritual tiles

Home — dark

Home page in dark mode showing bento-style grid of ritual tiles

Birth info panel

Birth info slide-in panel with location search and inline error message

Ask the stars

Ask the stars modal with auto-growing textarea

Development

Prompt templates

Runtime prompts live under prompts/ as markdown files with lightweight frontmatter metadata.

Use this shape:

---
description: Short human-readable summary
role: user
temperature: 0.4
max_tokens: 500
---

Prompt body with placeholders like {sun_sign} or {question}

Notes:

  • description is for humans reading the repo.
  • role is typically user or system.
  • temperature and max_tokens are optional and only used where the call site reads them.
  • Prompt bodies are rendered with Python str.format(...), so placeholders should use {name} syntax.

The shared loader lives in prompt_templates.py. Current prompt groups are organized by feature area:

  • prompts/calculations/ for horoscope, full chart, Taco Bell, and ask-anything prompts
  • prompts/routes/ for route-level prompts such as music suggestions
  • prompts/ai_service/ for service-level prompts such as song verification

Frontend Web Components

Reusable UI behavior is now componentized under static/js/components/ and registered once from static/js/components/index.js (loaded in templates/base.html).

Component API quick reference:

astro-button

  • Purpose: submit-button loading/disable UX with optional validation
  • Slot: include one <button type="submit">...</button> child
  • Attributes:
    • loading-text (optional, default Loading...)
    • disable-all-submit (optional, default true)
    • require-input-selector (optional CSS selector)
    • validation-message (optional)
  • Events:
    • astro:button-loading

astro-section-toggle

  • Purpose: expand/collapse a target section with persisted state
  • Slot: include one <button>...</button> child (optionally with .toggle-btn icon span)
  • Attributes:
    • target (required CSS selector)
    • storage-key (optional localStorage key)
    • expanded (optional default expanded state)
  • Events:
    • astro:section-toggle

astro-copy-analysis

  • Purpose: copy analysis text with chart context and feedback
  • Slot: include one copy button child (recommended)
  • Attributes:
    • source-selector (optional, default #analysisContent)
    • section-selector (optional, default .analysis-section)
    • success-text (optional, default )
    • footer-text (optional)
  • Events:
    • astro:copy-success
    • astro:copy-failure

astro-datetime-input

  • Purpose: digit-only date/time entry with auto-formatting and native picker sync
  • Wraps an existing date/time field group in light DOM
  • Attributes:
    • kind (date or time)
    • input-selector (required selector for visible input)
    • native-selector (required selector for hidden native picker input)
    • trigger-selector (required selector for picker button)

astro-timezone-select

  • Purpose: timezone select enhancement + Select2 initialization + localStorage sync
  • Wraps an existing timezone <select> in light DOM
  • Attributes:
    • select-selector (required selector for timezone select)

astro-chart-wheel

  • Purpose: owns chart wheel render lifecycle, theme-aware redraws, and PNG download behavior
  • Wraps an existing chart wheel block in light DOM
  • Attributes:
    • data-source (optional global data key, default chartData)
    • canvas-selector (optional, default #chartWheel)
    • download-selector (optional, default #downloadChartWheelBtn)
    • download-filename (optional, default chartWheel.png)

Legacy compatibility adapters remain at:

  • static/js/button-loading.js
  • static/js/section-toggle.js
  • static/js/copy-analysis.js

These files are deprecated and kept only for backward compatibility with old template includes.

Run all tests

make test

Run with coverage

make test-coverage

Run specific test types

make test-unit
make test-frontend

About

A web-based astrological horoscope for only the chillest of humans

Topics

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Contributors