A modern, feature-rich gym management system built with Next.js, React, and Tailwind CSS
GymFlow is a complete, production-ready gym management system designed to streamline all operations for gym businesses. It provides a sleek, modern interface built with Next.js and shadcn/ui components, offering comprehensive functionality for managing members, tracking attendance, processing payments, scheduling classes, and generating detailed analytics.
Status: β
Production Ready
Version: 2.0.0
Last Updated: April 2026
- Comprehensive Profiles: Store personal details, contact info, emergency contacts
- Membership Types: Basic, Premium, Elite, Trial
- Status Tracking: Active, Expired, Pending, Cancelled
- Search & Filter: Quick member lookup by name, email, phone
- Bulk Operations: Edit or delete multiple members at once
- Import/Export: CSV support for data migration
- Real-time Check-in/Check-out: Log member visits with timestamps
- Attendance History: View detailed records with notes
- Daily Reports: Track gym traffic patterns
- Duration Calculation: Automatic workout duration tracking
- Batch Check-in: Check in multiple members quickly
- Automated Invoicing: Create invoices for memberships, services, products
- Multiple Payment Methods: Cash, Card, Bank Transfer, Cheque
- Payment Status Tracking: Paid, Pending, Overdue, Partial
- Revenue Reports: Monthly and custom period reports
- Payment Reminders: Automatic notifications for pending payments
- Invoice Management: Create, edit, track, and archive invoices
- Class Management: Create and manage fitness classes
- Instructor Assignment: Assign trainers to classes
- Capacity Control: Prevent overbooking with limits
- Member Enrollment: Track class attendance
- Schedule Management: Recurring and custom schedules
- Notification System: Alert members of class updates
- Stock Tracking: Monitor equipment, supplements, merchandise
- Low Stock Alerts: Automatic notifications when items need reordering
- Categorization: Equipment, Consumables, Services, Merchandise
- Cost Tracking: Monitor inventory costs and value
- Usage Reports: Track inventory consumption trends
- Staff Profiles: Manage trainers, receptionists, maintenance staff
- Role-based Access: Admin, Staff, Trainer roles
- Payroll Tracking: Salary and employment details
- Performance Metrics: Track staff-related statistics
- Contact Management: Store and manage staff information
- Interactive Dashboard: Real-time overview of key metrics
- 8+ Report Types:
- Revenue Analysis (daily/weekly/monthly)
- Member Retention Analysis
- Attendance Trends
- Staff Performance
- Inventory Status
- Conversion Rates
- Class Popularity
- Equipment Usage
- Export Functionality: Download reports as CSV/PDF
- Trend Analysis: Visual charts and graphs
- Custom Date Ranges: Filter reports by any period
- Membership Expiry Alerts: Notify before expiration
- Low Stock Warnings: Alert when inventory is low
- Payment Reminders: Remind members of pending payments
- Class Updates: Notify of schedule changes
- System Notifications: Important gym events
βββββββββββββββββββββββββββββββββββββββββββββββ
β Next.js 14 (App Router) β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β React 18 (Hooks, Context) β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Tailwind CSS 3 (Styling) β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β shadcn/ui (Component Library) β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Zustand (State Management) β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β React Hook Form (Form Management) β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Recharts (Data Visualization) β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Axios (HTTP Client) β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β date-fns (Date Manipulation) β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Lucide React (Icons) β
βββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββ
β Node.js v18+ & Express.js v4.18+ β
ββββββββββββββββββββββββββββββββββββββββββββββββ€
β Authentication: JWT + refresh tokens β
ββββββββββββββββββββββββββββββββββββββββββββββββ€
β Security: bcrypt, helmet, CORS, rate limit β
ββββββββββββββββββββββββββββββββββββββββββββββββ€
β Real-time: Socket.io (WebSockets) β
ββββββββββββββββββββββββββββββββββββββββββββββββ€
β Database: PostgreSQL (production) β
β JSON file (development) β
ββββββββββββββββββββββββββββββββββββββββββββββββ€
β Validation: express-validator β
ββββββββββββββββββββββββββββββββββββββββββββββββ€
β DevOps: PM2, Docker, AWS deployment-ready β
ββββββββββββββββββββββββββββββββββββββββββββββββ
- Hosting: AWS Elastic Beanstalk (backend) + S3 + CloudFront (frontend)
- Database: PostgreSQL (AWS RDS)
- Containerization: Docker support
- CI/CD: GitHub Actions ready
- Monitoring: CloudWatch integration
- Node.js v18 or higher
- npm or yarn
- Git
git clone https://github.com/yourusername/gymflow-nextjs.git
cd gymflow-nextjsnpm install
# or
yarn installcp .env.local.example .env.localEdit .env.local:
NEXT_PUBLIC_API_URL=http://localhost:5000
NEXT_PUBLIC_WS_URL=http://localhost:5000
NEXT_PUBLIC_JWT_SECRET=your_secret_key_herenpm run dev
# or
yarn devOpen http://localhost:3000 in your browser.
- Ensure the backend server is running on
http://localhost:5000 - The frontend will automatically connect to the API
Email: admin@gym.com
Password: password123
- Navigate to http://localhost:3000/login
- Enter demo credentials (admin@gym.com / password123)
- Click "Sign In"
- Unit tests are located in the
tests/folder. A small suite validates the RBAC helpers inlib/permissions.ts(hierarchy ordering, management checks, route visibility, and helper utilities). - Run the tests with:
npm run test- Go to Members page
- Click "Add Member" button
- Fill in member details:
- Full Name
- Phone
- Membership Type
- Join & Expiry dates
- Click "Add Member"
- Go to Attendance page
- Click "Check-in Member" button
- Select member from dropdown
- Add optional notes
- Click "Check-in"
- Go to Billing page
- Click "Create Invoice" button
- Select member and amount
- Set due date
- Click "Create Invoice"
- Navigate to Dashboard
- View real-time statistics:
- Active members count
- Today's revenue
- Daily visits
- Pending payments
- Check revenue and attendance charts
gymflow-nextjs/
βββ app/ # Next.js app directory
β βββ layout.tsx # Root layout
β βββ page.tsx # Home/index page
β βββ globals.css # Global styles
β βββ login/ # Authentication pages
β β βββ page.tsx
β βββ register/
β β βββ page.tsx
β βββ dashboard/ # Main features
β β βββ page.tsx # Dashboard home
β βββ members/
β β βββ page.tsx # Members management
β βββ attendance/
β β βββ page.tsx # Check-in/Check-out
β βββ billing/
β β βββ page.tsx # Invoices & payments
β βββ classes/
β β βββ page.tsx # Class scheduling
β βββ inventory/
β β βββ page.tsx # Stock management
β βββ staff/
β β βββ page.tsx # HR management
β βββ notifications/
β β βββ page.tsx # Alerts & notifications
β βββ settings/
β βββ page.tsx # Configuration
β
βββ components/
β βββ ui/ # shadcn/ui components
β β βββ button.tsx
β β βββ card.tsx
β β βββ input.tsx
β β βββ label.tsx
β β βββ badge.tsx
β β βββ table.tsx
β β βββ dialog.tsx
β βββ layout/ # Layout components
β βββ sidebar.tsx # Navigation sidebar
β βββ protected-layout.tsx # Auth protection wrapper
β
βββ lib/
β βββ api-client.ts # Axios HTTP client
β βββ store.ts # Zustand state management
β βββ utils.ts # Utility functions
β
βββ hooks/
β βββ index.ts # Custom React hooks
β
βββ utils/
β βββ format.ts # Formatting utilities
β
βββ types/
β βββ index.ts # TypeScript types & interfaces
β
βββ public/ # Static assets
β
βββ .env.local # Environment variables
βββ package.json
βββ tsconfig.json
βββ next.config.js
βββ tailwind.config.ts
βββ postcss.config.js
βββ README.md # This file
- β JWT Authentication with 15-minute token expiry
- β Password Hashing with bcrypt
- β Rate Limiting (10 login attempts per 15 minutes)
- β XSS Protection with sanitize-html
- β CORS enabled for trusted origins
- β Secure Headers via helmet
- β SQL Injection Prevention via prepared statements
- β Refresh Token Rotation for enhanced security
- β HTTPS Ready for production
- β Role-based Access Control (RBAC)
The frontend communicates with the backend via RESTful API endpoints:
Authentication
POST /api/auth/register- Create accountPOST /api/auth/login- LoginPOST /api/auth/logout- LogoutPOST /api/auth/refresh- Refresh token
Members
GET /api/members- Get all membersPOST /api/members- Create memberPUT /api/members/:id- Update memberDELETE /api/members/:id- Delete member
Attendance
GET /api/attendance- Get recordsPOST /api/attendance/checkin- Check inPOST /api/attendance/:id/checkout- Check out
Billing
GET /api/billing- Get invoicesPOST /api/billing- Create invoicePOST /api/payments- Record payment
And more... (Classes, Inventory, Staff, Settings, Notifications)
Edit app/globals.css:
:root {
--primary: 0 0% 9.0%; /* Change to your brand color */
--secondary: 0 0% 96.1%;
/* ... other colors ... */
}- Create new folder in
app/(e.g.,app/reports/) - Add
page.tsx:
'use client'
import { ProtectedLayout } from '@/components/layout/protected-layout'
export default function ReportsPage() {
return (
<ProtectedLayout>
{/* Your content here */}
</ProtectedLayout>
)
}- Add navigation item in
components/layout/sidebar.tsx
// components/custom/MyComponent.tsx
export function MyComponent() {
return <div>Custom content</div>
}Then import and use:
import { MyComponent } from '@/components/custom/MyComponent'# Run type checking
npm run type-check
# Build for production
npm run build
# Start production server
npm startThe dashboard provides comprehensive analytics:
- Real-time Stats: Active members, revenue, daily visits
- Revenue Trends: Weekly/monthly revenue charts
- Attendance Patterns: Daily visit trends
- Member Analytics: Retention, growth, churn
- Payment Status: Paid vs pending invoices
- Inventory Status: Low stock alerts
Click "Download" on any report to export as CSV.
npm install -g vercel
vercelSee backend repository for deployment instructions.
NEXT_PUBLIC_API_URL=https://api.yourdomain.com
NEXT_PUBLIC_WS_URL=https://api.yourdomain.com
NEXT_PUBLIC_JWT_SECRET=your_production_secret- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@gymflow.app
- Documentation: Full Docs
This project is licensed under the MIT License - see LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Mobile app (React Native)
- Advanced analytics dashboard
- Multi-gym support
- AI-powered member recommendations
- Video tutorials integration
- API documentation (Swagger)
- Automated backups
- Two-factor authentication
- Member app/portal
- Advanced reporting (PDF generation)
- Built with Next.js
- UI Components from shadcn/ui
- Icons from Lucide
- Styling with Tailwind CSS
- State management with Zustand
If you find this project helpful, please give it a star! β
Made with πͺ for gym owners and fitness enthusiasts
Last Updated: April 2026 | Version 2.0.0