AI-powered fitness platform. Personalized workouts, smart nutrition, QR gym check-ins, trainer bookings, and gamified progress — in one web app.
AuraFit is a full-stack SaaS fitness platform built with the MERN stack. It combines AI-generated workout and nutrition plans (via Google Gemini), real-time gym check-ins, a social community, gamification, and a multi-role admin dashboard.
Live: https://aurafitgymwebsite.onrender.com
- AI Workout Generator — Gemini AI builds a weekly training plan from your goals, schedule, and equipment
- Nutrition Calculator — Macro targets and meal suggestions tailored to your body composition
- QR Check-In — Scan at the gym front desk; attendance tracked automatically with streak rewards
- Progress Tracking — Log weight, body fat, and measurements; view trends over time
- Gamification — Points, level system, achievement badges, and a community leaderboard
- Trainer Booking — Browse trainer profiles, book sessions, submit reviews
- Community Feed — Post updates, like and comment; real-time via WebSocket
- AI Fitness Assistant — Floating chat widget powered by Gemini for on-demand coaching
- PWA — Installable on mobile; works offline with service worker caching
- Dashboard — Member stats, attendance trends, order management
- Business KPIs — MRR, churn rate, retention, DAU/MAU, conversion funnel
- User Management — Role assignment, membership approval, suspension
- Announcements — Push gym-wide notifications to all members
- Analytics — Revenue charts, membership distribution, user growth
- Audit Logs — Immutable log of all admin actions
| Layer | Technology |
|---|---|
| Frontend | React 18, Vite, Framer Motion, react-hot-toast |
| Backend | Node.js, Express.js |
| Database | MongoDB Atlas (Mongoose ODM) |
| Auth | JWT (access + refresh tokens), bcryptjs |
| AI | Google Gemini API |
| Payments | Razorpay (payment gateway + webhooks) |
| Real-time | Socket.IO (WebSocket) |
| Nodemailer (Gmail SMTP) | |
| PDFKit | |
| Security | Helmet, CORS, express-rate-limit, input sanitization |
| Logging | Winston (structured logs, file rotation) |
| Deployment | Render (web service + static files) |
| PWA | vite-plugin-pwa, Workbox |
- Node.js 18+
- npm 9+
- MongoDB Atlas account (free tier works)
- Google AI Studio account (for Gemini API key)
# 1. Clone
git clone https://github.com/Sumant3086/AuraFit.git
cd AuraFit
# 2. Install all dependencies
npm install
cd server && npm install && cd ..
# 3. Configure environment
cp server/.env.example server/.env
cp .env.example .env
# Edit both files with your values (see Environment Variables below)
# 4. Start development servers (client + server concurrently)
npm run devThe client runs at http://localhost:3000 and the API at http://localhost:5000.
server/.env (backend — never commit):
| Variable | Required | Description |
|---|---|---|
MONGODB_URI |
✅ | MongoDB Atlas connection string |
JWT_SECRET |
✅ | JWT signing secret (32+ chars) |
JWT_REFRESH_SECRET |
✅ | Refresh token secret (different from above) |
GOOGLE_API_KEY |
Recommended | Google Gemini API key |
RAZORPAY_KEY_ID |
Recommended | Razorpay test/live key |
RAZORPAY_KEY_SECRET |
Recommended | Razorpay key secret |
EMAIL_USER |
Optional | Gmail address for emails |
EMAIL_APP_PASSWORD |
Optional | Gmail App Password (16 chars) |
ADMIN_EMAIL |
Optional | Default admin account email |
CLIENT_URL |
Optional | Frontend URL for CORS (default: localhost:3000) |
.env (frontend Vite — non-secret only):
| Variable | Description |
|---|---|
VITE_API_URL |
Backend URL (e.g. /api in production) |
VITE_RAZORPAY_KEY_ID |
Razorpay public key ID |
After starting the dev server:
- Go to
http://localhost:3000/signupand create an account - To create an admin: sign up with the email matching
ADMIN_EMAILinserver/.env - Or use
POST /api/seed(admin-only) to generate demo data
AuraFit/
├── src/ # React frontend
│ ├── assets/ # Images, logos
│ ├── brand/ # Design tokens, brand constants
│ ├── components/ # Feature components
│ │ ├── admin/ # Admin dashboard
│ │ ├── auth/ # Login, signup, forgot password
│ │ ├── common/ # Shared: ErrorBoundary, PageWrapper, etc.
│ │ ├── dashboard/ # Member dashboard
│ │ ├── gamification/ # Leaderboard, achievements
│ │ ├── landing/ # Landing page sections
│ │ ├── social/ # Community feed
│ │ ├── settings/ # User settings
│ │ └── trainers/ # Trainer directory + profiles
│ ├── context/ # AuthContext, ThemeContext, SocketContext
│ ├── hooks/ # Custom hooks
│ ├── services/ # API client
│ └── styles/ # Global CSS, design tokens
│
├── server/ # Express API
│ ├── config/ # Database connection
│ ├── jobs/ # Cron jobs (streak reminders, etc.)
│ ├── middleware/ # Auth, security, logging, audit
│ ├── models/ # Mongoose schemas
│ ├── routes/ # API route handlers
│ ├── services/ # Business logic (email, notifications, AI)
│ ├── socket/ # WebSocket server
│ └── utils/ # Env validation, helpers
│
├── public/ # Static assets (favicon, icons, sitemap)
├── .github/workflows/ # CI/CD (GitHub Actions)
├── render.yaml # Render deployment config
└── package.json
Base URL: https://aurafitgymwebsite.onrender.com/api
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/auth/signup |
— | Create account |
POST |
/auth/login |
— | Sign in, get JWT |
GET |
/auth/me |
JWT | Get current user |
GET |
/achievements/leaderboard |
JWT | Leaderboard data |
GET |
/attendance/stats/me |
JWT | My check-in stats |
POST |
/attendance/self-checkin |
JWT | Quick check-in |
GET |
/social/feed |
JWT | Community posts |
POST |
/social |
JWT | Create post |
GET |
/trainers |
— | List all trainers |
POST |
/ai-chat/message |
JWT | Chat with AuraBot |
GET |
/reports/progress |
JWT | Download PDF report |
GET |
/api/health |
— | Server health check |
Full API documentation available in the codebase — see server/routes/.
- Fork this repo and push to GitHub
- Create a new Web Service on render.com
- Connect your GitHub repo — Render detects
render.yamlautomatically - Set environment variables in the Render dashboard (see above)
- Deploy — the
render-buildscript handles everything
The render.yaml in this repo configures:
- Build:
npm ci && npm run build && cd server && npm ci - Start:
cd server && node server.js - Health check:
/api/health
- Create a free cluster at cloud.mongodb.com
- Create a database user with read/write access
- Add
0.0.0.0/0to IP allowlist (for Render's dynamic IPs) - Copy the connection string to
MONGODB_URIin Render's env vars
- JWT authentication with 15-minute access tokens and 7-day refresh tokens; session tracking per device
- Rate limiting on all API routes (100 req/15min general, 5 req/15min auth)
- WebSocket (Socket.IO) for real-time community posts, notifications, and leaderboard updates
- Cron jobs (node-cron) for streak reminders, membership expiry alerts, and re-engagement emails
- Audit logging for all admin actions with 1-year TTL
- PWA with Workbox service worker — offline-capable, installable
Screenshots available at the live demo.
Sumant Yadav
- GitHub: @Sumant3086
- Email: sumantyadav3086@gmail.com
MIT — see LICENSE for details.