{"id":29261387,"url":"https://github.com/riyatorgal/gymsync","last_synced_at":"2026-02-04T05:07:01.161Z","repository":{"id":301839968,"uuid":"1010133627","full_name":"RiyaTorgal/GymSync","owner":"RiyaTorgal","description":"A MERN-based fitness management app that enables gym administrators to track member attendance, monitor progress, generate reports, and manage operations with support for both local and cloud databases.","archived":false,"fork":false,"pushed_at":"2025-10-26T05:04:44.000Z","size":2171,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-26T07:05:18.877Z","etag":null,"topics":["app","express-js","fullstack-development","gymsync","mern","mongodb-atlas","nodejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RiyaTorgal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-28T12:20:21.000Z","updated_at":"2025-10-26T05:04:47.000Z","dependencies_parsed_at":"2025-09-09T05:27:43.156Z","dependency_job_id":"377bc823-08c2-4a63-8ca2-86a7d48e5aa6","html_url":"https://github.com/RiyaTorgal/GymSync","commit_stats":null,"previous_names":["riyatorgal/gymsync"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RiyaTorgal/GymSync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RiyaTorgal%2FGymSync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RiyaTorgal%2FGymSync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RiyaTorgal%2FGymSync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RiyaTorgal%2FGymSync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RiyaTorgal","download_url":"https://codeload.github.com/RiyaTorgal/GymSync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RiyaTorgal%2FGymSync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29070229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T03:31:03.593Z","status":"ssl_error","status_checked_at":"2026-02-04T03:29:50.742Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["app","express-js","fullstack-development","gymsync","mern","mongodb-atlas","nodejs"],"created_at":"2025-07-04T08:40:16.811Z","updated_at":"2026-02-04T05:07:01.155Z","avatar_url":"https://github.com/RiyaTorgal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GymSync - Fitness Management System\n\n[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)\n[![Node.js](https://img.shields.io/badge/Node.js-v18+-brightgreen)](https://nodejs.org/)\n[![MongoDB](https://img.shields.io/badge/MongoDB-v6+-green)](https://www.mongodb.com/)\n[![React Native](https://img.shields.io/badge/React_Native-v0.72+-blue)](https://reactnative.dev/)\n\nA comprehensive MERN-based fitness management application that enables gym administrators to track member attendance, manage workout schedules, monitor progress, and streamline gym operations with support for both local and cloud databases.\n\n## Features\n\n### User Management\n- **Secure Authentication** - JWT-based authentication with bcrypt password hashing\n- **User Registration \u0026 Login** - Complete user account management\n- **Profile Management** - Update membership types, personal info\n- **Password Management** - Change password, account deletion\n- **Session Management** - Logout, logout from all devices\n\n### Attendance System\n- **Daily Attendance Tracking** - Mark attendance for current day\n- **Historical Records** - View attendance by date range or day name\n- **Duplicate Prevention** - Prevents multiple check-ins per day\n- **Attendance Count** - Auto-increment attendance counter\n\n### Workout Management\n- **200+ Exercises Database** - Comprehensive exercise library\n- **Weekly Schedule** - Pre-configured 6-day workout plan\n  - Monday: Legs Day\n  - Tuesday: Upper Body + Abs\n  - Wednesday: Inner \u0026 Outer Thighs + Back\n  - Thursday: Core + Cardio\n  - Friday: Legs Day\n  - Saturday: Upper Body + Abs\n  - Sunday: Rest Day\n- **Custom Workout Plans** - Generate personalized workouts based on:\n  - Workout type (Strength, Cardio, Flexibility, Balance)\n  - Difficulty level (Beginner, Intermediate, Advanced)\n  - Target muscle groups\n  - Available equipment\n  - Desired duration\n- **Exercise Filtering** - Search by type, muscle, equipment, difficulty\n- **Calorie Estimation** - Automatic calorie burn calculation\n- **Duration Tracking** - Estimated workout duration\n\n### Admin Features\n- **Member Management** - View all registered users\n- **Dashboard** - Overview of gym statistics\n- **Reports** - Attendance and progress tracking\n\n## Tech Stack\n\n### Frontend\n- **React Native** - Cross-platform mobile development\n- **React Hooks** - State management\n- **Expo** - Development framework\n- **Axios** - HTTP client\n\n### Backend\n- **Node.js** - Runtime environment\n- **Express.js** - Web framework\n- **Mongoose** - MongoDB ODM\n- **JWT** - Authentication\n- **bcrypt** - Password hashing\n\n### Database\n- **MongoDB** - NoSQL database\n- **MongoDB Atlas** - Cloud database (optional)\n- **MongoDB Compass** - Database GUI\n\n### Development Tools\n- **nodemon** - Auto-restart server\n- **dotenv** - Environment variables\n- **ESLint** - Code linting\n- **Postman** - API testing\n\n## Architecture\n\n### System Architecture\n\n```\n                                              ┌─────────────────────┐\n                                              │   CLIENT LAYER      │\n                                              │  • React Native     │\n                                              │  • HTTP REST API    │\n                                              └──────────┬──────────┘\n                                                         │\n                                                         ▼\n                                              ┌─────────────────────┐\n                                              │   API GATEWAY       │\n                                              │  • Express Server   │\n                                              │  • Middleware       │\n                                              │  • CORS \u0026 Auth      │\n                                              └──────────┬──────────┘\n                                                         │\n                                                         ▼\n                                              ┌─────────────────────┐\n                                              │ APPLICATION LAYER   │\n                                              │  • User Routes      │\n                                              │  • Exercise Routes  │\n                                              │  • JWT Auth         │\n                                              │  • bcrypt Hashing   │\n                                              └──────────┬──────────┘\n                                                         │\n                                                         ▼\n                                              ┌─────────────────────┐\n                                              │   DATA LAYER        │\n                                              │  • Mongoose Models  │\n                                              │  • User Model       │\n                                              │  • Exercise Model   │\n                                              └──────────┬──────────┘\n                                                         │\n                                                         ▼\n                                              ┌─────────────────────┐\n                                              │   DATABASE          │\n                                              │  • User Collection  │\n                                              │  • Exercise Coll.   │\n                                              │  • Embedded Attend. │\n                                              └─────────────────────┘\n```\n\n## Project Structure\n\n```\nGYMSYNC/\n├── frontend/                     # React Native mobile app\n│   ├── app/                      # Main application routes\n│   ├── assets/                   # Images, fonts, icons\n│   ├── components/               # Reusable UI components\n│   ├── constants/                # API endpoints, config\n│   ├── hooks/                    # Custom React hooks\n│   ├── scripts/                  # Utility scripts\n│   ├── package.json\n│   └── tsconfig.json\n│\n├── backend/                      # Node.js/Express server\n│   ├── models/                   # Mongoose schemas\n│   │   ├── user.js               # User model\n│   │   └── excercise.js          # Exercise model\n│   ├── routes/                   # API routes\n│   │   ├── userRoutes.js         # User endpoints\n│   │   └── excerciseRoutes.js    # Exercise endpoints\n│   ├── test/                     # Test scripts\n│   │   ├── userTest.js\n│   │   └── attendanceTest.js\n│   ├── index.js                  # Server entry point\n│   └── package.json\n│\n├── config/                       # Configuration files\n│   ├── .env                      # Environment variables\n│   ├── .env.example              # Env template\n│   └── file_structure.txt        # Detailed structure\n│\n├── ui_structure/                 # UI/UX designs\n│   ├── adminUI/\n│   ├── clientUI/\n│   └── trainerUI/\n│\n├── .gitignore\n├── README.md\n└── gym_sync_full_app_architecture_mern_stack.md\n```\n\n## Installation\n\n### Prerequisites\n\n- Node.js (v18 or higher)\n- MongoDB (v6 or higher)\n- npm or yarn\n- Git\n\n### Clone Repository\n\n```bash\ngit clone https://github.com/RiyaTorgal/GymSync.git\ncd GymSync\n```\n\n### Backend Setup\n\n```bash\ncd backend\nnpm install\n```\n\n### Frontend Setup\n\n```bash\ncd ../frontend\nnpm install\n```\n\n## Configuration\n\n### Environment Variables\n\nCreate a `.env` file in the `config/` directory:\n\n```env\n# Server Configuration\nPORT=5000\nNODE_ENV=development\n\n# MongoDB Configuration\nMONGO_URI=mongodb://127.0.0.1:27017/gym_sync\n\n# JWT Configuration\nJWT_SECRET=gym-sync-secret-key-2024\nJWT_EXPIRE=7d\n\n# Frontend URL (for CORS)\nFRONTEND_URL=http://localhost:19006\n```\n\n### MongoDB Setup\n\n**Option 1: Local MongoDB**\n```bash\n# Start MongoDB service\nmongod --dbpath /path/to/data/directory\n```\n\n**Option 2: MongoDB Atlas**\n1. Create account at [MongoDB Atlas](https://www.mongodb.com/cloud/atlas)\n2. Create a cluster\n3. Get connection string\n4. Update `MONGO_URI` in `.env`\n\n## Usage\n\n### Start Backend Server\n\n```bash\ncd backend\nnpm run dev\n```\n\nServer runs on: `http://localhost:5000`\n\n### Start Frontend App\n\n```bash\ncd frontend\nnpm start\n```\n\nExpo DevTools opens at: `http://localhost:19006`\n\n### Access Points\n\n- **API Base URL**: `http://localhost:5000/api`\n- **Health Check**: `http://localhost:5000/health`\n- **API Docs**: `http://localhost:5000/`\n\n## API Documentation\n\n### Authentication Endpoints\n\n#### Register User\n```http\nPOST /api/users/register\nContent-Type: application/json\n\n{\n  \"name\": \"John Doe\",\n  \"email\": \"john@example.com\",\n  \"password\": \"password123\",\n  \"membershipType\": \"Monthly\"\n}\n```\n\n**Response:**\n```json\n{\n  \"success\": true,\n  \"message\": \"User registered successfully\",\n  \"user\": { /* user object */ },\n  \"token\": \"jwt_token_here\"\n}\n```\n\n#### Login User\n```http\nPOST /api/users/login\nContent-Type: application/json\n\n{\n  \"email\": \"john@example.com\",\n  \"password\": \"password123\"\n}\n```\n\n#### Get User Profile (Protected)\n```http\nGET /api/users/profile\nAuthorization: Bearer \u003ctoken\u003e\n```\n\n#### Logout\n```http\nPOST /api/users/logout\nAuthorization: Bearer \u003ctoken\u003e\n```\n\n### Attendance Endpoints\n\n#### Mark Today's Attendance\n```http\nPOST /api/users/attendance/today\nAuthorization: Bearer \u003ctoken\u003e\n```\n\n#### Mark Attendance for Specific Date\n```http\nPOST /api/users/attendance\nAuthorization: Bearer \u003ctoken\u003e\nContent-Type: application/json\n\n{\n  \"date\": \"2024-10-13\"\n}\n```\n\n#### Get Attendance Records\n```http\nGET /api/users/attendance?startDate=2024-10-01\u0026endDate=2024-10-31\nAuthorization: Bearer \u003ctoken\u003e\n```\n\n### Exercise Endpoints\n\n#### Get All Exercises\n```http\nGET /api/exercises/all\n```\n\n#### Get Weekly Schedule\n```http\nGET /api/exercises/weekly-schedule\n```\n\n**Response:**\n```json\n{\n  \"success\": true,\n  \"schedule\": {\n    \"Monday\": {\n      \"name\": \"Legs Day\",\n      \"type\": \"Strength\",\n      \"exercises\": [ /* exercise list */ ],\n      \"totalCalories\": 350,\n      \"estimatedDuration\": \"45 min\",\n      \"exerciseCount\": 8\n    },\n    // ... other days\n  }\n}\n```\n\n#### Get Exercises by Type\n```http\nGET /api/exercises/type/Strength\n```\n\n#### Get Exercises by Muscle\n```http\nGET /api/exercises/muscle/Chest\n```\n\n#### Get Exercises by Difficulty\n```http\nGET /api/exercises/difficulty/Beginner\n```\n\n#### Create Custom Workout Plan\n```http\nPOST /api/exercises/workout-plan\nContent-Type: application/json\n\n{\n  \"workoutType\": \"Strength\",\n  \"difficulty\": \"Intermediate\",\n  \"duration\": 30,\n  \"targetMuscles\": [\"Chest\", \"Triceps\"],\n  \"equipment\": [\"Dumbbell\", \"Barbell\"],\n  \"exerciseCount\": 6\n}\n```\n\n### Profile Management Endpoints\n\n#### Update Profile\n```http\nPUT /api/users/profile\nAuthorization: Bearer \u003ctoken\u003e\nContent-Type: application/json\n\n{\n  \"name\": \"John Updated\",\n  \"membershipType\": \"Annual\"\n}\n```\n\n#### Change Password\n```http\nPUT /api/users/change-password\nAuthorization: Bearer \u003ctoken\u003e\nContent-Type: application/json\n\n{\n  \"currentPassword\": \"oldpass123\",\n  \"newPassword\": \"newpass123\"\n}\n```\n\n#### Delete Account\n```http\nDELETE /api/users/account\nAuthorization: Bearer \u003ctoken\u003e\nContent-Type: application/json\n\n{\n  \"password\": \"password123\"\n}\n```\n\n## Database Schema\n\n### User Collection\n\n```javascript\n{\n  _id: ObjectId,\n  name: String,\n  email: String (unique),\n  password: String (hashed),\n  membershipType: Enum[\"Monthly\", \"Quarterly\", \"Annual\"],\n  joinDate: Date,\n  attendanceCount: Number,\n  attendance: [\n    {\n      date: Date,\n      dayName: String,\n      classType: String\n    }\n  ],\n  createdAt: Date,\n  updatedAt: Date\n}\n```\n\n### Exercise Collection\n\n```javascript\n{\n  _id: ObjectId,\n  ID: Number (unique),\n  Name: String,\n  Type: Enum[\"Strength\", \"Cardio\", \"Plyometric\", \"HIIT\", ...],\n  Section: Enum[\"Upper Body\", \"Lower Body\", \"Core\", ...],\n  Muscle: String,\n  Equipment: String,\n  Difficulty: Enum[\"Beginner\", \"Intermediate\", \"Advanced\"],\n  Instructions: String,\n  Sets: Number,\n  Reps: String,\n  RestTime: String,\n  CaloriesPerSet: Number,\n  TargetMuscleGroups: [String],\n  IsActive: Boolean,\n  createdAt: Date,\n  updatedAt: Date\n}\n```\n\n## Testing\n\n### Run Backend Tests\n\n```bash\ncd backend\nnode test/userTest.js\nnode test/attendanceTest.js\n```\n\n### Test Coverage\n- User registration and login\n- Attendance marking and retrieval\n- Exercise queries\n- JWT authentication\n- Password hashing\n\n### Manual Testing with Postman\n\nImport the API collection and test all endpoints with proper authentication headers.\n\n## Diagrams\n\n### User Flow Diagram\nShows the complete user journey through the application:\n\n![User Flow Diagram](https://github.com/RiyaTorgal/GymSync/blob/main/img/diagrams/user%20flow%20diag.png)\n\n### Sequence Diagram\n\nShows the flow of authentication, attendance marking, and schedule retrieval:\n\n![Sequence Diagram](https://github.com/RiyaTorgal/GymSync/blob/main/img/diagrams/activity%20diag.png)\n\n### Entity Relationship Diagram\n\nShows database structure and relationships:\n\n![ERD](https://github.com/RiyaTorgal/GymSync/blob/main/img/diagrams/entity%20relationship%20diag.png)\n\n### Cloud Architecture Diagram\n\nShows system components and data flow:\n\n![Architecture](https://github.com/RiyaTorgal/GymSync/blob/main/img/diagrams/architechture%20diag.png)\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- [React Native Documentation](https://reactnative.dev/)\n- [Express.js Documentation](https://expressjs.com/)\n- [MongoDB Documentation](https://docs.mongodb.com/)\n- [Mongoose Documentation](https://mongoosejs.com/)\n\n## Project Status\n\n**Current Version:** 1.0.0\n\n**Status:** Active Development\n\n**Last Updated:** October 2024\n\n---\n\n**Made with ❤️ for fitness enthusiasts**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friyatorgal%2Fgymsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friyatorgal%2Fgymsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friyatorgal%2Fgymsync/lists"}