Project URL: https://roadmap.sh/projects/fitness-tracker
A production-ready RESTful API for tracking workouts, exercises, and fitness progress — built with FastAPI, MySQL, and JWT authentication.
🔗 Live API: https://workout-tracker-h6zn.onrender.com
📖 Swagger Docs: https://workout-tracker-h6zn.onrender.com/docs
📘 ReDoc: https://workout-tracker-h6zn.onrender.com/redoc
| Layer | Technology |
|---|---|
| Framework | FastAPI (Python) |
| Database | MySQL (Aiven Cloud) |
| ORM | SQLAlchemy |
| Auth | JWT (python-jose) |
| Password Hashing | bcrypt (passlib) |
| Deployment | Render |
| Testing | pytest + httpx |
| Docs | OpenAPI / Swagger |
- 🔐 JWT Authentication — signup, login, protected routes
- 🏋️ Workout Management — create, read, update, delete workouts
- 📅 Scheduling — schedule workouts for specific dates and times
- 📊 Progress Reports — weekly summaries, volume tracking, exercise progress
- 🌱 Exercise Library — 33 seeded exercises across strength, cardio, and flexibility
- ✅ Unit Tests — 17 tests covering auth, workouts, and reports
- 📖 Auto Docs — Swagger UI and ReDoc out of the box
workout-tracker/
├── app/
│ ├── main.py # FastAPI app entry point
│ ├── database.py # DB connection & session
│ ├── models/ # SQLAlchemy models
│ ├── schemas/ # Pydantic schemas
│ ├── routers/ # API route handlers
│ │ ├── init.py # Auth routes
│ │ ├── workouts.py # Workout CRUD routes
│ │ └── reports.py # Report routes
│ ├── auth/ # JWT & password utils
│ └── utils/
├── tests/
│ ├── test_auth.py
│ └── test_workouts.py
├── seeder.py # Exercise data seeder
├── requirements.txt
├── render.yaml
└── .env # (not committed)
users
├── id, username, email, hashed_password, created_at exercises
├── id, name, description, category, muscle_group workouts
├── id, user_id (FK), title, notes, scheduled_at, completed_at, created_at workout_exercises
├── id, workout_id (FK), exercise_id (FK), sets, reps, weight_kg
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/signup |
Create a new account |
| POST | /auth/login |
Login and get JWT token |
| GET | /auth/me |
Get current user profile |
| Method | Endpoint | Description |
|---|---|---|
| POST | /workouts/ |
Create a new workout |
| GET | /workouts/ |
List all your workouts |
| GET | /workouts/{id} |
Get a single workout |
| PUT | /workouts/{id} |
Update a workout |
| DELETE | /workouts/{id} |
Delete a workout |
| GET | /workouts/status/pending |
List pending workouts |
| Method | Endpoint | Description |
|---|---|---|
| GET | /reports/summary |
Overall workout stats |
| GET | /reports/weekly |
Last 7 days activity |
| GET | /reports/exercises/most-used |
Top 5 exercises |
| GET | /reports/progress/{exercise_id} |
Weight progress for an exercise |
1. Clone the repo:
git clone https://github.com/Shreyaaaaaak/workout-tracker.git
cd workout-tracker2. Create virtual environment:
python -m venv venv
venv\Scripts\activate # Windows3. Install dependencies:
pip install -r requirements.txt4. Create .env file:
DATABASE_URL=mysql+pymysql://user:password@host:port/dbname
SECRET_KEY=your-secret-key
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=1440
SSL_CA=ca.pem5. Run seeder:
python seeder.py6. Start server:
uvicorn app.main:app --reloadVisit http://127.0.0.1:8000/docs 🚀
pytest tests/ -vExpected: 17 tests passing ✅
Signup:
curl -X POST https://workout-tracker-h6zn.onrender.com/auth/signup \
-H "Content-Type: application/json" \
-d '{"username": "shreya", "email": "shreya@example.com", "password": "Test1234!"}'Login:
curl -X POST https://workout-tracker-h6zn.onrender.com/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "shreya@example.com", "password": "Test1234!"}'Create Workout:
curl -X POST https://workout-tracker-h6zn.onrender.com/workouts/ \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Morning Push Day",
"scheduled_at": "2026-07-01T07:00:00",
"exercises": [
{"exercise_id": 1, "sets": 4, "reps": 10, "weight_kg": 60}
]
}'Shreya — GitHub
MIT License