A full-stack gym management system built with vanilla JavaScript, Node.js, Express, and PostgreSQL (Neon).
- 📊 Real-time analytics dashboard
- 👥 Member management
- 💪 Trainer tracking
- 📅 Class scheduling
- 💰 Payment tracking
- 📈 Subscription management
- ✨ Modern UI with Tailwind CSS
- 📱 Responsive design
- 📊 Interactive charts
- Frontend: HTML, JavaScript, Tailwind CSS, Chart.js
- Backend: Node.js, Express
- Database: PostgreSQL (Neon)
- Node.js (v14 or higher)
- npm (Node Package Manager)
- A Neon PostgreSQL database
- Clone the repository:
git clone <repository-url>
cd gym-management-system- Install dependencies:
npm install- Create a
.envfile in the root directory with your Neon database credentials:
PGHOST=your-neon-host
PGDATABASE=your-database-name
PGUSER=your-username
PGPASSWORD=your-password
PGPORT=5432
ENDPOINT_ID=your-endpoint-id
PORT=3000- Initialize the database:
psql -h your-neon-host -U your-username -d your-database-name -f schema.sql- Start the server:
npm startThe application will be available at http://localhost:3000
The system uses the following tables:
- MEMBERS (member_id, name, email, phone, join_date)
- TRAINERS (trainer_id, name, specialization, email, phone)
- CLASSES (class_id, class_name, schedule, trainer_id)
- EQUIPMENT (equipment_id, name, purchase_date, condition)
- SUBSCRIPTIONS (subscription_id, member_id, start_date, end_date, type)
- PAYMENTS (payment_id, member_id, amount, payment_date, method)
- ATTENDANCE (attendance_id, member_id, date, status)
- SESSIONS (session_id, member_id, trainer_id, session_date, duration)
- FEEDBACK (feedback_id, member_id, trainer_id, rating, comments, feedback_date)
- WORKOUTPLAN (plan_id, member_id, trainer_id, plan_name, description, start_date, end_date, created_at)
- GET
/api/members- Get all members - POST
/api/members- Add a new member - PUT
/api/members/:id- Update a member - DELETE
/api/members/:id- Delete a member
- GET
/api/analytics/member-count- Get total member count - GET
/api/analytics/payment-trends- Get payment trends data - GET
/api/analytics/subscription-types- Get subscription type distribution
- GET
/api/trainers- Get all trainers
- 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
This project is licensed under the MIT License.