Skip to content

cyberatlas-baseeth/lifeOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

34 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

LifeOS โ€” Digital Life Tracker ๐Ÿงฌ

A modern, full-stack web application that tracks your personal life metrics across health, finance, and goals โ€” generating a dynamic digital avatar that reflects your real-life state.

โœจ Features

๐Ÿฅ Health Tracking (7-Category Scoring System)

Comprehensive health monitoring with a weighted score out of 100:

Category Weight Metrics
Sleep Duration 10% Hours slept (4.5h โ€“ 10.5h)
Sleep Timing & Regularity 15% Bedtime (21:00โ€“02:00+), consistency
Physical Activity 20% 5-level activity scale
Nutrition 20% Meal quality, processed food level
Hydration 10% Water intake level
Mental State 15% Stress, motivation, fatigue
Extras 10% Alcohol, smoking, screen time
  • Illness penalty applied as a modifier after weighted calculation (mild: -10, severe: -25)
  • Health states: Excellent (85+), Good (70+), Fair (50+), Low (30+), Critical (<30)

๐Ÿ’ฐ Financial Tracking (Dual Currency: TRY / USD)

All financial data is stored in both TRY (primary) and USD (secondary) with live exchange rates from MoneyConvert API.

  • Income: Regular (salary) and additional (crypto) income tracking with tag-based categorization
  • Expenses: Tag-based system โ€” Rent, Bills, Food, Transportation, Entertainment, Subscriptions, Shopping, Lifestyle, Family Support
  • Investments: Claim-based portfolio tracking โ€” Crypto, Gold, Stocks, Forex, Real Estate, Funds, Bonds, Other
    • Active investments: locked capital tracked as outflow
    • Claimed investments: capital + realized P/L added back
  • Net Worth: Auto-calculated from Income - Expenses - Active Investments + Claimed Returns

๐ŸŽฏ Target Assets

Goal tracking with category-based organization:

  • Categories: Tech, House, Car, Travel, Other
  • Progress: Calculated against current net worth
  • Formatting: Dot-separated thousand formatting for easy reading

๐Ÿค– Dynamic Avatar

  • Visual state that changes based on your metrics
  • Energy, morale, and balance scores
  • 6 different states: Thriving, Energetic, Stable, Tired, Stressed, Critical

๐Ÿ“ˆ Analysis & Visualization

  • Time-series charts (Recharts)
  • Automatic alerts and recommendations
  • Trend analysis across all metric categories

โœ๏ธ Full CRUD Operations

  • Add / Edit / Delete entries across all modules (Health, Income, Expenses, Investments, Targets)
  • Inline editing with form pre-population
  • Error handling and user feedback on all operations

๐Ÿ” Security

  • Web3 authentication with MetaMask
  • Wallet-based identity (no passwords)
  • Row Level Security (RLS) on Supabase โ€” each user can only see their own data

๐Ÿš€ Setup

1. Clone the Repository

git clone https://github.com/cyberatlas-baseeth/lifeOS.git
cd lifeOS
npm install

2. Create a Supabase Project

  1. Go to supabase.com
  2. Create a new project
  3. Go to SQL Editor and run:
    • supabase/schema.sql โ€” Base schema
    • supabase/migration_health_restructure.sql โ€” Extended health fields
    • supabase/migration_expenses_tag_based.sql โ€” Tag-based expenses
    • supabase/migration_investments_claim_based.sql โ€” Claim-based investments
    • supabase/migration_target_assets.sql โ€” Target assets
    • supabase/migration_add_shopping_tag.sql โ€” Shopping tag

3. Environment Variables

Create a .env.local file:

NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key

4. Development Server

npm run dev

Open http://localhost:3000 in your browser.


๐Ÿ“ Project Structure

lifeos/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/                        # Next.js App Router
โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx                # Landing page
โ”‚   โ”‚   โ”œโ”€โ”€ globals.css             # Global styles
โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx              # Root layout
โ”‚   โ”‚   โ”œโ”€โ”€ login/                  # MetaMask login page
โ”‚   โ”‚   โ””โ”€โ”€ dashboard/
โ”‚   โ”‚       โ”œโ”€โ”€ page.tsx            # Main dashboard (overview)
โ”‚   โ”‚       โ”œโ”€โ”€ layout.tsx          # Dashboard sidebar & navigation
โ”‚   โ”‚       โ”œโ”€โ”€ health/             # Health metrics (7-category scoring)
โ”‚   โ”‚       โ”œโ”€โ”€ income/             # Income tracking (regular + additional)
โ”‚   โ”‚       โ”œโ”€โ”€ expenses/           # Expense tracking (tag-based)
โ”‚   โ”‚       โ”œโ”€โ”€ investments/        # Investment portfolio (claim-based)
โ”‚   โ”‚       โ”œโ”€โ”€ networth/           # Net worth calculator
โ”‚   โ”‚       โ””โ”€โ”€ targets/            # Target assets & goals
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ avatar/                 # Dynamic avatar component
โ”‚   โ”‚   โ”œโ”€โ”€ charts/                 # TimeSeriesChart (Recharts)
โ”‚   โ”‚   โ””โ”€โ”€ ui/                     # AlertBanner, shared UI
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”œโ”€โ”€ supabase/               # Supabase client setup
โ”‚   โ”‚   โ”œโ”€โ”€ wallet/                 # WalletContext (MetaMask auth)
โ”‚   โ”‚   โ”œโ”€โ”€ avatar/                 # Avatar state calculation
โ”‚   โ”‚   โ”œโ”€โ”€ theme/                  # Theme configuration
โ”‚   โ”‚   โ”œโ”€โ”€ healthScore.ts          # 7-category weighted health scoring
โ”‚   โ”‚   โ”œโ”€โ”€ mentalScore.ts          # Mental state calculation
โ”‚   โ”‚   โ”œโ”€โ”€ networth-calculator.ts  # Net worth from all financial sources
โ”‚   โ”‚   โ”œโ”€โ”€ currency.ts             # TRY/USD conversion & formatting
โ”‚   โ”‚   โ”œโ”€โ”€ clsx.ts                 # Conditional class names utility
โ”‚   โ”‚   โ””โ”€โ”€ utils.ts                # General helpers
โ”‚   โ””โ”€โ”€ types/
โ”‚       โ””โ”€โ”€ database.ts             # All TypeScript interfaces & types
โ”œโ”€โ”€ supabase/
โ”‚   โ”œโ”€โ”€ schema.sql                  # Base database schema
โ”‚   โ”œโ”€โ”€ migration_health_restructure.sql
โ”‚   โ”œโ”€โ”€ migration_expenses_tag_based.sql
โ”‚   โ”œโ”€โ”€ migration_investments_claim_based.sql
โ”‚   โ”œโ”€โ”€ migration_target_assets.sql
โ”‚   โ””โ”€โ”€ migration_add_shopping_tag.sql
โ”œโ”€โ”€ tailwind.config.ts              # Custom green/white theme
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ tsconfig.json

๐ŸŽจ Technical Details

Tech Stack

Layer Technology
Framework Next.js 16 (App Router)
Language TypeScript 5.7
UI React 19
Styling Tailwind CSS 3.4 + Custom CSS (white & green theme)
Database Supabase (PostgreSQL)
Auth MetaMask (Web3) via ethers.js
Charts Recharts 2.15
Icons Lucide React
Date Utils date-fns
Exchange Rates MoneyConvert API (live, cached 15 min)

Design System

  • Theme: White & green color palette with glassmorphism effects
  • Animations: Float, pulse-slow, glow keyframe animations
  • Layout: Responsive sidebar navigation with 7 dashboard modules

Health Score Calculation

Final Score = ฮฃ(Category Score ร— Weight) - Illness Penalty

Categories:
  Sleep Duration (10%) + Sleep Timing (15%) + Activity (20%)
  + Nutrition (20%) + Hydration (10%) + Mental State (15%)
  + Extras (10%) = 100%

Illness Penalty: None (0), Mild (-10), Severe (-25)

Net Worth Calculation

Net Worth = Total Income
          - Total Expenses
          - ฮฃ(Active Investments.invested_try)
          + ฮฃ(Claimed Investments.invested_try + realized_pl_try)

๐Ÿšข Deploy to Vercel

  1. Sign in to Vercel with your account
  2. New Project โ†’ Select your GitHub repository
  3. Add Environment Variables:
    • NEXT_PUBLIC_SUPABASE_URL
    • NEXT_PUBLIC_SUPABASE_ANON_KEY
  4. Click Deploy

๐Ÿ”ฎ Future Development

  • AI/LLM integration for personalized recommendations
  • Mobile app (React Native)
  • Data export/import
  • Notification system
  • Fitness tracker integrations (Apple Health, Google Fit)
  • Bank API integration
  • ENS support for display names
  • Psychology tab (standalone analysis)

๐Ÿ“„ License

MIT License

๐Ÿค Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


Made with โค๏ธ using Next.js, Supabase & Web3

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors