This is a fitness application api built using express
, mongoose
and typescript
with @hakanalpp.
-
Install dependencies
yarn install
-
Create
.env
file like belowDB_URI = "mongodb://username:password@server_ip:server_port/tavrimizfit" TOKEN_SECRET = "SOME_STRONG_RANDOM_STRING" PORT = 3001
start
: starts developement serverbuild
: builds intodist/
folder
- 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