Repository structure
How the project structure is organized
TODO: Please add a screenshot of the GitHub repository structure to provide a visual representation of the project organization.
backend folder
A directory containing files related to the application backend.
Files:
- Dockerfile -
- pyproject.toml
- pytest.ini
- provider_price_list.json
- src
This directory contains the most important files for the operation of the application. Here we can find the config configuration, app startup files and the rest of projects, transactions and settings which are the objects present in the database along with the necessary tools for their operation such as repositories and use_cases. The repositories of all objects are built on top of a single, common and generic one stored in the seedwork directory. There is also a utils.py file containing general-purpose functions.
-
app: In
appwe store the initialization of containers and applications, and make sure that if there are no projects, two primary ones will be created. Independencieswe store the functions used to retrieve dependencies from the request. Inexception_handlerswe store exception handling modules. Inloggingwe initialize the application logger. Inmiddlewarewe store middleware that, for example, detects a subdomain. Inweb_apiare all the endpoints used to communicate the visual layer with the backend. Inweb_homeis the endpoint that captures all the unattended traffic within the application. Well, and the most important part of the application:reverse_proxy. This is where we intercept user requests, process them, send them to an external AI provider, and store the received response in the system and send it back to the user. -
config: In
__init__the basic application configuration is initialized, andcontainerscontains all the application container logic. -
projects/transactions/settings: These are objects stored in the database, and the structure of the files in these folders is uniform.
modelscontains the models of these objects, andschemasthe schemas used in endpoints.repositoriescontains the repository of a given object.use_casesis a set of functions that use the repository, used in endpoints to retrieve, for example, a list of objects or add a new object.
- tests
Here you can find tests of the application. This is a very important part. Without running tests, the production image of the application will not be built.
perf_tests
This directory contains performance tests for the application with use of locust.io
docs
A directory containing the github pages jackyll files from which the application documentation is automaticallly built. More information on how to contribute to the documentation can be found is section How the documentation is organized
examples folder
Jupyter notebooks examples for various AI providers.
UI
A directory containing the files from which the visual layer of the application is built.