A modern gym management system built with Next.js, TypeScript, and Tailwind CSS, using Supabase as the online database.
- 🏠 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
- Framework: Next.js 14
- Language: TypeScript
- Styling: Tailwind CSS
- Database: Supabase (PostgreSQL)
- Charts: Recharts
- Authentication: JWT
- Node.js 18+ installed
- A Supabase account (free tier available)
-
Clone the repository
git clone <repository-url> cd Horizon-Gym-Management-System
-
Install dependencies
npm install
-
Set up Supabase
- Create a new project at supabase.com
- Run the SQL schema from
supabase/schema.sqlin your Supabase SQL editor - Get your project URL and API keys from Settings > API
-
Configure environment variables
cp .env.local.example .env.local
Then edit
.env.localwith 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 -
Set up the database
- Go to your Supabase project dashboard
- Navigate to SQL Editor
- Run the SQL from
supabase/schema.sqlto create tables
-
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! - Username:
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
The database schema is provided in supabase/schema.sql. This includes:
member_details- Stores member informationpackage_details- Stores membership packagesadmin_users- Stores admin credentials
Run this SQL in your Supabase SQL editor to create the tables.
├── 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.
- Username:
admin - Password:
admin
- Add new members with image upload
- View member details
- Renew memberships
- Delete members
- Total member count
- Package distribution charts
- Membership expiry analytics
- View all packages
- Edit package details (name, price, duration)
- Send emails to all members
- Send renewal reminders to expiring members
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.
Copyright © 2024 All rights reserved