Skip to content

Alexandremerancienne/MySartorius

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MySartorius: REST API to track workout progression

MySartorius is a Golang RESTful API designed for a gym center. The API enables its clients and coaches to keep track of their workout progression.

Authentication

  • Access is granted to authenticated users via JSON Web Tokens (JWTs).

Models

  • Users are divided into 4 categories: Manager, Coach, Client, Anonymous User (potential future member of the gym).
  • Coaches and clients have 2 forms of interaction:
    • Sessions: live sessions at the gym center;
    • Tasks: exercises to complete at home.
  • Clients can create for themselves reminders.
  • Reminders are comments added by a client to a task to provide additional detail.

Permissions

  • Users are divided into three categories: Manager, Coaches, Clients;
  • The Manager can read and edit any information available except the reminders posted by the clients for themselves;
  • Other users can access any information regarding their activity: Coaches and Clients can access all the sessions and tasks they are involved in;
  • Clients can also access and edit all the reminders they have created for themselves;
  • Only Coaches and the Manager can edit sessions and tasks;
  • A coach cannot edit a session or task involving another coach;

Installation

Database Setup: MySQL.

This locally-executable API can be installed and executed from using the following steps.

  1. Clone this repository: git clone https://github.com/Alexandremerancienne/MySartorius.git or download the code as a zip file.
  2. Once locally downloaded, install required modules: go mod tidy.
  3. Run the server: go run main.go.

Usage and detailed endpoint documentation

One you have launched the server, you can consume the API at the following endpoints:

All these endpoints support HTTP requests using GET, POST, PUT and DELETE methods.

Examples:

Filters

You can apply filters to search a specific piece of information.

Search and filter users

You can search and filter users with the following endpoint: http://localhost:4000/users/. The filters available are:

These filters can be combined, for example:

Search and filter sessions

You can search and filter sessions with the following endpoint: http://localhost:4000/sessions. The filters available are:

These filters can be combined, for example:

Search and filter tasks

You can search and filter tasks with the following endpoint: http://localhost:4000/tasks. The filters available are:

These filters can be combined, for example:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages