Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

gokberkakdeniz/tavrimizfit-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tavrimizfit-api

This is a fitness application api built using express, mongoose and typescript with @hakanalpp.

Installation

  • Install dependencies yarn install

  • Create .env file like below

      DB_URI = "mongodb://username:password@server_ip:server_port/tavrimizfit"
      TOKEN_SECRET = "SOME_STRONG_RANDOM_STRING"
      PORT = 3001
    

Scripts

  • start: starts developement server
  • build: builds into dist/ folder

Endpoints

  • POST /login
{
    "email": "[email protected]",
    "password": "adminadmin"
}
  • POST /register - create user
{
    "name": "admin",
    "surname": "admin",
    "password": "adminadmin",
    "email": "[email protected]"
}
  • POST /profile - update profile
{
    "name": "name",
    "surname": "surname",
    "password": "password123"
}
  • POST /tutorials - create tutorial
{
    title: "title",
    description: "description",
    media: [
        "url1",
        "url2"
    ],
    tags: [
        "tag1",
        "tag2"
    ],
    type: "premium"
}
  • PATCH /tutorials/:id - update tutorial
{
    title: "title",
    description: "description",
    media: [
        "url1",
        "url2"
    ],
    tags: [
        "tag1",
        "tag2"
    ],
    type: "premium"
}
  • GET /tutorials - get tutorials

  • GET /tutorials/:id - get tutorial

  • DELETE /tutorials/:id - delete tutorial

  • POST /trainings - create training

{
	"title": "title",
	"description": "description",
	"tutorials": [
        "tutorial_id_1",
        "tutorial_id_2"
    ],
    tags: [
        "tag1",
        "tag2"
    ],
    type: "premium"
}
  • PATCH /trainings/:id - update training
{
	"title": "title",
	"description": "description",
	"tutorials": [
        "tutorial_id_1",
        "tutorial_id_2"
    ],
    tags: [
        "tag1",
        "tag2"
    ],
    type: "premium"
}
  • GET /trainings - get trainings

  • GET /trainings/:id - get training

  • DELETE /trainings/:id - delete trainings

  • POST /recipes - create recipe

{
	"title": "title",
	"description": "description",
	"ingredients": [
        "ingredient one",
        "ingredient two"
    ],
    tags: [
        "tag1",
        "tag2"
    ],
    calorie: "123"
}
  • PATCH /recipes/:id - update recipe
{
	"title": "title",
	"description": "description",
	"ingredients": [
        "ingredient one",
        "ingredient two"
    ],
    tags: [
        "tag1",
        "tag2"
    ],
    calorie: "123"
}
  • GET /recipes - get recipes

  • GET /recipes/:id - get recipe

  • DELETE /recipes/:id - delete recipes

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published