How mralaaali-lang/gymcore-erp works
GymCore ERP is a multi-tenant SaaS for gym and health-club operations, with a web interface, a companion mobile app, an Express API, and PostgreSQL tenant isolation. The principal workflow is a staff or member user authenticating, entering a role-specific experience, and using client API calls to manage gym records; the server routes requests through controllers to persistent data. Major branches include member, subscription, attendance, and staff operations, platform billing and reporting, and notifications. README documents the product capabilities and RLS; some controller and route internals were not sampled, so uncertain links are omitted.
Main entry points: index.ts API route registry · app.ts Express application · database.ts PostgreSQL · App.tsx Web application
Components 22
Client applications
- Web application
src/App.tsx - Role-based routes
src/routes/index.tsx - Session and gym context
src/context/GymBrandContext.tsx - Web API client
src/services/api.ts - Mobile application
mobile/App.tsx - Mobile navigation
mobile/src/navigation/AppNavigator.tsx - Mobile API client
mobile/src/services/api.ts
API and access
- Express application
server/src/app.ts - API route registry
server/src/routes/index.ts - Authentication
server/src/controllers/auth.ts - Tenant isolation
server/src/middleware/tenant.ts
Gym operations
- Members and staff
server/src/controllers/members.ts - Subscriptions
server/src/controllers/subscriptions.ts - Attendance
server/src/controllers/attendance.ts - Gym billing
server/src/controllers/billing.controller.ts
Platform services
- Platform administration
server/src/controllers/platformAdmin.ts - Platform billing
server/src/services/billing.service.ts - Analytics and reports
server/src/controllers/analytics.ts - Notifications
server/src/controllers/notificationsEngine.ts
Persistence
- PostgreSQL
server/src/config/database.ts - Tenant context
server/src/config/tenantContext.ts
Other components
- Gym user
Connections 24
- Gym user → Web application: uses
- Web application → Role-based routes: renders routes
src/App.tsx - Role-based routes → Session and gym context: guards by role
src/routes/index.tsx - Session and gym context → Web API client: restores session
src/context/GymBrandContext.tsx - Web API client → Express application: HTTP requests
- Gym user → Mobile application: uses
- Mobile application → Mobile navigation: opens navigation
mobile/App.tsx - Mobile navigation → Mobile API client: uses services
- Mobile API client → Express application: HTTP requests
- Express application → API route registry: mounts routes
server/src/app.ts - API route registry → Authentication: routes auth
- API route registry → Members and staff: routes operations
- API route registry → Subscriptions: routes operations
- API route registry → Attendance: routes operations
- API route registry → Gym billing: routes billing
- API route registry → Platform administration: routes platform
- API route registry → Platform billing: routes billing
- API route registry → Analytics and reports: routes reports
- API route registry → Notifications: routes notifications
- Express application → Tenant isolation: uses middleware
server/src/app.ts - Tenant isolation → Tenant context: sets context
- Tenant context → PostgreSQL: provides client
server/src/config/database.ts - Gym billing → PostgreSQL: queries data
server/src/controllers/billing.controller.ts - Platform billing → PostgreSQL: persists billing