Development for more info.
models/ - Any database models used should be defined here along with supporting files (eq the models/enums.py
) used here. Models are specified using the SQLAlchemy format, see models/user.py
for an example.
resources/ - Contains the actual Route resources used by your API. Basically, each grouped set of routes should have its own file, which then should be imported into the resources/routes.py
file. That file is automatically imported into the main application, so there are no more changes needed. Check out the routes in resources/user.py
for a good example. Note that the routes contain minimal actual logic, instead they call the required functionality from the Manager (UserManager in managers/user.py
in this case).
schemas/ - Contains all request
and response
schemas used in the application, as usual with a separate file for each group. The Schemas are defined as Pydantic Classes.
static/ - Any static files used by HTML templates for example CSS or JS files.
templates/ - Any HTML templates. We have one by default - used only when the root of the API is accessed using a Web Browser (otherwise a simple informational JSON response is returned). You can edit the template in templates/index.html
for your own API.