Skip to content

iroshads/Founder-Mode

Repository files navigation

Founder Mode 👔

A gamified time-tracking app that turns your founder hours into earnings, complete with levels, badges, streaks, and a motivational boss avatar.

Features

  • Firebase Authentication: Secure login with Google OAuth or email/password
  • Dual Logging System: Quick Add for fast entries or Live Timer for real-time tracking
  • Gamification: Levels (every $500 earned), achievement badges, and daily streaks
  • Analytics: Beautiful charts showing earnings by role and trends over time
  • Role Management: Configure multiple roles with custom hourly rates and colors
  • Project Tracking: Organize entries by projects
  • Export: Download all your data as CSV
  • Offline Support: IndexedDB queue for offline entry creation
  • Keyboard Shortcuts: Press L to open Log Time modal quickly

Tech Stack

Frontend

  • React + TypeScript
  • Vite (dev server)
  • TailwindCSS (styling)
  • React Query (server state management)
  • Zustand (local UI state)
  • Chart.js (analytics visualizations)
  • React Router (navigation)

Backend

  • FastAPI (Python)
  • SQLAlchemy ORM
  • SQLite database
  • Pydantic (validation)

How to Run Locally

The app runs automatically when you start the Replit. Both backend and frontend servers start together.

Manual Start

If you need to start the servers manually:

cd server && python main.py &
cd client && npm run dev

Backend runs on port 8000, frontend on port 5000 (with proxy to backend).

Default Roles and Rates

The app seeds with these default roles on first run:

Role Default Hourly Rate Color
Product Manager $50/hr Blue
Go To Market $40/hr Green
Fundraiser $75/hr Orange
Designer $30/hr Purple
Admin Manager $20/hr Gray
Coder Not set Red

How to Change Default Rates

  1. Navigate to Roles & Rates page
  2. Click Edit on any role
  3. Update the hourly rate
  4. Click Update Role

All future time entries for that role will use the new rate. Past entries remain unchanged.

Data Model

┌──────────────┐
│    roles     │
├──────────────┤
│ id           │
│ name         │
│ hourly_rate  │◄──┐
│ color        │   │
│ created_at   │   │
│ updated_at   │   │
└──────────────┘   │
                   │
┌──────────────┐   │
│   projects   │   │
├──────────────┤   │
│ id           │◄──┼──┐
│ name         │   │  │
│ color        │   │  │
│ created_at   │   │  │
└──────────────┘   │  │
                   │  │
┌──────────────────┼──┼──┐
│     entries      │  │  │
├──────────────────┼──┼──┤
│ id               │  │  │
│ role_id          ├──┘  │
│ project_id       ├─────┘
│ started_at       │
│ duration_minutes │
│ note             │
│ tags (JSON)      │
│ created_at       │
└──────────────────┘

┌──────────────────┐
│  achievements    │
├──────────────────┤
│ id               │
│ code             │
│ title            │
│ description      │
│ earned_at        │
└──────────────────┘

┌──────────────────┐
│    settings      │
├──────────────────┤
│ id               │
│ key              │
│ value            │
└──────────────────┘

Achievement Badges

  • First Blood: Log your first time entry
  • Power Hour: Complete a 60-minute session in one entry
  • Tri-Role: Work in 3 different roles in a single day
  • Weekly Warrior: Hit your weekly goal
  • Fundraising Beast: Log 5+ hours as Fundraiser in a week

Streaks

A streak day requires at least 30 minutes of logged time. The dashboard shows your current streak and longest streak.

Levels

You gain 1 level for every $500 earned. The dashboard shows a progress bar indicating how close you are to the next level.

Boss Avatar Messages

Your boss reacts based on your activity:

  • No entries by 2pm: "Let's ship something today"
  • Hit daily goal: "Nice. Clocked in like a pro"
  • Work across 3+ roles: "Versatile. Keep it up"

Settings

Configure your experience:

  • Daily Goal: Target minutes per day (default: 240 = 4 hours)
  • Weekly Goal: Target minutes per week (default: 1200 = 20 hours)
  • Currency: Display currency code (default: USD)
  • Gamification: Toggle confetti and sound effects

Export Data

  1. Navigate to Settings
  2. Click Export CSV
  3. Your browser downloads a CSV with all entries

Filters from the History page apply to exports.

Keyboard Shortcuts

  • L - Open Log Time modal (when not typing in an input)
  • S - Start/Stop timer (when in Timer mode)
  • E - Export data (when on History page)

Resetting Data

To reset and re-seed the database:

rm server/founder_mode.db
# Restart the server
cd server && python main.py

The database will be recreated with default roles and sample entries.

Testing

Run backend tests:

cd server
pytest

Tests cover:

  • Entry earnings calculations with various scenarios
  • Level progression logic
  • Achievement detection

Deployment on Replit

Development

The app is pre-configured to run on Replit:

  1. The workflow automatically starts both servers
  2. Frontend runs on port 5000 (dev server)
  3. Backend API runs on port 8000
  4. Vite proxies /api requests to the backend

Production Deployment

The app is configured for autoscale deployment:

  1. Build: Frontend is built with npm run build
  2. Run: FastAPI serves both the static frontend and API on port 5000
  3. Click "Deploy" in Replit to publish your app
  4. After deployment, add your production domain to Firebase Authorized domains

Important: Before deploying, make sure you have:

  • Set up Firebase credentials (VITE_FIREBASE_PROJECT_ID, VITE_FIREBASE_APP_ID, VITE_FIREBASE_API_KEY)
  • Added your Replit domain to Firebase Console > Authentication > Settings > Authorized domains

Project Structure

/
├── server/               # FastAPI backend
│   ├── main.py          # API routes and app setup
│   ├── models.py        # SQLAlchemy models
│   ├── schemas.py       # Pydantic schemas
│   ├── database.py      # Database configuration
│   ├── seeder.py        # Data seeding logic
│   ├── gamification.py  # Achievement & level logic
│   ├── test_main.py     # Unit tests
│   └── requirements.txt # Python dependencies
│
├── client/              # React frontend
│   ├── src/
│   │   ├── api/         # API client
│   │   ├── components/  # Reusable components
│   │   ├── pages/       # Page components
│   │   ├── store/       # Zustand stores
│   │   ├── types/       # TypeScript types
│   │   ├── utils/       # Utilities (offline queue)
│   │   ├── App.tsx      # Main app component
│   │   └── main.tsx     # Entry point
│   ├── vite.config.ts   # Vite configuration
│   └── package.json     # Node dependencies
│
├── start.sh             # Startup script
└── README.md            # This file

API Endpoints

Roles

  • GET /api/roles - List all roles
  • POST /api/roles - Create role
  • PATCH /api/roles/:id - Update role
  • DELETE /api/roles/:id - Delete role

Projects

  • GET /api/projects - List all projects
  • POST /api/projects - Create project

Entries

  • GET /api/entries?from=ISO&to=ISO&roleId=&projectId=&q= - List entries with filters
  • POST /api/entries - Create entry
  • PATCH /api/entries/:id - Update entry
  • DELETE /api/entries/:id - Delete entry

Analytics & Stats

  • GET /api/summary?range=day|week|month|quarter|year - Get summary stats
  • GET /api/stats - Get levels, streaks, boss message
  • GET /api/achievements - List all achievements

Settings

  • GET /api/settings - List all settings
  • POST /api/settings - Upsert setting

Export

  • GET /api/export.csv?filters - Export entries as CSV

Data Management

  • DELETE /api/reset - Reset all entries and achievements (preserves roles and settings)

Resetting Your Data

If you want to start fresh, you can reset all your data from the Settings page:

  1. Navigate to Settings
  2. Scroll down to the Danger Zone section
  3. Click Reset All Data
  4. Confirm the action

This will:

  • ✓ Delete all time entries
  • ✓ Clear all achievements and streaks
  • ✓ Reset your total earnings to $0
  • ✓ Reset your level to 1
  • ✓ Preserve your role rates and settings
  • ✓ Clear any offline queued entries

License

MIT

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors