Multi-tenant gym SaaS MVP for India.
- Web: Next.js (App Router)
- Mobile: Flutter (Android first)
- Backend: Spring Boot 3 + Java 21
- Database: PostgreSQL 16
- Infra: Docker Compose + Nginx
backend/ # Spring Boot tenant-aware API
database/init/ # DB init SQL
docker/ # Compose + nginx
docs/ # Documentation
mobile/ # Flutter app (OTP + role routing)
web/ # Next.js app (onboarding + dashboard + microsite)
- Owner web onboarding with 14-day trial provisioning
- Slug-based tenant creation
- Tenant-aware entities with tenant_id
- Owner/member/trainer role model
- Mobile OTP request + verify flow (debug OTP for dev)
- Dashboard summary API and UI
- Member/Trainer quick add
- Public microsite by slug
- Daily QR generate and attendance scan API with duplicate same-day prevention
- Dockerized local stack
- Copy root env:
copy .env.example .env
- Backend env (optional if using defaults):
copy backend\.env.example backend\.env
- Web env:
copy web\.env.example web\.env.local
From repository root:
docker compose -f docker/docker-compose.yml --env-file .env up --build
Services:
- Web: http://localhost:3000
- Backend: http://localhost:8080
- Postgres: localhost:5432
- Nginx: http://localhost:80
cd backend
mvn spring-boot:run
cd web
npm install
npm run dev
cd mobile
flutter pub get
flutter run --dart-define=API_BASE_URL=http://10.0.2.2:8080 --dart-define=TENANT_SLUG=your-slug
- POST /api/auth/owner/register
- POST /api/auth/mobile/otp
- POST /api/auth/mobile/verify
- POST /api/tenant/create
- GET /api/public/{slug}
- POST /api/member
- POST /api/trainer
- GET /api/dashboard/summary?tenantSlug={slug}
- POST /api/attendance/qr/generate
- POST /api/attendance/scan
- Register owner from web signup page.
- Open slug dashboard page and add one trainer + one member.
- Call QR generate endpoint for that slug.
- In mobile app, request OTP using trainer/member number.
- Verify OTP with returned debug code.
- OTP SMS provider integration is intentionally mocked for MVP speed.
- Security is baseline and should be hardened in next iteration (JWT, refresh tokens, RBAC guards).
- Flutter project is scaffold-level MVP; run
flutter create .insidemobile/once to generate Android/iOS platform folders if not already present.
- Add JWT auth and guarded dashboard routes.
- Add real SMS provider integration (MSG91/Twilio).
- Add production wildcard domain + SSL on VPS.
- Add QR scanning package in Flutter and attendance call wiring.
- Add CI/CD pipelines in .github/workflows.