Skip to content

Latest commit

Β 

History

229 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

License Version Last Commit CI GitHub issues GitHub stars

FitProgressr

Your complete fitness journey companion built with the MERN stack.

FitProgressr is a powerful, open-source fitness logging application that helps you track workouts, visualize progress, and stay motivated. Built with modern web technologies and designed for fitness enthusiasts of all levels.

✨ Features

  • πŸ“Š Exercise Logging: Track unlimited exercises with reps, sets, and weight
  • πŸ—“οΈ Activity Heatmap: Visual calendar showing your workout consistency
  • πŸ“ˆ Progress Analytics: Charts and statistics to monitor your fitness journey
  • πŸ’ͺ Workout Routines: Create and manage custom workout plans
  • πŸ’¬ Daily Motivation: Inspirational fitness quotes to keep you going
  • πŸ‘€ User Profiles: Personalized dashboard with your fitness data
  • πŸŒ™ Modern UI: Clean, responsive design with Material-UI components
  • πŸ” Secure Authentication: JWT-based user authentication and authorization
  • πŸ“± Mobile Responsive: Works seamlessly on desktop, tablet, and mobile
  • 🐳 Docker Ready: One-command setup with Docker Compose

πŸš€ Quick Start

Prerequisites

  • Node.js 18.0.0 or higher
  • npm 9.0.0 or higher
  • MongoDB Atlas account (or local MongoDB)
  • Docker & Docker Compose (optional, for containerized setup)

🐳 Quick Start with Docker (Recommended)

Get the entire application running in seconds:

# Clone the repository
git clone https://github.com/narainkarthikv/fitprogressr.git
cd FitProgressr

# Configure environment variables
cp .env.example .env
# Edit .env with your MongoDB URI and API keys

# Start all services
docker-compose up -d --build

# View logs
docker-compose logs -f

Access the application:

Deployments:

Useful Docker Commands:

# View running containers
docker-compose ps

# View logs for specific service
docker-compose logs -f backend
docker-compose logs -f frontend

# Stop services
docker-compose stop

# Remove services and volumes
docker-compose down -v

# Rebuild images
docker-compose build --no-cache

# Restart services
docker-compose restart

# Execute commands in container
docker-compose exec backend npm install
docker-compose exec frontend npm install

πŸ“¦ Local Installation

1️⃣ Backend Setup

# Navigate to backend directory
cd backend

# Install dependencies
npm install

# Create environment file
cp ../.env.example .env

Configure backend/.env:

NODE_ENV=development
PORT=5000
JWT_SECRET=your-secret-key-here
JWT_EXPIRATION=7d
ATLAS_URI=mongodb+srv://username:password@cluster.mongodb.net/fitprogressr

Start the server:

# Development mode with auto-reload
npm run dev

# Production mode
node server.js

2️⃣ Frontend Setup

# Navigate to frontend directory
cd frontend

# Install dependencies
npm install

# Create environment file
cp ../.env.example .env

Configure frontend/.env:

VITE_API_URL=http://localhost:5000/
VITE_APININJAS=your-api-ninjas-key-here

Start the development server:

npm run dev

The application will be available at http://localhost:5173

πŸ› οΈ Tech Stack

Frontend

  • React 18 - Modern UI library
  • Vite - Lightning-fast build tool
  • Redux Toolkit - State management
  • Material-UI - Component library
  • Emotion - CSS-in-JS styling
  • React Router - Client-side routing
  • Axios - HTTP client
  • React Calendar Heatmap - Activity visualization
  • Lottie - Animation library
  • Vitest - Testing framework

Backend

  • Node.js - JavaScript runtime
  • Express.js - Web framework
  • MongoDB - NoSQL database
  • Mongoose - ODM for MongoDB
  • JWT - Authentication
  • bcryptjs - Password hashing
  • CORS - Cross-origin resource sharing

DevOps

  • Docker - Containerization
  • Docker Compose - Multi-container orchestration
  • GitHub Actions - CI/CD pipelines
  • Netlify/Vercel - Frontend deployment

Tech Stack

πŸ“ Project Structure

Frontend Structure

frontend/
β”œβ”€β”€ public/
β”‚   └── _redirects              # Netlify routing configuration
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   └── lottie/            # Animation files
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ auth/              # Authentication components
β”‚   β”‚   β”‚   └── AuthModal.jsx
β”‚   β”‚   β”œβ”€β”€ common/            # Reusable UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ Button.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Card.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ InputField.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Modal.jsx
β”‚   β”‚   β”‚   └── Snackbar.jsx
β”‚   β”‚   β”œβ”€β”€ dashboard/         # Landing page components
β”‚   β”‚   β”‚   β”œβ”€β”€ Hero.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Features.jsx
β”‚   β”‚   β”‚   └── Footer.jsx
β”‚   β”‚   β”œβ”€β”€ Exercise/          # Exercise management
β”‚   β”‚   β”‚   β”œβ”€β”€ Exercise.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ExerciseForm.jsx
β”‚   β”‚   β”‚   └── ExerciseTable.jsx
β”‚   β”‚   β”œβ”€β”€ Heatmap/           # Activity heatmap
β”‚   β”‚   β”‚   β”œβ”€β”€ Heatmap.css
β”‚   β”‚   β”‚   β”œβ”€β”€ HeatmapControls.jsx
β”‚   β”‚   β”‚   └── ExerciseModal.jsx
β”‚   β”‚   β”œβ”€β”€ Navbar/            # Navigation
β”‚   β”‚   β”‚   β”œβ”€β”€ NavBar.jsx
β”‚   β”‚   β”‚   └── UserDropdown.jsx
β”‚   β”‚   └── profile/           # User profile
β”‚   β”‚       └── EditProfileModal.jsx
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx      # Main app page
β”‚   β”‚   └── Home.jsx           # Landing page
β”‚   β”œβ”€β”€ slices/                # Redux slices
β”‚   β”‚   β”œβ”€β”€ exercisesSlice.js
β”‚   β”‚   β”œβ”€β”€ heatMapSlice.js
β”‚   β”‚   └── userRoutineSlice.js
β”‚   β”œβ”€β”€ store/
β”‚   β”‚   └── store.js           # Redux store configuration
β”‚   β”œβ”€β”€ theme/
β”‚   β”‚   └── theme.js           # Material-UI theme
β”‚   β”œβ”€β”€ App.jsx                # Root component
β”‚   └── main.jsx               # Entry point
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ package.json
└── vite.config.js

Backend Structure

backend/
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ user.model.js          # User schema & methods
β”‚   └── exercise.model.js      # Exercise schema
β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ user.js                # User authentication & profile
β”‚   β”œβ”€β”€ exercises.js           # Exercise CRUD operations
β”‚   └── health.js              # Health check endpoint
β”œβ”€β”€ middleware/
β”‚   └── jwtAuth.js             # JWT verification middleware
β”œβ”€β”€ server.js                  # Express app & server config
β”œβ”€β”€ Dockerfile
└── package.json

πŸ”‘ Environment Variables

Backend Configuration

Create a .env file in the root directory:

# Server Configuration
NODE_ENV=development
PORT=5000

# JWT Authentication
JWT_SECRET=your-super-secret-jwt-key-change-this
JWT_EXPIRATION=7d

# Database
ATLAS_URI=mongodb+srv://username:password@cluster.mongodb.net/fitprogressr?retryWrites=true&w=majority

# Docker Configuration
BACKEND_PORT=5000
FRONTEND_PORT=5173

Frontend Configuration

Frontend environment variables (included in root .env):

# API Configuration
VITE_API_URL=http://localhost:5000/

# External APIs (Optional)
VITE_APININJAS=your-api-ninjas-key-for-quotes

Getting API Keys

  1. MongoDB Atlas (Required):

    • Sign up at mongodb.com/cloud/atlas
    • Create a cluster
    • Get connection string from "Connect" β†’ "Connect your application"
    • Replace <username>, <password>, and database name
  2. API Ninjas (Optional - for motivational quotes):

    • Sign up at api-ninjas.com
    • Get free API key from dashboard
    • Add to VITE_APININJAS in .env

πŸ§ͺ Development

Available Scripts

Backend

cd backend

# Development mode with hot reload
npm run dev

# Production mode
node server.js

# Run tests (to be implemented)
npm test

Frontend

cd frontend

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

# Run linter
npm run lint

# Fix linting issues
npm run lint -- --fix

# Run tests
npm test

Code Style Guidelines

  • Formatting: ESLint + Prettier (2-space indentation)
  • Max Line Length: 100 characters
  • React: Functional components with hooks
  • State Management: Redux Toolkit
  • Styling: Material-UI with Emotion
  • API Calls: Axios with async/await
  • Error Handling: Try-catch blocks with proper error messages
  • Commits: Follow Conventional Commits
    • feat: add exercise deletion feature
    • fix: resolve JWT expiration bug
    • docs: update installation guide
    • refactor: optimize heatmap rendering

Formatting (Prettier)

Run these from the repository root so Prettier checks both frontend and backend:

# Check formatting
npx prettier --check .

# Write formatting fixes
npx prettier --write .

API Endpoints

Authentication

POST   /api/user/register       # Register new user
POST   /api/user/login          # Login user
GET    /api/user/profile        # Get user profile (protected)
PUT    /api/user/profile        # Update user profile (protected)

Exercises

GET    /api/exercises           # Get all user exercises (protected)
POST   /api/exercises           # Create new exercise (protected)
GET    /api/exercises/:id       # Get exercise by ID (protected)
PUT    /api/exercises/:id       # Update exercise (protected)
DELETE /api/exercises/:id       # Delete exercise (protected)

Health Check

GET    /api/health              # Check API status

🀝 Contributing

We welcome contributions from the community! Here's how to get started:

Ways to Contribute

  • πŸ› Fix bugs and improve stability
  • ✨ Add features that enhance the fitness tracking experience
  • πŸ“š Improve documentation and tutorials
  • 🎨 Enhance UI/UX and accessibility
  • ⚑ Optimize performance and code quality
  • πŸ§ͺ Add tests to increase coverage
  • 🌍 Add translations for internationalization

Contribution Workflow

  1. Fork the repository and clone it locally
  2. Create a branch for your feature:
    git checkout -b feature/amazing-feature
  3. Make your changes and commit with descriptive messages:
    git commit -m "feat: add workout streak counter"
  4. Push to your fork:
    git push origin feature/amazing-feature
  5. Open a Pull Request to the develop branch
  6. Respond to feedback from maintainers

Branch Naming Convention

  • Features: feature/description
  • Bug fixes: fix/description
  • Documentation: docs/description
  • Refactoring: refactor/description
  • Chores: chore/description

Pull Request Guidelines

  • Keep PRs focused on a single feature/fix
  • Link related issues in the PR description
  • Add screenshots for UI changes
  • Ensure all tests pass
  • Update documentation if needed
  • Request review from maintainers

Good First Issues: Look for issues labeled good first issue to get started!

For detailed guidelines, see CONTRIBUTING.md

πŸ› Troubleshooting

Common Issues

Docker Issues

Containers won't start:

# Check Docker daemon is running
docker ps

# View detailed logs
docker-compose logs -f

# Remove old containers and rebuild
docker-compose down -v
docker-compose up -d --build

Port conflicts:

# Check what's using the ports
lsof -i :5000   # Backend
lsof -i :5173   # Frontend

# Or kill processes on those ports
kill -9 $(lsof -ti:5000)
kill -9 $(lsof -ti:5173)

Hot reload not working:

# Rebuild without cache
docker-compose up -d --build --no-cache

# Check file permissions
ls -la backend/
ls -la frontend/

Local Development Issues

MongoDB connection failed:

  • Verify ATLAS_URI is correct in .env
  • Check MongoDB Atlas IP whitelist (allow 0.0.0.0/0 for development)
  • Ensure database user has read/write permissions

Frontend can't connect to backend:

  • Verify VITE_API_URL in frontend .env
  • Check backend is running on correct port
  • Verify CORS is enabled in server.js

Dependencies issues:

# Clear npm cache and reinstall
npm cache clean --force
rm -rf node_modules package-lock.json
npm install

Build errors:

git clone https://github.com/narainkarthikv/FitProgressr.git
cd FitProgressr
cp .env.example .env
docker-compose up -d --build

# Clear Vite cache
rm -rf .vite node_modules/.vite
npm run dev

JWT authentication fails:

  • Ensure JWT_SECRET is set in backend .env
  • Check token is included in request headers
  • Verify token hasn't expired

Getting Help

πŸ“– Documentation

πŸ‘₯ Contributors

Thanks to everyone who has helped make FitProgressr awesome! πŸ’ͺ

Contributors

See the Contributors Page for the full list.

πŸ“œ License

This project is licensed under the MIT License - see MIT-LICENSE.txt for details.

Summary: You are free to use, modify, and distribute this software for any purpose, including commercial use.

πŸ’¬ Community & Support

🌟 Show Your Support

If FitProgressr helps you on your fitness journey:

  • ⭐ Star the repository
  • πŸ› Report issues you encounter
  • πŸ’‘ Share your feature ideas
  • 🀝 Contribute code or documentation
  • πŸ“’ Tell others about the project
  • πŸ’¬ Join discussions and help others

πŸ”— Links

Want to help build these features? Check out our Contributing Guide!

πŸ’» Development Setup Tips

Recommended VS Code Extensions

  • ESLint - Code linting
  • Prettier - Code formatting
  • ES7+ React/Redux - React snippets
  • Docker - Docker support
  • MongoDB for VS Code - Database management
  • GitLens - Git integration
  • Thunder Client - API testing

Recommended Tools

  • MongoDB Compass - GUI for MongoDB
  • Postman or Insomnia - API testing
  • React Developer Tools - Browser extension
  • Redux DevTools - Browser extension

πŸ™ Acknowledgments

  • Thanks to all our contributors who have helped build FitProgressr
  • Built with amazing open-source technologies
  • Inspired by the fitness and developer communities

Built with ❀️ by the Wisdom Fox community

Let's build the best fitness tracker together! πŸš€

About

πŸš€ Open-source MERN fitness tracker built for learning and real-world full-stack practice. Beginner-friendly issues and contributions welcome.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages