A personal operating system built as a full-stack PWA — habit tracking, journaling, finance, health logging, and AI-powered monthly coaching in a single self-hosted app.
Stack: Java 17 · Spring Boot 3.5 · MySQL 8 · Vanilla JS · PWA
- Habits — Weekly grid (Sun–Sat), cross-week streaks, perfect-day scoring, retroactive regenerate (max 3/month), durable completion log
- Journal — Full-text entries with mood (1–5), image galleries, voice-to-text cleanup via Gemini AI
- Reflections — Morning intention + evening verdict, push-notification scheduler, 30-day stats
- Lines — Anti-goals ("No phone in bed"), daily kept/broke log, per-line streaks
- Wallet — Income / monthly budget / savings target
- Expenses — Auto-category detection (food, transport, housing, clothes, electronics, health)
- Debts — Payable & Receivable ledger with EMI, interest rate, due date; AI natural-language parser
- Budget categories — Percentage allocation with lock flag
- Workouts — Sets, reps, kcal, scheduled days, completion toggle
- Food log — 1 000+ item Indian food DB with portion multipliers, kcal tracking
- Junk log — Indulgence tracker with kcal debt and recovery time
- Supplements — Dose, timing (AM / PM / Pre-Workout), scheduled days
- Care products — Skin & hair routine checklists with daily completion
- Three pillars: Discipline (habits) · Mindfulness (journals) · Intent (budget vs spend)
- Composite 0–100 score with five vibes: Radiant · Focused · Steady · Drifting · Quiet
- Animated gradient orb that reacts to your score
- 365-day history synced to server; weekly AI-generated insights
- Wrapped page — Spotify-style month-in-review (
#/wrapped?m=YYYY-MM) - Coach letter — AI-written monthly reflection letter stored in DB; warm, dignified, grounded in real numbers
- Q&A thread — Follow-up conversation with the coach about your month
- Email card — Sends via Resend (optional); HTML email with orb gradient, stats table, deep link
- Three phases: Foundation → Build → Compound
- Six pillars: sleep, body, focus, morning, emotions, purpose
- Auto-generated 13-week habit plan from curated library
- Per-week habit customisation; weekly scores tracked in MySQL
- JWT stateless auth (10-hour tokens, BCrypt passwords)
- Firebase Google login with auto email-linking
- Rate limiting on auth endpoints (10 req / 60 s / IP)
- Web Push notifications (VAPID-signed, per-device subscriptions)
- Cloud sync for aura history, lines, reflections, body stats (debounced 1.5 s flush)
- Command palette (⌘K), pull-to-refresh, haptic feedback, offline banner
- Service worker PWA — installable on iOS & Android (cache v45)
| Layer | Technology |
|---|---|
| Language | Java 17 |
| Framework | Spring Boot 3.5.11 |
| ORM | Spring Data JPA / Hibernate |
| Database | MySQL 8 |
| Security | Spring Security + JJWT 0.11.5 |
| AI | Google Gemini 2.5 Flash |
| Push | web-push 5.1.1 + BouncyCastle 1.78.1 |
| Resend (optional) | |
| Auth (optional) | Firebase Admin SDK 9.2.0 |
| Scraping | JSoup 1.17.2 |
| Docs | SpringDoc OpenAPI 2.8.15 |
| Frontend | Vanilla JS (ES6 modules), no framework |
| PWA | Service Worker, Web Push API, Web Vibration API |
- Java 17+
- Maven 3.9+ (or use the included
./mvnw) - MySQL 8 running locally (or remote)
git clone https://github.com/YOUR_USERNAME/life-os.git
cd life-osCREATE DATABASE life_os_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;Copy and fill in your values:
export DB_URL=jdbc:mysql://localhost:3306/life_os_db
export DB_USERNAME=root
export DB_PASSWORD=your_mysql_password
export JWT_SECRET=a-random-string-at-least-32-characters-long
export GEMINI_API_KEY=AIza... # optional — AI features degrade gracefully if unsetOptional — Web Push notifications:
# Generate a VAPID keypair: npx web-push generate-vapid-keys
export VAPID_PUBLIC_KEY=...
export VAPID_PRIVATE_KEY=...
export VAPID_SUBJECT=mailto:you@example.comOptional — Monthly Aura card email:
export RESEND_API_KEY=re_...
export MAIL_FROM="Life OS <you@yourdomain.com>"
export APP_URL=https://your-app-url.comOptional — Firebase Google login:
export FIREBASE_SERVICE_ACCOUNT_JSON='{"type":"service_account",...}'
# or place firebase-service-account.json in src/main/resources/ (it is gitignored)./mvnw spring-boot:runOpen http://localhost:8080 — tables are created automatically on first run (ddl-auto: update).
| Variable | Required | Default | Description |
|---|---|---|---|
DB_URL |
Yes | jdbc:mysql://localhost:3306/life_os_db |
MySQL JDBC URL |
DB_USERNAME |
Yes | root |
MySQL username |
DB_PASSWORD |
Yes | (none) | MySQL password |
JWT_SECRET |
Prod | (ephemeral — tokens reset on restart) | JWT signing secret (32+ chars) |
GEMINI_API_KEY |
No | (none) | Gemini 2.5 Flash API key |
CORS_ALLOWED_ORIGINS |
No | http://localhost:8080,... |
Comma-separated allowed origins |
VAPID_PUBLIC_KEY |
No | (none) | Web Push VAPID public key |
VAPID_PRIVATE_KEY |
No | (none) | Web Push VAPID private key |
VAPID_SUBJECT |
No | mailto:lifeos@local |
Web Push contact |
RESEND_API_KEY |
No | (none) | Resend email API key |
MAIL_FROM |
No | Life OS <onboarding@resend.dev> |
Sender address |
APP_URL |
No | http://localhost:8080 |
Base URL for email deep links |
FIREBASE_SERVICE_ACCOUNT_JSON |
No | (none) | Firebase credentials JSON string |
GOOGLE_APPLICATION_CREDENTIALS |
No | (none) | Path to Firebase credentials file |
All endpoints (except /api/auth/**) require Authorization: Bearer <token>.
| Controller | Base Path | Key Endpoints |
|---|---|---|
| Auth | /api/auth |
POST /register · POST /login · POST /firebase-login |
| Habits | /api/habits |
CRUD · /toggleDay · /regenerate · /streaks |
| Journal | /api/journals |
CRUD |
| Expenses | /api/expenses |
CRUD |
| Wallet | /api/wallet |
GET / · POST / |
| Pillars | /api |
workouts · foods · junk · supplements |
| Products | /api/products |
CRUD · PUT /{id}/toggle |
| AI | /api/ai |
aura · insight · polish · parse-debt · month-recap |
| Monthly Card | /api/month-card |
stats · send-test · preview |
| Coach | /api/coach |
letter · reanalyze · ask |
| Push | /api/push |
subscribe · prefs · test |
| Blobs | /api/blobs |
GET all · PUT /{key} |
| Dashboard | /api/dashboard |
year-progress · heatmap |
| Reset | /api/reset |
GET · PUT |
| Scraper | /api/scrape |
POST / |
Swagger UI available at http://localhost:8080/swagger-ui.html.
life-os/
├── src/
│ ├── main/
│ │ ├── java/com/rahul/lifeos/
│ │ │ ├── config/ # SecurityConfig, FirebaseConfig
│ │ │ ├── security/ # JwtUtil, JwtFilter, RateLimitFilter
│ │ │ ├── controllers/ # 14 REST controllers
│ │ │ ├── services/ # GeminiService, MonthlyCardService, CoachService,
│ │ │ │ # FirebaseService, PushService, NudgeScheduler, ScrapperServices
│ │ │ ├── models/ # 18 JPA entities
│ │ │ └── repositories/ # Spring Data JPA interfaces
│ │ └── resources/
│ │ ├── application.properties
│ │ └── static/ # Vanilla JS PWA
│ │ ├── index.html
│ │ ├── styles.css · mobile.css
│ │ ├── manifest.json · sw.js
│ │ └── src/
│ │ ├── main.js
│ │ ├── lib/ # auth, store, cloudSync, orb, router, score, …
│ │ ├── components/ # layout, commandPalette, bottomSheet, promptModal, …
│ │ └── pages/ # dashboard, habits, journal, aura, treasury, wrapped, …
│ └── test/
├── pom.xml
├── mvnw · mvnw.cmd
└── .env.example
- All data is stored in your own MySQL database — nothing goes to third-party servers unless you configure optional integrations (Gemini, Resend, Firebase)
- Gemini API calls are made server-side (your key, your quota)
- Passwords are hashed with BCrypt; JWT tokens never store sensitive data
- Web Push subscriptions are per-device and can be revoked from Settings
MIT





