Loading repository data…
Loading repository data…
matinone / repository
Quiz app using Python best practices for backend development.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Quiz app using FastAPI.
This project uses Poetry for dependency management.
$ curl -sSL https://install.python-poetry.org | python3 - # install Poetry
$ poetry install # install project dependencies using Poetry
Poetry is also used to run different commands to start the server or run tests, which requires installing the Poe the Poet task runner. Poe the Poet is already added as a dependency in the pyproject.toml file, so it should have been installed with the poetry install command, but the separate Poetry plugin must also be added.
$ poetry self add 'poethepoet[poetry_plugin]'
At this point, the following commands can be run:
$ poetry poe start # run Uvicorn server
$ poetry poe test # run testcases
$ poetry poe lint # run Ruff linter
$ poetry poe format # format code with Ruff
$ poetry poe precommit # run pre-commit hooks
More arguments can be added to the base commands, for example poetry poe start --reload.
There are also pre-commit hooks configured to run the Ruff linter and code formatter. To install them, run pre-commit install.
USE_SQLITE=true in the .env file.-t to tag the image).$ docker build -t fastapi_quiz .
-d for detached mode to run the container in the background, -p HOST:CONTAINER to map the ports).$ docker run -d -p 8000:8000 --name fastapi_cont fastapi_quiz
-f to follow the logs).$ docker logs fastapi_cont -f
$ docker stop fastapi_cont
$ docker rm fastapi_cont
--build to rebuild the images).$ docker compose up -d
email=pgadmin4@pgadmin.org and password=admin to login (they are defined in the docker-compose.yml file).$ docker logs fastapi_app -f # FastAPI app logs
$ docker logs postgres_db -f # PostgreSQL logs
-v to also delete the volume used for PostgreSQL data).$ docker compose down -v