Build a backend project providing an API, document and host it on the web.
A RESTFUL API that provides detailed information about African cuisines. As well as step by step instructions on how to make them. The API features a GraphQL endpoint, Swagger documentation, Postman documentation and RESTFUL API endpoints.
Authentication is done using API Key for protected route.
- Install python and project dependencies and packages
$ sudo apt update
$ sudo apt install -y python3
$ sudo apt install -y python3-pip
$ sudo apt install -y python3-venv
$ sudo apt-get install -y pkg-config
$ sudo apt-get install -y libmysqlclient-dev
$ sudo apt install -y nginx
$ pip install gunicorn
$ sudo apt install redis-server
$ sudo apt install mysql-server
$ sudo systemctl start mysql.service
$ pip install -r requirements.txt
- Setup database
$ cat setupDatabase.sql | mysql
- Setup virtual environment
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt
- Start the API servers
$ bash start_servers
- The RESTFUL API will be running on http://localhost:9000/api/v1/status while the graphql api on http://localhost:9000/api/v1/graphql and the swagger documentation on http://localhost:9001/api/v1/docs
- Create a user account POST /users
- Login to get your authentication token POST /login
- Create a recipe on POST /recipes
- Update a recipe on PUT /recipes/{id}
- Delete your recipe on DELETE /recipes/{id}
- Get a list of all available recipes on GET /recipes
- Search a recipe by querying GET /recipes?search=Plantain
- Data is paginated 10 items per page. You can specify a page to fetch by passing it in the query (e.g. GET /recipes?page=4)
- You can filter recipes by adding a dictionary of key(string), value(array containing filter values) in your query parameter. (Example : { "cuisine": [ "Nigerian", "West African", "Ghanaian" ], "cook_time_minutes": [ 6, 10, 50 ] })
- Destroy user session by querying the DELETE /logout
- Update user by querying PUT /users/{id}
- Delete user by querying DELETE /users/{id}
$ curl localhost:9000/api/v1/recipes