To setup project make sure you have docker installed
- Go into the main directory
full-stack-driton
and rundocker-compose build
- When build has finished run
docker-compose up
- When containers are up go into container (Node is not started automatically so you can run tests first)
- First into the web container
docker exec -it full-stack-web bash
- Run
npm install
- After this you can run
npm start
ornpm test
- Run
- Second into the api container
docker exec -it full-stack-api bash
- Run
npm install
- Here you can run
npm start
ornpm test
- Run
- First into the web container
- When both containers have been started and
npm start
has been run you can go tolocalhost:3000
to checkout the app
Note: There are some users and likes into the database out of the box so you can see functionality with less efort
{
createdAt: date,
updatedAt: date,
username: string
}
{
password: string,
username: string
}
{
createdAt: date,
id: integer,
userLikes: [ users ],
updatedAt: date,
username: string,
}
Auth routes
- URL:
/login
- METHOD:
POST
- BODY: User model
- RESPONSE:
JWT token
- RESPONSE CODE:
200
- METHOD:
- URL:
/signup
- METHOD:
POST
- BODY: User model
- RESPONSE: User model
- RESPONSE CODE:
200
- METHOD:
User routes
- URL:
/me
- METHOD:
GET
- RESPONSE: User model
- RESPONSE CODE:
200
- METHOD:
- URL:
/me/update-password
- METHOD:
POST
- BODY:
{ oldPassword: string, newPassword: string }
- RESPONSE:
{}
- RESPONSE CODE:
200
- METHOD:
- URL:
/most-liked
- METHOD:
GET
- RESPONSE:
Array<
Full User model>
- RESPONSE CODE:
200
- METHOD:
- URL:
/:userId
- METHOD:
GET
- PARAMS:
UserId
Get user with this id - RESPONSE:
Array<
Full User model>
- RESPONSE CODE:
200
- METHOD:
- URL:
/:userId/like
- METHOD:
GET
- PARAMS:
UserId
Like user with this id - RESPONSE:
{}
- RESPONSE CODE:
200
- METHOD:
- URL:
/:userId/unlike
- METHOD:
GET
- PARAMS:
UserId
Remove like from user with this id - RESPONSE:
{}
- RESPONSE CODE:
200
- METHOD: