A comprehensive fitness tracking application built with the MERN stack, designed to help users log workouts, track progress, and achieve their fitness goals.
- React 18 - Modern React with hooks and concurrent features
- Vite - Fast build tool and development server
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- React Query (TanStack Query) - Server state management
- React Hook Form - Performant forms with easy validation
- React Router v6 - Client-side routing
- Zustand - Lightweight state management
- Node.js - JavaScript runtime
- Express.js - Web application framework
- TypeScript - Type-safe server development
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- JWT - JSON Web Tokens for authentication
- bcryptjs - Password hashing
- express-validator - Input validation middleware
- helmet - Security middleware
- cors - Cross-origin resource sharing
- ESLint - Code linting
- Prettier - Code formatting
- Husky - Git hooks
- Jest - Testing framework
- Supertest - HTTP assertion library
- Docker - Containerization
- User Authentication - Secure registration and login
- Workout Logging - Create and track custom workouts
- Exercise Library - Comprehensive exercise database
- Progress Tracking - Visual charts and statistics
- Goal Setting - Set and monitor fitness goals
- Responsive Design - Mobile-first approach
- Real-time Updates - Live data synchronization
- Data Export - Export workout data
Fitness_Workout_Log/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── services/ # API service functions
│ │ ├── store/ # State management
│ │ ├── types/ # TypeScript type definitions
│ │ └── utils/ # Utility functions
│ ├── public/
│ └── package.json
├── server/ # Node.js backend
│ ├── src/
│ │ ├── controllers/ # Route controllers
│ │ ├── models/ # Mongoose models
│ │ ├── routes/ # API routes
│ │ ├── middleware/ # Custom middleware
│ │ ├── utils/ # Utility functions
│ │ └── types/ # TypeScript interfaces
│ └── package.json
├── docker-compose.yml # Docker configuration
└── README.md
- Node.js (v18 or higher)
- MongoDB (v6 or higher)
- npm or yarn
-
Clone the repository
git clone <repository-url> cd Fitness_Workout_Log
-
Install dependencies
# Install server dependencies cd server npm install # Install client dependencies cd ../client npm install
-
Environment Setup
# Server environment variables (.env) cd server cp .env.example .env
Configure the following variables:
NODE_ENV=development PORT=5000 MONGODB_URI=mongodb://localhost:27017/fitness_log JWT_SECRET=your_jwt_secret_key JWT_EXPIRE=7d
-
Start the application
# Start MongoDB (if running locally) mongod # Start server (from server directory) npm run dev # Start client (from client directory) npm run dev
# Build and run with Docker Compose
docker-compose up --buildPOST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/profile- Get user profile
GET /api/workouts- Get user workoutsPOST /api/workouts- Create new workoutPUT /api/workouts/:id- Update workoutDELETE /api/workouts/:id- Delete workout
GET /api/exercises- Get exercise libraryPOST /api/exercises- Add custom exerciseGET /api/exercises/:id- Get exercise details
# Run server tests
cd server
npm test
# Run client tests
cd client
npm test
# Run tests with coverage
npm run test:coverage# Build client for production
cd client
npm run build
# Start server in production mode
cd server
npm startNODE_ENV=production
PORT=5000
MONGODB_URI=mongodb+srv://username:[email protected]/fitness_log
JWT_SECRET=your_production_jwt_secret
JWT_EXPIRE=7d- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Exercise data from various fitness APIs
- UI inspiration from modern fitness applications
- Community contributions and feedback