/every-single-day-back

The backend from a project with the purpose of getting track of healthy habits already setted.

Primary LanguageTypeScript

1% Every Single Day

Description

1%ESD
This is a project designed and developed by me. The idea is to have the user to improve himself, doing habits that I consider healthy, like drinking the correct amount of water, having a vision board to see his future plans. It's a place the user can keep on track on his habits in a way to see his improvement a litte bit every single day.

Built With

Typescript PostgreSQL Node.js Express.js Prisma Jest

Features:

  • Sign up
  • Login
  • Post an image on a vision board
  • Selecting what's the user humor for the day
  • Get the track of how much water was drinked
  • Having a place to post water and plans

References

Sign Up

Creating an account

POST /signup

Request:

Body Type Description
name string Required. Name from the user
email email Required. Email for the application
password string Required. Password used on the current application
confirmPassword string Required. Password used on the current application

Login

Entering the application

POST /login

Request:

Body Type Description
email email Required. Email for the application
password string Required. Password used on the current application

All the routes under the authorization routes, needs an Authorization on Headers!

Headers Type Description
Authorization string Required. Token from the user

Visions

Dealing with the vision board from the user

POST /vision

Request:

Body Type Description
image URL Required. Image from the user dream

GET /visions

Response :

All the images from the user vision board

[
	{
		"id": 4,
		"userId": 10,
		"image": "IMAGE URL"
	},
	{
		"id": 5,
		"userId": 10,
		"image": "IMAGE URL"
	}
]

Mood

The user mood for the day

POST /mood

Request:

Body Type Description
mood string Required. Mood from the user for the day, valids: awful, bad, average, good, happy
createdAt date Required. Date from when its created. Format: DD-MM-YYYY

GET /mood/DAY

Response :

Finding the user mood from that day

{
	"id": 5,
	"userId": 10,
	"mood": "good",
	"createdAt": "25-11-2022"
}

Diary

The user diary and plans for the day

POST /diary

The user can only have one plan and one diary by each day

Request:

Body Type Description
type string Required. Diary from the user for the day, valids: plans, diary
createdAt date Required. Date from when its created. Format: DD-MM-YYYY
text string Required. The text the user want to be your plan or diary

GET /diary/DAY

Response :

Finding the user diary and plan from that day

[
	{
		"id": 7,
		"userId": 10,
		"type": "plans",
		"text": "TEXT",
		"createdAt": "25-11-2022"
	},
	{
		"id": 6,
		"userId": 10,
		"type": "diary",
		"text": "TEXT",
		"createdAt": "25-11-2022"
	}
]

Water

The user water for the day

POST /water

Request:

Body Type Description
waterQuantity number Required. Quantity of water drinked by the user in L
createdAt date Required. Date from when its created. Format: DD-MM-YYYY

GET /water/DAY

Response :

Finding the user water quantity from that day

{
	"id": 4,
	"userId": 10,
	"waterQuantity": 2,
	"createdAt": "25-11-2022"
}

Weight

The weight of the user

POST /weight

Request:

Body Type Description
weight number Required. The weight on Kg from the user
createdAt date Required. Date from when its created. Format: DD-MM-YYYY

GET /weight

Response :

Finding the user weight

[
	{
		"id": 5,
		"userId": 10,
		"weight": 90,
		"createdAt": "25-11-2022"
	}
]

Starting the application:

Clone application to machine

git clone git@github.com:thaisealves/every-single-day-back.git

Run application

npm run dev

Access to front end

https://github.com/thaisealves/every-single-day-front