- open docker desktop
- run: docker run -it --rm --name lap4 --mount type=bind,src="$(pwd)",dst=/code -p 5000:5000 python:3.11 bash -c "cd /code && bash
- pip install pipenv
- pipenv install
- pipenv run dev
POST
/filestorage/avatar-images/:user_id
- return201
status code, upload avatar image for user on s3 and change link for avatar image in user table. Pass user id in params.PATCH
/filestorage/avatar-images/:user_id
- return200
status code, delete previous avatar image on s3 and change for new one, update link for avatar image in user table. Pass user id in params.DELETE
/filestorage/avatar-images/:user_id
- return204
status code, delete avatar image and change link for avatar image in user table for default one. Pass user id in params.POST
/filestorage/room-images/:room_name
- return201
status code, upload room image for room on s3 and change link for room image in room table. Pass room name in params.PATCH
/filestorage/room-images/:room_name
- return200
status code, delete previous room image on s3 and change for new one, update link for room image in room table. Pass room name in params.DELETE
/filestorage/room-images/:room_name
- return204
status code, delete room image and change link for room image in room table for default one. Pass room name in params.
POST
/auth/register
- return201
status code, take username, email, password form fields and create new user create and return new user object with default avatar image link (note - it generates and stores hash of password)POST
/auth/login
- return204
status code, take username, password form fields, check them with database data and if all good, login user and create flask sessionGET
/auth/login-check
- check if user is logged in and have flask session, if so return200
status code with user object, otherwise return401
status code error (Unauthorized)GET
/auth/logout
- return204
status code, clear current user session
GET
/likes
- return200
status code with a list of all likesPOST
/likes
- return201
status code, take user_id and room_id and create new likeGET
/likes/user/:id
- return200
status code with list of likes for the specified user idGET
/likes/room/:id
- return200
status code with list of likes for the specified room idDELETE
/likes/:user_id/:room_id
- return204
status code and delete likes by user and room id's
GET
/users/name/:name
- return200
status code with a user data for the specified user namePATCH
/users/name/:name
- return200
status code, update user by user name with passed data and return updated user dataDELETE
/users/name/:name
- return204
status code, delete user by user nameGET
/users/:id
- return200
status code with a user data for the specified user idPATCH
/users/:id
- return200
status code, update user by user id with passed data and return updated user dataDELETE
/users/:id
- return204
status code, delete user by user id
GET
/rooms
- return200
status code and list of all rooms from rooms table.POST
/rooms
- return201
status code, create new db row in rooms table and then take name of room with all files that you want to upload to it and create folder with this name and data in s3 cloudGET
/rooms/images/:id
- return200
status code with zip file with images for environment map by passed room id (and create tmp folder with images on server)POST
/rooms/images/cleanup
- return204
status code and delete tmp folder on serverGET
/rooms/:id
- return200
status code and room data from rooms table selected by passed room idPATCH
/rooms/:id
- return200
status code, update room record in rooms table and images for environment map on s3 cloud by passed room id (note - it deletes ALL images and replaces them by new, so be aware)DELETE
/rooms/:id
- return204
status code and delete room record in rooms table with images for environment map by passed room id