A private full-stack AI fitness app โ PostgreSQL backend, JWT auth, free Claude AI via Puter.js, Wear OS support, and a polished public demo landing page.
ForgeFit is a private full-stack personal fitness web app for complete beginners targeting visible abs and a healthy lifestyle. It has a Node.js + PostgreSQL backend with JWT authentication, free Claude AI coaching via Puter.js (no API key, no billing), Samsung Health data import, a Wear OS watch layout, and a full alarm/reminder system.
The public landing page (/) showcases the app as a portfolio project. The actual app lives at /app/ โ private, login-required, with AI features unlocking via a free Puter account during onboarding.
| Feature | Description |
|---|---|
| ๐ Private Accounts | No public signup. Admin creates users directly via SQL. JWT tokens, 30-day sessions. |
| ๐ Public Landing Page | Polished demo/portfolio page at / โ showcases features, phone mockup, tech stack, CTAs. |
| ๐ค Smart Onboarding | First-login profile setup with BMI-based goal recommendations. Puter sign-in during onboarding for immediate AI access. |
| ๐ค AI Coach (Free) | Claude Sonnet via Puter.js โ completely free, no API key. Knows your BMI, goal, fitness level, and Indian dietary context. |
| ๐ Health Report Analysis | Upload MovingLife/HealthSense screenshot โ AI reads it via Puter vision, extracts metrics, builds 5-point action plan. |
| ๐ Progress Tracking | PostgreSQL-backed weight, BMI, and session logs with live Chart.js graphs. Synced across all devices. |
| ๐๏ธ Goal-Aware Workouts | Exercise list adapts to your goal (fat loss, abs, muscle, recomposition). AI generates custom session plans. |
| ๐ฑ Samsung Health Import | Export JSON from Samsung Health, import weight and step data directly. |
| โ Wear OS Layout | Minimal watch UI at ?watch=1 โ streak, water, steps, BMI, next alarm, quick-log buttons. |
| ๐ Smart Alarms | Time-based reminders with Web Audio API sounds, browser notifications, haptic vibration, and snooze. Synced to DB. |
| ๐ง Water Reminder | Daily glass tracking, progress rings, goal logging. |
forgefit.rakshitr.co.in
โ
โโโ / โ Landing page (public portfolio demo)
โโโ /app/ โ PWA app (login required)
โโโ /api/ โ Express REST API (JWT protected)
โ
โโโ PostgreSQL (auth, profiles, logs, alarms)
โโโ AI: Puter.js client-side โ Claude Sonnet (FREE)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Docker on your server โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโ โ
โ โ Nginx โ โ Node.js API โ โ Postgres โ โ
โ โ :80/:443 โโ โ :3001 โโ โ :5432 โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTPS
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโ
โ Android PWA โ โ Desktop โ โ Wear OS โ
โ /app/ โ โ phone shell โ โ ?watch=1 โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโ
- Docker + Docker Compose installed on your server
- Domain pointing to your server (
forgefit.rakshitr.co.in) - SSL certificate (Let's Encrypt recommended)
- A free Puter account for AI features (no billing ever)
git clone https://github.com/yourusername/forgefit.git
cd forgefit
cp .env.example .env
nano .envYour .env needs only two secrets:
DB_PASSWORD=your_strong_database_password
JWT_SECRET=64_char_hex_string
FRONTEND_URL=https://forgefit.rakshitr.co.inGenerate a secure JWT secret:
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"No Anthropic API key needed. AI is handled client-side via Puter.js for free.
mkdir nginx/certs
# Using Certbot (Let's Encrypt):
certbot certonly --standalone -d forgefit.rakshitr.co.in
cp /etc/letsencrypt/live/forgefit.rakshitr.co.in/fullchain.pem nginx/certs/
cp /etc/letsencrypt/live/forgefit.rakshitr.co.in/privkey.pem nginx/certs/docker-compose up -d --build
# Verify all 3 services are healthy
docker-compose ps
# Stream logs
docker-compose logs -f api# Connect to the database
docker exec -it forgefit_db psql -U forgefit_user -d forgefit-- Create your admin account
INSERT INTO users (username, email, password_hash, role)
VALUES (
'rakshit',
'rakshitr2000@gmail.com',
crypt('your_secure_password', gen_salt('bf')),
'admin'
);
-- Create a regular user for someone else
INSERT INTO users (username, email, password_hash)
VALUES (
'friend',
'friend@example.com',
crypt('their_password', gen_salt('bf'))
);
-- Verify accounts
SELECT id, username, email, role, is_active FROM users;Other useful SQL commands:
-- Deactivate a user
UPDATE users SET is_active = false WHERE username = 'friend';
-- Reset a password
UPDATE users SET password_hash = crypt('new_password', gen_salt('bf'))
WHERE username = 'friend';
-- View all activity
SELECT u.username, p.goal, p.bmi, COUNT(w.id) AS sessions
FROM users u
LEFT JOIN profiles p ON p.user_id = u.id
LEFT JOIN workout_logs w ON w.user_id = u.id
GROUP BY u.username, p.goal, p.bmi;1. Visit https://forgefit.rakshitr.co.in/app/
2. Log in with your credentials
3. Profile setup screen appears (first login only):
โข Enter name, age, sex, height, weight, activity level
โข App shows BMI-based goal recommendations
โข Select your goal
โข Tap "START MY JOURNEY" โ Puter sign-in popup appears
โข Sign in / create free Puter account
โข AI features are now active โ free forever
4. App loads with your personalised plan
1. Open https://forgefit.rakshitr.co.in/app/ in Chrome
2. Log in
3. Chrome shows "Add to Home Screen" banner โ Install
OR: โฎ Menu โ Add to Home Screen โ Install
4. App launches fullscreen โ no browser chrome
Browser on Wear OS โ https://forgefit.rakshitr.co.in/app/?watch=1
Shows: time, date, streak, water, steps, BMI, next alarm. Quick-tap: log workout โ or log water ๐ง.
forgefit/
โโโ docker-compose.yml # PostgreSQL + Node API + Nginx
โโโ .env.example # Environment template (no API keys needed)
โโโ .gitignore
โโโ README.md
โ
โโโ frontend/public/
โ โโโ index.html # Public landing / demo page (shown at /)
โ โโโ manifest.json # Root PWA manifest
โ โโโ sw.js # Root service worker
โ โโโ app/
โ โโโ index.html # Full PWA app (shown at /app/)
โ โโโ manifest.json # App PWA manifest (start_url: /app/)
โ โโโ sw.js # App service worker
โ
โโโ backend/
โ โโโ Dockerfile
โ โโโ package.json # No Anthropic โ uses Puter.js client-side
โ โโโ db/schema.sql # Full PostgreSQL schema + admin SQL commands
โ โโโ src/
โ โโโ index.js # Express server (auth, profile, logs, alarms only)
โ โโโ db/pool.js # PostgreSQL connection pool
โ โโโ middleware/auth.js # JWT middleware
โ โโโ routes/
โ โโโ auth.js # POST /api/auth/login, /api/auth/refresh
โ โโโ profile.js # GET/PUT /api/profile
โ โโโ logs.js # Metric, workout, daily goal logs + streak
โ โโโ alarms.js # Full alarm CRUD
โ
โโโ nginx/
โโโ nginx.conf # / โ landing, /app/ โ PWA, /api/ โ Node
โโโ certs/ # SSL certs (not committed)
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/api/auth/login |
โ | Login โ JWT token |
POST |
/api/auth/refresh |
โ | Refresh JWT |
GET |
/api/profile |
โ | Get user profile + BMI |
PUT |
/api/profile |
โ | Create / update profile |
POST |
/api/logs/metric |
โ | Log weight / BMI / body fat |
GET |
/api/logs/metric |
โ | Get metric history |
POST |
/api/logs/workout |
โ | Log a completed workout session |
GET |
/api/logs/workout |
โ | Get workout history |
GET |
/api/logs/streak |
โ | Get streak + total session count |
GET |
/api/logs/daily |
โ | Get today's water / steps / workout |
PATCH |
/api/logs/daily |
โ | Update today's goals |
GET |
/api/alarms |
โ | List all user alarms |
POST |
/api/alarms |
โ | Create an alarm |
PATCH |
/api/alarms/:id |
โ | Toggle / update alarm |
DELETE |
/api/alarms/:id |
โ | Delete an alarm |
AI endpoints โ there are none. All AI calls go directly from the browser to Puter.js (
puter.ai.chat), which proxies Claude Sonnet for free.
- Public landing / demo page at
/ - Private PWA app at
/app/ - JWT auth (admin SQL account creation)
- BMI-based goal recommendations on onboarding
- Puter.js sign-in during onboarding
- Free Claude AI coach via Puter.js (zero API cost)
- Health report image analysis (Puter vision)
- PostgreSQL progress tracking with live charts
- Goal-aware workout exercise lists
- Samsung Health JSON import
- Smart alarms with audio + notifications + snooze
- PWA โ installable on Android
- Wear OS optimised layout at
?watch=1 - Desktop phone-shell + portfolio sidebar
- Apple Health export support
- Meal & calorie logging
- Admin dashboard UI for managing users
- Push notifications via Web Push API
Rakshit Rangarajan