Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‹οΈβ€β™‚οΈ MERN Workout Tracker App

A full-stack, responsive web application designed to help users log, track, and manage their daily workout routines efficiently. Built using the MERN stack (MongoDB, Express.js, React, Node.js), this project features secure user authentication, global state management, responsive UI design, and full CRUD operations.


πŸš€ Live Demo & Links

⚠️ Note on Free Tier Hosting (Render):
The backend service is hosted on Render's free tier. If the app hasn't been accessed recently, the backend server goes into a spin-down state. Please allow 50–60 seconds for the initial request to wake up the server. Once awake, the application will respond smoothly!


✨ Features

  • πŸ” User Authentication & Authorization: Secure signup and login using JWT (JSON Web Tokens) and bcrypt password hashing. Protected API routes ensure users can only view and manage their own workouts.
  • ⚑ CRUD Operations:
    • Create: Add new workout entries specifying exercise name, load (kg), and repetitions.
    • Read: Display dynamic list of logged workouts ordered chronologically.
    • Delete: Remove workout logs instantly with real-time state updates.
  • πŸ“± Fully Responsive UI/UX: Built with a mobile-first approach using Flexbox and CSS Grid to ensure a smooth experience on mobile devices, tablets, and desktops.
  • 🧠 Global State Management: Powered by React's Context API to prevent prop-drilling and maintain fast, synchronized UI updates without full page reloads.
  • πŸ›‘οΈ Form Validation & Error Handling: Highlights empty or invalid inputs on the client side before sending data to the server.

πŸ› οΈ Tech Stack

Frontend

  • Library: React.js
  • State Management: React Context API & useReducer
  • Styling: CSS3 (Flexbox & Grid, CSS Modules/Custom Styles)

Backend

  • Runtime Environment: Node.js
  • Framework: Express.js
  • Database: MongoDB Atlas (NoSQL)
  • Object Data Modeling (ODM): Mongoose

Security & Utilities

  • Authentication: JSON Web Tokens (jsonwebtoken)
  • Password Hashing: bcrypt / bcryptjs
  • Cross-Origin Handling: cors
  • Environment Variables: dotenv

πŸ“ Architecture & Key Concepts Learned

  1. State Synchronization: Implemented React Context (WorkoutsContext & AuthContext) alongside useReducer to seamlessly sync backend database mutations with frontend components in real-time.
  2. RESTful API Architecture: Designed scalable, decoupled backend controllers and routes adhering to HTTP protocols (GET, POST, PATCH, DELETE).
  3. Environment Security: Secured sensitive database credentials and secret keys using .env files and .gitignore practices to avoid exposing production keys.
  4. CORS & Multi-Platform Deployment: Managed cross-origin resource sharing between a decoupled React client and Express API across production server environments.

πŸ—‚οΈ Project Structure

Workout_Tracking_App/
β”‚
β”œβ”€β”€ backend/                  # Express API Server
β”‚   β”œβ”€β”€ controllers/          # Route logic & DB transactions
β”‚   β”œβ”€β”€ middleware/           # Auth verification middleware
β”‚   β”œβ”€β”€ models/               # Mongoose schemas (Workout, User)
β”‚   β”œβ”€β”€ routes/               # Express routing handlers
β”‚   └── server.js             # Server entry point
β”‚
└── frontend/                 # React UI Client
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ components/       # Reusable UI elements (Navbar, Forms, Details)
    β”‚   β”œβ”€β”€ context/          # React Context API providers & hooks
    β”‚   β”œβ”€β”€ pages/            # Page layouts (Home, Login, Signup)
    β”‚   └── App.js            # Main React routing component
    └── package.json

About

πŸ‹οΈβ€β™‚οΈ Full-stack MERN Workout Tracker with JWT authentication, global state management (React Context), Responsive UI, and custom date-based search.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages