A full-stack web application for gym and fitness management, built with ASP.NET Core and React. GymLab provides a comprehensive platform for tracking workouts, managing gym memberships, purchasing fitness products, and connecting with other fitness enthusiasts.
- User authentication and authorization with ASP.NET Identity
- User profiles with personal information (height, weight, date of birth)
- User-to-user following system
- Personal gym streak tracking
- Gym listing and management
- Gym tags and categorization (Family, Chain, Athletic, Crossfit)
- User check-in system to track gym visits
- Gym operating hours display
- Create and track personal workouts
- Workout logging with photos
- Time spent in gym tracking
- Share workouts with other users
- Workout descriptions and naming
- Achievement system for fitness goals
- Track achievements like "Bench press one plate", "Squat two plates", "Do pull-ups"
- Upload photos of achievement completion
- User achievement history
- Predefined coaching plans for different fitness goals
- Skill level requirements (Beginner, Intermediate, Advanced)
- Goal type categorization (Build Muscle, Lose Fat, Improve Endurance)
- Users can subscribe to coaching plans
- Product catalog (supplements, equipment, apparel)
- Product photos
- Product ratings and reviews
- Shopping cart and order management
- Product filtering by gym
- Event creation and management
- Event descriptions and dates
- Events linked to specific gyms
- Framework: ASP.NET Core 6.0
- Database: SQL Server with Entity Framework Core 6.0
- Authentication: ASP.NET Identity with Cookie Authentication
- API Documentation: Swagger/OpenAPI
- Key Libraries:
- IdentityModel 6.0.0
- Entity Framework Core 6.0.9
- Swashbuckle.AspNetCore 6.4.0
- Framework: React 18.2.0 with TypeScript 4.9.4
- UI Library: Mantine 5.9.2 (with hooks, forms, dates, modals, notifications)
- Routing: React Router DOM 6.4.5
- HTTP Client: Axios 1.2.3
- Icons: Font Awesome 6.2.1
- Date Handling: Day.js 1.11.7
- Styling: Emotion React 11.10.5
- .NET 6.0 SDK
- Node.js (with npm/yarn)
- SQL Server (LocalDB or Express)
- Windows Terminal (recommended for development)
git clone <repository-url>
cd GymLabUpdate the connection string in Web/LearningStarter/appsettings.json:
{
"ConnectionStrings": {
"DefaultConnection": "Server=localhost;Database=Project-Starter-285-GroupNumber;Trusted_Connection=True"
}
}cd Web/LearningStarter
dotnet restorecd Web/LearningStarter/learning-starter-web
yarn install
# or
npm installUse the provided batch script to start both backend and frontend:
runProject.cmdNote: Edit runProject.cmd to update the paths to match your project location.
Backend (Terminal 1):
cd Web/LearningStarter
dotnet runFrontend (Terminal 2):
cd Web/LearningStarter/learning-starter-web
yarn startwt -d <your-path>\Web\LearningStarter dotnet run
wt -d <your-path>\Web\LearningStarter\learning-starter-web yarn start- Frontend: http://localhost:3001
- Backend API: https://localhost:5001 or http://localhost:5000
- Swagger Documentation: https://localhost:5001/swagger
The application uses Entity Framework Code-First approach. On startup, the database will be:
- Dropped (if exists)
- Recreated with the latest schema
- Seeded with sample data
EnsureDeleted() in Startup.cs (line 112) will drop the database on each run. Remove this in production!
The application seeds the following test data:
- Users: Admin, Stephen, Ethan, Jackson, Geoffrey
- Gyms: Planet Fitness, Crossfit Hammond, Downtown Fitness, North Cypress Fitness
- Products: T-Shirts, Pre-workout, Protein Powder, Gym Equipment
- Achievements: Various strength and fitness goals
- Coaching Plans: Different fitness programs
- Workouts: Sample workout sessions
- Gym Events: Sample events at various gyms
Username: admin
Password: Password
Additional test users:
- Username:
W| Password:Password123(Stephen) - Username:
BigMan20| Password:PasswordHash(Ethan) - Username:
JackedDude65| Password:ThisPassword123(Jackson) - Username:
THEMathGuy| Password:Passwords(Geoffrey)
GymLab/
βββ Web/
β βββ LearningStarter/ # Backend (ASP.NET Core)
β β βββ Controllers/ # API Controllers
β β βββ Entities/ # Database Models
β β βββ Data/ # DbContext
β β βββ Services/ # Business Logic
β β βββ Common/ # Shared Utilities
β β βββ learning-starter-web/ # Frontend (React)
β β β βββ src/
β β β β βββ components/ # React Components
β β β β βββ pages/ # Page Components
β β β β βββ routes/ # Route Configuration
β β β β βββ authentication/ # Auth Logic
β β β β βββ config/ # App Configuration
β β β βββ public/ # Static Assets
β β βββ Program.cs # Application Entry Point
β β βββ Startup.cs # App Configuration & Seeding
β β βββ appsettings.json # Configuration Settings
β βββ LearningStarter.sln # Solution File
βββ runProject.cmd # Quick Start Script
The application provides RESTful APIs for:
/api/users- User management/api/gyms- Gym CRUD operations/api/gym-events- Gym events/api/workouts- Workout tracking/api/products- Product catalog/api/coaching-plans- Coaching programs/api/achievements- Achievement system/api/user-check-ins- Check-in tracking/api/authentication- Login/Logout
/user- User profile page/gyms- Gym listing and management/gym-events- Event listing/products- Product catalog/workouts- Workout management/coaching-plans- Coaching plan listing/tags- Tag management
The application uses cookie-based authentication with ASP.NET Identity. Users must be authenticated to access most features. Password requirements are configured in Startup.cs:
- Minimum length: 8 characters
- No uppercase requirement
- No lowercase requirement
- No digit requirement
- No special character requirement
Note: These are lenient settings for development. Strengthen them for production.
CORS is configured to allow all origins, methods, and headers (see Startup.cs line 124). Restrict this in production environments.
To create a new migration:
cd Web/LearningStarter
dotnet ef migrations add MigrationNameTo update the database:
dotnet ef database updateThe React app runs on port 3001 and proxies API requests to the backend on port 5001 (configured in Startup.cs).
Frontend:
cd Web/LearningStarter/learning-starter-web
yarn buildThe production build will be placed in the build folder and served by the ASP.NET Core application.
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the terms specified in the LICENSE file.
- Database is dropped on each application start (remove
EnsureDeleted()for persistence) - CORS is wide open for all origins (restrict in production)
- Password requirements are minimal (strengthen for production)
For issues, questions, or contributions, please open an issue in the repository.
Built with β€οΈ by the GymLab Team