Skip to content

Adding A New Application

For this document example we will be creating a new app called Items

db table items
sqlalchemy model Item
pydantic schema Item
app endpoint /items
api endpoint /items/

Sqlalchemy Model

Import new models into ichrisbirch/alembic/env.py

Import new models into ichrisbirch/models/__init__.py
For easy reference from the module level.

from ichrisbirch import models

item = models.Item(**data)

Pydantic Schema

Import new schemas into ichrisbirch/schemas/__init__.py
For easy reference from the module level.

from ichrisbirch import schemas

item = schemas.ItemCreate(**data)

Application Blueprint

App Routes

Application Blueprint to App Factory

API Router

API Endpoints

Import in ichrisbirch/schemas/__init__.py
For easy reference from the module level.

API Router to API Factory

HTML base.html and index.html

🔗 Add link to navigation in ichrisbirch/app/templates/base.html

Stylesheet

Tests

Testing Data

:material-test: Add testing data into tests/testing_data
Import the test data in tests/testing_data/__init__.py Add testing data to tests/conftest.py/get_test_data()

API Endpoints Tests

App Routes Tests

Frontend Tests