Skip to content

Simple quiz RESTful API built with FastAPI and a PostgreSQL database. Made for a 1 week dev jam in conjunction with a vue frontend.

License

Notifications You must be signed in to change notification settings

Inkapa/quiz-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Quiz API

python version license

English | Français


Introduction

This is a simple asynchronous quiz API built for a Simple Quiz

The API uses the FastAPI infrastructure and a PostgreSQL database

How does it work?

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)

Preview

Live demo

Project setup

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

Credits

The project was built with FastAPI, Ormar, Pydantic and Uvicorn

It is hosted using Heroku

License

MIT

About

Simple quiz RESTful API built with FastAPI and a PostgreSQL database. Made for a 1 week dev jam in conjunction with a vue frontend.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages