Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gym Management System

A full-stack gym management system built with vanilla JavaScript, Node.js, Express, and PostgreSQL (Neon).

Features

  • 📊 Real-time analytics dashboard
  • 👥 Member management
  • 💪 Trainer tracking
  • 📅 Class scheduling
  • 💰 Payment tracking
  • 📈 Subscription management
  • ✨ Modern UI with Tailwind CSS
  • 📱 Responsive design
  • 📊 Interactive charts

Tech Stack

  • Frontend: HTML, JavaScript, Tailwind CSS, Chart.js
  • Backend: Node.js, Express
  • Database: PostgreSQL (Neon)

Prerequisites

  • Node.js (v14 or higher)
  • npm (Node Package Manager)
  • A Neon PostgreSQL database

Setup

  1. Clone the repository:
git clone <repository-url>
cd gym-management-system
  1. Install dependencies:
npm install
  1. Create a .env file 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
  1. Initialize the database:
psql -h your-neon-host -U your-username -d your-database-name -f schema.sql
  1. Start the server:
npm start

The application will be available at http://localhost:3000

Database Schema

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)

API Endpoints

Members

  • 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

Analytics

  • 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

Trainers

  • GET /api/trainers - Get all trainers

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License.

Releases

Packages

Contributors

Languages