In general, the application follows the standard path Fastapi + SQLalchemy.
Thus, we have the main paths/routes, their data scheme, web docs, database and its models.
The application is launched on the ASGI server, the data correctness is ensured by Pydantic.
This application is annotated and written with in the async paradigm.
Upon the initialization app grabs docs from the openapi.yaml
and uses them to construct the web docs
In short, the application receives a request, validates its data, computes the result, likely using the database and sends it back.
For more details on how Fastapi works you can read its docs.
app.py
- App initialization and path/route handlerscrud.py
- Database interface for our models (CreateReadUpdateDelete)database.py
- Database initialization and other things that help db workdocs.py
- Pulls out the documentation from YAML and saves it in a useful wayexceptions.py
- Custom exceptions and exception handlerslogfile.log
- Gitignored, but if the app gets run, used for the logginglogger.py
- Setup and things needed for loggingmodels.py
- Database modelsopenapi.yaml
- YAML documentation used to generate web docsoptions.py
- Changeable application-wide settings and optionspatches.py
- Monkey-patching of the libs, the first thing done in initializationpy.typed
- Marker file for PEP 561README.md
- This file, nice recursion;>
run.py
- Run the app programmatically (+debug)schemas.py
- Pydantic definitions for in/out data structuressqlite.db
- Gitignored, but if the app gets run, the database is created heretypedefs.py
- Type/annotation definitions for typechecking__init__.py
- Package initialization__main__.py
- Main command-line interface for the application