Skip to content

Barkaaat/Workout-Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workout Tracker

Solution for the Workout Tracker challenge from roadmap.sh.

Workout Tracker built with Node.js, Express, and MySql. This project allows you to create account, add workouts with detels, add comments to your workouts, and delete workouts.

Features

  • Create account: Register new account with username and password.
  • Login and Logout: With registration username and password.
  • Add workout: Use login token to add new workout.
  • Add comments to selected workout: You can add some comments to your workouts.
  • List workouts: Show your workouts with comments you have added.
  • Delete workout: Remove workout from your workouts list.

Prerequisites

  • Node.js
  • npm
  • MySql

Installation

  1. Clone the repository to your local machine:

    git clone https://github.com/Barkaaat/Workout-Tracker.git
    cd Workout-Tracker
  2. Install the required dependencies:

    npm i
  3. Ensure the .env file exists and contains your MySql connection data.

  4. Start the server:

    npm start

API Endpoints

  1. POST /auth/register
  • Request Body:
    { "username": "barakat", "password": "barakat123" }.
  1. POST /auth/login
  • Request Body:
    { "username": "barakat", "password": "barakat123" }
  • Get Response:
    { "message": "login successful", "token": token }.
  1. POST /workout/add
  • Headers authrization:
    Bearer token
  • Request Body:
    { "name": workout name, "muscle": muscle, "sets": sets num, "reps": reps num, "scheduleDate": scheduled date }.
  1. POST /workout/addComment
  • Headers authrization:
    Bearer token
  • Request Body:
    { "number": workout number, "comment": comment }
  1. DELETE /workout/delete
  • Headers authrization:
    Bearer token
  • Request Body:
    { "number": workout number }
  1. POST /auth/logout
  • Headers authrization:
    Bearer token

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published