/miska_internship

this is an internship task

Primary LanguagePython

Description

the api is implemented using python fastapi framework, uvicorn server and mongodb database.

Instructions to run

1.) Install all the packages mentioned in pipfile 2.) open the terminal cd to this project directory and run "uvicorn main:app --reload" to start the api. 3.) use the login route first before testing any api routes for authorization purpose. 4.) the test database collections used in testing this project is given as json files in this repository. 5.) use "mongodb compass" application to import the json files into your database collection easily.

Api route examples

login route: http://127.0.0.1:8000/login/rohith/drabby - (http post request)

- username and password is sent as path parameters
- userid is sent as path parameter and item id is sent as query parameter

remove item route: http://127.0.0.1:8000/removeItem/6128ad862aa8de37767fdafe - (http delete request)

- item id is sent as path parameter

get items route: http://127.0.0.1:8000/getItems - (http get request)

- no headers, path and query parameters are required
- item id is sent as path parameter

add item route: http://127.0.0.1:8000/addItem - (http get request)

- json object is sent in request body