Skip to content

CreatingValueFirst/astro-mood

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

79 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒŸ AstroMood

AstroMood Banner

Personalized monthly mood forecasts powered by real astronomical calculations

Next.js TypeScript Supabase Vercel License: MIT

Demo ยท Documentation ยท Report Bug ยท Request Feature


โœจ Features

  • ๐Ÿ”ญ Real Astronomical Data - Calculations based on actual planetary positions using astronomy-engine
  • ๐Ÿง  Explainable AI - Transparent mood scoring model showing exactly why certain days have specific patterns
  • ๐Ÿ“Š 5 Mood Dimensions - Track energy, focus, romance, stress, and social vitality
  • ๐ŸŒ™ Lunation Tracking - New Moons, Full Moons, and eclipses with detailed impacts
  • โ™ฟ Accessible - WCAG AA compliant with keyboard navigation and screen reader support
  • ๐Ÿ” Privacy First - Row-level security, encrypted data, GDPR compliant
  • ๐Ÿ“ฑ Responsive - Beautiful UI that works on all devices
  • โšก Fast - Server-side rendering with smart caching

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm or pnpm
  • Supabase account (free tier)
  • Vercel account (optional, for deployment)

Installation

# Clone the repository
git clone https://github.com/CreatingValueFirst/astro-mood.git
cd astro-mood

# Install dependencies
cd apps/web
npm install

# Set up environment variables
cp .env.example .env.local
# Edit .env.local with your Supabase credentials

# Run development server
npm run dev

Visit http://localhost:3000

Environment Variables

Create apps/web/.env.local:

NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key

Get these from your Supabase project settings.

๐Ÿ“ฆ Project Structure

astro-mood/
โ”œโ”€โ”€ apps/
โ”‚   โ””โ”€โ”€ web/                    # Next.js web application
โ”‚       โ”œโ”€โ”€ src/
โ”‚       โ”‚   โ”œโ”€โ”€ app/            # App Router pages
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ (auth)/     # Authentication pages
โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ dashboard/  # Protected dashboard
โ”‚       โ”‚   โ”‚   โ””โ”€โ”€ onboarding/ # User onboarding
โ”‚       โ”‚   โ”œโ”€โ”€ components/     # React components
โ”‚       โ”‚   โ”‚   โ””โ”€โ”€ ui/         # shadcn/ui components
โ”‚       โ”‚   โ”œโ”€โ”€ lib/            # Utilities
โ”‚       โ”‚   โ”‚   โ””โ”€โ”€ supabase/   # Supabase clients
โ”‚       โ”‚   โ””โ”€โ”€ middleware.ts   # Auth middleware
โ”‚       โ””โ”€โ”€ package.json
โ”œโ”€โ”€ packages/
โ”‚   โ”œโ”€โ”€ astro-core/             # Astrology calculation engine
โ”‚   โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ calculations/   # Planetary positions, aspects
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ interpretations/# Mood scoring model
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ types.ts        # TypeScript definitions
โ”‚   โ”‚   โ””โ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ shared-types/           # Shared TypeScript types
โ”œโ”€โ”€ supabase/
โ”‚   โ”œโ”€โ”€ migrations/             # Database migrations
โ”‚   โ””โ”€โ”€ functions/              # Edge Functions
โ”œโ”€โ”€ docs/                       # Documentation
โ””โ”€โ”€ README.md

๐Ÿ—„๏ธ Database Schema

AstroMood uses Supabase (PostgreSQL) with the following tables:

  • birth_profiles - User birth data for chart calculations
  • natal_charts - Cached natal chart computations
  • monthly_forecasts - Cached monthly mood forecasts
  • ephemeris_cache - Shared planetary position data

All tables are protected with Row Level Security (RLS) policies.

๐Ÿงฎ Astrology Engine

The core calculation engine (packages/astro-core) provides:

Planetary Calculations

  • Real-time planetary positions for all 10 celestial bodies
  • Retrograde detection using velocity analysis
  • Sign ingress (planet entering new zodiac sign) finder
  • Lunation calculator (New/Full Moons)

Mood Scoring Model

Deterministic algorithm that converts astronomical transits into quantifiable mood impacts:

MoodScore = {
  overall: 0-100,
  energy: 0-100,
  focus: 0-100,
  romance: 0-100,
  stress: 0-100,   // Higher = more stress
  social: 0-100
}

Factors considered:

  • Planet influence weights (Sun: 1.0, Moon: 0.9, etc.)
  • Sign compatibility modifiers
  • Aspect multipliers (conjunction, trine, square, opposition)
  • Transit-to-natal relationships
  • Special events (Mercury retrograde, eclipses)

Example Usage

import { calculatePlanetaryPositions, calculateDailyMood } from '@astro-mood/astro-core';

// Get current planetary positions
const positions = calculatePlanetaryPositions(new Date());

// Calculate mood for a Capricorn
const mood = calculateDailyMood(
  new Date(),
  'Capricorn',
  [
    { planet: 'Mars', sign: 'Leo', aspectType: 'Trine' },
    { planet: 'Venus', sign: 'Pisces' }
  ]
);

console.log(mood);
// { overall: 72, energy: 80, focus: 65, romance: 85, stress: 35, social: 70 }

๐ŸŽจ UI Components

Built with shadcn/ui and Tailwind CSS:

  • ๐ŸŽญ Cosmic gradient theme (purple/pink/indigo)
  • ๐ŸŒ™ Dark mode optimized
  • ๐Ÿ“ฑ Fully responsive
  • โ™ฟ Accessible (WCAG AA)
  • โšก Optimized performance

๐Ÿ” Authentication & Security

  • Supabase Auth - Email/password authentication
  • Row Level Security - Users can only access their own data
  • Session Management - Automatic token refresh via middleware
  • Protected Routes - Middleware-based route protection
  • HTTPS Only - Secure communication in production

๐Ÿ“Š Deployment

Deploy to Vercel (Recommended)

Deploy with Vercel

  1. Click the button above
  2. Connect your GitHub account
  3. Configure environment variables
  4. Deploy!

Manual Deployment:

# Install Vercel CLI
npm i -g vercel

# Deploy
cd apps/web
vercel

See DEPLOYMENT.md for detailed instructions.

Configure Supabase

After deployment, add your Vercel URL to Supabase:

  1. Go to Supabase Auth Settings
  2. Add to Redirect URLs: https://your-app.vercel.app/**
  3. Update Site URL: https://your-app.vercel.app

๐Ÿงช Testing

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Type check
npm run type-check

# Lint
npm run lint

๐Ÿค Contributing

Contributions are welcome! Please read our Contributing Guide first.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • astronomy-engine - Precise astronomical calculations
  • Supabase - Backend infrastructure
  • shadcn/ui - Beautiful UI components
  • Vercel - Deployment platform
  • Astro.com - Reference for validation

๐Ÿ“ง Contact

๐Ÿ—บ๏ธ Roadmap

  • Core astrology calculation engine
  • User authentication
  • Birth profile management
  • Basic dashboard
  • Monthly forecast generation API
  • Calendar view with daily breakdown
  • Insights page with natal chart
  • Transit notifications
  • Synastry/compatibility reports
  • Mobile app (React Native)
  • AI-enhanced content generation
  • Premium subscription tiers

Made with โ˜„๏ธ by AstroMood

โฌ† Back to Top

About

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors