A comprehensive gym management system built with React, Material-UI, and Firebase.
- Member Management
- Membership Plan Management
- QR Code Generator
- Attendance Reports
- Notifications
- Settings
- Dashboard
- QR Scanner
- Profile Management
- Attendance History
- Notifications
- Node.js (v14 or higher)
- npm or yarn
- Firebase account
-
Clone the repository
git clone <repository-url> cd Gym -
Install dependencies
npm install -
Configure Firebase
- Create a new Firebase project at Firebase Console
- Enable Authentication (Email/Password)
- Enable Firestore Database
- Enable Storage
- Get your Firebase configuration (Project settings > General > Your apps > Firebase SDK snippet > Config)
- Create a
.envfile in the root directory with the following variables:REACT_APP_FIREBASE_API_KEY=your_api_key REACT_APP_FIREBASE_AUTH_DOMAIN=your_auth_domain REACT_APP_FIREBASE_PROJECT_ID=your_project_id REACT_APP_FIREBASE_STORAGE_BUCKET=your_storage_bucket REACT_APP_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id REACT_APP_FIREBASE_APP_ID=your_app_id REACT_APP_FIREBASE_MEASUREMENT_ID=your_measurement_id - Replace the placeholder values with your Firebase configuration
-
Set up Firestore indexes
- Go to Firebase Console > Firestore Database > Indexes
- Add the following composite indexes:
- Collection:
notifications- Fields:
userId(Ascending),timestamp(Descending)
- Fields:
- Collection:
attendance- Fields:
memberId(Ascending),timestamp(Descending)
- Fields:
- Collection:
-
Set up Firestore Security Rules
- Go to Firebase Console > Firestore Database > Rules
- Copy and paste the security rules from
firebase_setup.md
-
Set up Storage Security Rules
- Go to Firebase Console > Storage > Rules
- Copy and paste the storage rules from
firebase_setup.md
-
Initialize Firebase with default data (optional)
node scripts/initializeFirebase.js -
Start the development server
npm start
- Register a new user through the application
- Go to Firebase Console > Firestore Database > Data
- Find the user document in the
userscollection - Edit the document and change the
rolefield toadmin - Now you can log in as an admin
/src
/components # Reusable components
/layouts # Layout components (AdminLayout, MemberLayout)
/contexts # React contexts (AuthContext)
/pages # Page components
/admin # Admin panel pages
/member # Member panel pages
/firebase.js # Firebase configuration
/App.js # Main application component with routing
/index.js # Entry point
users: User authentication datamembers: Member profile informationattendance: Check-in recordsnotifications: System notificationssettings: Application configurationmembershipPlans: Available membership plans
Refer to firebase_setup.md for detailed information about the Firebase setup.
- Create new components in the appropriate directories
- Update the routing in
App.js - Add navigation links in the layout components
-
Build the application
npm run build -
Deploy to Firebase Hosting (optional)
npm install -g firebase-tools firebase login firebase init firebase deploy