Skip to content

bisug4g/jp-final

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ JAYTI โ€” Personal Life Companion

A beautiful, feature-rich personal companion web app built with Django.

Django Python PostgreSQL Railway CI

โœจ Features

Module Highlights
๐Ÿ“ Notes Folders, tags, pin, search, PDF export
๐Ÿ“” Diary Daily journal, mood tracking, streaks, PDF export
๐ŸŽฏ Goals AI-powered planning, Kanban tasks, progress charts
๐Ÿ”ฎ Astrology Birth chart (Kundli), 12 houses, Dasha periods, daily guidance
๐Ÿค– AI Chat Personal AI mentor (OpenAI-compatible / Gemini / Vertex AI)
๐Ÿ‘” Tangred Agentic wardrobe AI with private photo sessions and Tan Studio styleboards
๐Ÿ“ Location Real-time GPS tracking with interactive map
๐Ÿ”” Notifications Firebase push notifications + diary reminders
๐ŸŽ‚ Birthday Countdown widget, confetti celebration
๐ŸŒ™ Dark Mode System-aware toggle
๐Ÿ“ฑ PWA Installable, offline-capable

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.11+
  • PostgreSQL (production) or SQLite (development)

Installation

git clone https://github.com/flywithvvk/jp.git
cd jp

pip install -r requirements.txt

cp backend/.env.example backend/.env
# Edit backend/.env with your keys

python manage.py migrate
python manage.py createsuperuser
python manage.py collectstatic --noinput
python manage.py runserver

Environment Variables

Variable Description Required
SECRET_KEY Django secret key (required when DEBUG=False) Yes (prod)
DATABASE_URL PostgreSQL connection string Yes (prod)
DEBUG Debug mode (False in production) No
ALLOWED_HOSTS Comma-separated host allowlist No
CSRF_TRUSTED_ORIGIN(S) Extra CSRF origins (comma-separated) No
INITIAL_USERNAME / INITIAL_PASSWORD Bootstraps the first user on deploy (no-op if unset) No
LOG_TO_FILE Enable file logging (defaults off in prod; Railway fs is ephemeral) No
EMERGENT_PLATFORM Set to 1 to enable Emergent-platform ALLOWED_HOSTS/CSRF defaults No
EMERGENT_API_KEY OpenAI-compatible AI provider key No*
GITHUB_MODELS_TOKEN GitHub Models inference token No*
GEMINI_API_KEY Google Gemini API key No*
VAPID_PUBLIC_KEY Web push notification key No
FIREBASE_PROJECT_ID Firebase project identifier No

* At least one AI provider is required for AI chat features.

๐Ÿ“ Project Structure

jp/
โ”œโ”€โ”€ core/               # Auth, dashboard, location tracking, middleware
โ”œโ”€โ”€ notes/              # Notes with folders & tags
โ”œโ”€โ”€ diary/              # Daily journal & mood tracking
โ”œโ”€โ”€ goals/              # Goals & task management
โ”œโ”€โ”€ astro/              # Vedic astrology engine
โ”œโ”€โ”€ ai_chat/            # AI companion
โ”œโ”€โ”€ templates/          # Django HTML templates
โ”œโ”€โ”€ static/             # CSS, JS, icons, PWA manifest
โ”œโ”€โ”€ backend/            # Server config & requirements
โ”œโ”€โ”€ firebase-functions/ # Firebase Cloud Functions (proxy)
โ”œโ”€โ”€ firebase-hosting/   # Firebase Hosting (redirect shell)
โ”œโ”€โ”€ docs/               # Architecture & deployment guides
โ””โ”€โ”€ manage.py

๐Ÿ› ๏ธ Tech Stack

  • Backend: Django 4.2, Python 3.11, ASGI (Uvicorn)
  • Database: PostgreSQL (prod) / SQLite (dev)
  • AI: OpenAI-compatible, GitHub Models, Gemini, Vertex AI
  • Wardrobe AI: OpenRouter + Stitch MCP, with durable in-app photo persistence
  • Astrology: Swiss Ephemeris (pyswisseph)
  • Frontend: Django Templates, Bootstrap 5, Chart.js, Leaflet.js
  • Deployment: Railway (ASGI + Gunicorn), WhiteNoise, Firebase Hosting
  • Security: HSTS, CSRF, XSS protection, SSL redirect, bleach sanitization

๐Ÿšข Deployment

Deployed on Railway with auto-deploy from main branch.

The container entrypoint (entrypoint.sh) runs DB migrations before starting Gunicorn, so traffic is never served against an unmigrated schema. Railway's nixpacks build path is equivalent (see railway.json). Health probe: GET /health โ€” returns 200 immediately without touching the DB.

# Local production-style run
docker build -t jayti .
docker run --rm -p 8001:8001 \
  -e SECRET_KEY=$(python -c "import secrets;print(secrets.token_urlsafe(64))") \
  -e DEBUG=False \
  -e ALLOWED_HOSTS=localhost \
  jayti

See docs/DEPLOYMENT_GUIDE.md for full setup.

๐Ÿงช Testing & CI

# Fast in-process smoke tests
DEBUG=True SECRET_KEY=dev LOG_TO_FILE=0 pytest tests -q --ignore=tests/e2e

# Django deploy check (what CI enforces)
DEBUG=False SECRET_KEY=<long-random> ALLOWED_HOSTS=example.com \
  python manage.py check --deploy --fail-level WARNING

# Lint
ruff check .

GitHub Actions (.github/workflows/ci.yml) runs on every push/PR: lint โ†’ tests โ†’ Django deploy-check โ†’ dependency audit.

End-to-end (Playwright)

Browser-based E2E tests live in tests/e2e/ and run against an in-process Django server via pytest-django's live_server fixture.

pip install -r requirements-dev.txt
playwright install --with-deps chromium
pytest tests/e2e -m e2e -q              # headless
pytest tests/e2e -m e2e --headed        # headed, for debugging

CI workflow: .github/workflows/e2e.yml (Chromium, traces + screenshots uploaded as artifacts on failure). See tests/e2e/README.md for details. An optional Node/@playwright/test harness for codegen/trace UI ships in e2e-node/ (not wired into CI).

Tangred Storage

Tangred session photos are served through authenticated Django endpoints.

  • Primary path: Firebase Storage when a valid bucket is configured
  • Safe fallback: PostgreSQL-backed binary storage for private in-app persistence
  • Optional override: TANGRED_PRIVATE_MEDIA_BACKEND=database|firebase|local

This means Tangred wardrobe photos remain available across Railway deploys even when object storage is unavailable.

๐Ÿ“– Documentation

๐Ÿ“„ License

This project is a personal gift and is not licensed for redistribution.


Made with ๐Ÿ’•

About

๐Ÿ’ Jayti โ€” Personal life companion with Notes, Diary, Goals, Astrology, AI Chat & Tangred wardrobe AI. Django + Firebase + Cloud Run.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors