Skip to content

A responsive site built with HTML, CSS, JS, Bootstrap, AJAX, PHP, and MySQL. Features include a landing page, login, dashboard for member management, analytics, reminders for expired memberships, mailer with a rich text editor, and dark mode.

Notifications You must be signed in to change notification settings

smartbooty69/Horizon-Gym-Management-System

Repository files navigation

Horizon Gym Management System

A modern gym management system built with Next.js, TypeScript, and Tailwind CSS, using Supabase as the online database.

Features

  • 🏠 Landing page with gym information
  • 🔐 Admin authentication
  • 👥 Member management (Add, View, Edit, Delete, Renew)
  • 📊 Analytics dashboard with charts
  • 📦 Package management
  • 📧 Email notifications and reminders
  • 🌙 Dark mode support

Tech Stack

  • Framework: Next.js 14
  • Language: TypeScript
  • Styling: Tailwind CSS
  • Database: Supabase (PostgreSQL)
  • Charts: Recharts
  • Authentication: JWT

Getting Started

Prerequisites

  • Node.js 18+ installed
  • A Supabase account (free tier available)

Setup Instructions

  1. Clone the repository

    git clone <repository-url>
    cd Horizon-Gym-Management-System
  2. Install dependencies

    npm install
  3. Set up Supabase

    • Create a new project at supabase.com
    • Run the SQL schema from supabase/schema.sql in your Supabase SQL editor
    • Get your project URL and API keys from Settings > API
  4. Configure environment variables

    cp .env.local.example .env.local

    Then edit .env.local with your Supabase credentials:

    NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
    SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
    JWT_SECRET=your_jwt_secret
    
  5. Set up the database

    • Go to your Supabase project dashboard
    • Navigate to SQL Editor
    • Run the SQL from supabase/schema.sql to create tables
  6. Set up admin user

    node scripts/setup-admin.js

    This will create an admin user with:

    • Username: admin
    • Password: admin

    ⚠️ Important: Change these credentials in production!

  7. Run the development server

    npm run dev
  8. Open your browser Navigate to http://localhost:3000

Database Setup

The database schema is provided in supabase/schema.sql. This includes:

  • member_details - Stores member information
  • package_details - Stores membership packages
  • admin_users - Stores admin credentials

Run this SQL in your Supabase SQL editor to create the tables.

Project Structure

├── app/                    # Next.js app directory
│   ├── api/               # API routes
│   ├── dashboard/         # Dashboard pages
│   ├── login/             # Login page
│   └── page.tsx           # Landing page
├── components/            # React components
├── lib/                   # Utility functions
│   ├── supabase.ts       # Supabase client
│   └── auth.ts           # Authentication utilities
├── types/                 # TypeScript types
└── public/               # Static assets (move assets/ folder here)

Note: Move your assets/ folder to public/assets/ so images are accessible. The application expects images at paths like /assets/img/landingpage/logo-nav.png.

Default Login Credentials

  • Username: admin
  • Password: admin

⚠️ Important: Change these credentials in production!

Features Overview

Member Management

  • Add new members with image upload
  • View member details
  • Renew memberships
  • Delete members

Analytics

  • Total member count
  • Package distribution charts
  • Membership expiry analytics

Package Management

  • View all packages
  • Edit package details (name, price, duration)

Email & Reminders

  • Send emails to all members
  • Send renewal reminders to expiring members

Deployment

This project can be deployed on:

  • Vercel (recommended for Next.js)
  • Netlify
  • Any Node.js hosting platform

Make sure to set your environment variables in your hosting platform's dashboard.

License

Copyright © 2024 All rights reserved

About

A responsive site built with HTML, CSS, JS, Bootstrap, AJAX, PHP, and MySQL. Features include a landing page, login, dashboard for member management, analytics, reminders for expired memberships, mailer with a rich text editor, and dark mode.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors