English | Français
This is a simple asynchronous quiz API built for a Simple Quiz
The API uses the FastAPI infrastructure and a PostgreSQL database
The api allows you to do the following:
- ✅ - Create a new Quiz
- ✅ - Fetch a quiz's information with a uuid key
- ✅ - Fetch a random quiz
- ✔️ - verify if an answer is correct through uuid keys (disabled by default)
To build the project as intended, both the API and Frontend are required.
For more information of how to setup the Frontend please refer yourself to the Frontend's README page
To get started with the API, you must first install the python dependencies needed by the application, to do so simply run:
pip install -r requirements.txt
You now need a PostgreSQL database, this can be obtained through different means.
You can either install PostgreSQL locally (possibly through docker) if you're running this on your own server
Or you can use a hosting platform, such as Heroku
Once you have a database you simply need to create a .env
file in your src
directory following the .env.sample
format.
In it put your PostgreSQL uri.
You can now run main.py
and it'll take care of the rest
For additional configuration such as CORS, use config.py
The project was built with FastAPI, Ormar, Pydantic and Uvicorn
It is hosted using Heroku