A simple CRUD API application built with FastAPI. The application allows to add, delete, update and view books. Additionally, the functionality to search in titles using keywords is provided.
This application is dockerized, to start up docker container use $ docker-compose up.
- Python 3.10
- FastAPI 0.79.1
- SQLAlchemy 1.4.40
detailed information on other libraries used can be found in Pipfile.lock.
- Python 3.10 - https://www.python.org/downloads/
- Pipenv - https://pipenv.pypa.io/en/latest/
To develop this application further:
- clone this repository - git clone https://github.com/akasztalska/books_app.git
- start up local environment - pipenv shell
Tests are written using pytest library. To run tests use command: pytest
The style is checked by linter - flake8 and formatter - black. To check the configuration, read pre-commit-config.yaml. Pre-commit hook is added and code style checked before each commit.
To check API documentation go to localhost:8000/docs
The application should run on localhost:8000. The available endpoints are:
- / - GET, POST
- /{book_id} - GET, PUT, DELETE
- /search - GET (searching by keyword)
Project uses SQLite database.