### Install GitHub Actions Runner as a Service (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Installs the self-hosted GitHub Actions runner as a service using the provided script. This ensures the runner starts automatically on boot and remains active. ```bash exit sudo su cd /home/github/actions-runner ./svc.sh install github ./svc.sh start ./svc.sh status ``` -------------------------------- ### Local Development Server (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/frontend/README.md Commands to install dependencies and start the local development server for the frontend using Bun. This server provides live reloading for a productive development experience. ```bash bun install bun run dev ``` -------------------------------- ### Install GitHub Actions Runner User and Permissions (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Creates a dedicated user for GitHub Actions, adds Docker permissions, and switches to the new user. This is a prerequisite for installing the self-hosted runner. ```bash sudo adduser github sudo usermod -aG docker github sudo su - github cd ``` -------------------------------- ### Install Copier with pip Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/README.md Instructions for installing the Copier tool using pip. Copier is used to generate new projects from templates. ```bash pip install copier ``` -------------------------------- ### Install Prek for Automatic Git Commits (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/development.md Installs the 'prek' tool as a pre-commit hook in the local Git repository. This ensures code linting and formatting are applied automatically before each commit. The '-f' flag forces installation, overwriting any existing hooks. ```bash uv run prek install -f prek installed at `../.git/hooks/pre-commit` ``` -------------------------------- ### Install Copier with pipx Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/README.md Instructions for installing the Copier tool using pipx, a tool for installing and running Python applications in isolated environments. This is the recommended method if pipx is available. ```bash pipx install copier ``` -------------------------------- ### Start Traefik Docker Compose (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Starts the Traefik Docker service in detached mode using the 'compose.traefik.yml' file. This command should be run after setting the necessary environment variables. ```bash docker compose -f compose.traefik.yml up -d ``` -------------------------------- ### Deploy FastAPI Application with Docker Compose Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Build and run the FastAPI application using Docker Compose. This command sequence first builds the Docker images defined in the 'compose.yml' file and then starts the services in detached mode. ```bash cd /root/code/app/ docker compose -f compose.yml build docker compose -f compose.yml up -d ``` -------------------------------- ### Run End-to-End Tests (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/frontend/README.md Commands to start the Docker Compose stack, run Playwright end-to-end tests, and stop the stack. These tests verify the frontend's behavior in a production-like environment. ```bash docker compose up -d --wait backend bunx playwright test docker compose down -v ``` -------------------------------- ### Docker Compose for Development Stack Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Provides commands for managing the development environment using Docker Compose. This includes starting services with hot reload, checking logs, and stopping services to run them locally. ```bash # Start all services with hot reload docker compose watch # Check logs docker compose logs -f backend # Stop a specific service to run locally docker compose stop frontend cd frontend && bun run dev # Or stop backend to run locally docker compose stop backend cd backend && fastapi dev app/main.py ``` -------------------------------- ### Create Traefik Directory (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Creates a directory on the remote server to store the Traefik Docker Compose file. This is a prerequisite for copying the configuration file. ```bash mkdir -p /root/code/traefik-public/ ``` -------------------------------- ### Generate Project with Copier (pipx) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/README.md Alternative command to generate a new project using Copier via pipx, useful if Copier is not installed globally. The `--trust` flag is required for post-creation scripts. ```bash pipx run copier copy https://github.com/fastapi/full-stack-fastapi-template my-awesome-project --trust ``` -------------------------------- ### Run Alembic Migrations in Docker Container Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/backend/README.md This snippet demonstrates how to execute Alembic migration commands within the backend Docker container. It covers starting an interactive session, creating new revisions after model changes, and applying migrations to the database. Ensure Alembic is configured to find your SQLModel models. ```bash $ docker compose exec backend bash $ alembic revision --autogenerate -m "Add column last_name to User model" $ alembic upgrade head ``` -------------------------------- ### Configure GitHub Repository Secrets Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Lists the required secrets that need to be configured in the GitHub repository settings for the deployment workflows to function correctly. These secrets include various credentials and configuration values. ```text DOMAIN_PRODUCTION DOMAIN_STAGING STACK_NAME_PRODUCTION STACK_NAME_STAGING EMAILS_FROM_EMAIL FIRST_SUPERUSER FIRST_SUPERUSER_PASSWORD POSTGRES_PASSWORD SECRET_KEY LATEST_CHANGES SMOKESHOW_AUTH_KEY ``` -------------------------------- ### Set Remote API URL (Environment Variable) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/frontend/README.md Example of how to configure the frontend to use a remote API by setting the VITE_API_URL environment variable in the .env file. ```env VITE_API_URL=https://api.my-domain.example.com ``` -------------------------------- ### Verify Hashed Traefik Password (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Prints the generated hashed password to the console for verification. This helps ensure the hashing process was successful. ```bash echo $HASHED_PASSWORD ``` -------------------------------- ### Create Traefik Docker Network (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Creates a Docker network named 'traefik-public' on the remote server. This network is used by Traefik to communicate with other Docker services. ```bash docker network create traefik-public ``` -------------------------------- ### Copy Project Code to Server (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Copies the FastAPI project's source code from the local machine to the remote server using rsync. It uses a filter to exclude files ignored by Git, such as virtual environments. ```bash rsync -av --filter=":- .gitignore" ./ root@your-server.example.com:/root/code/app/ ``` -------------------------------- ### Convert MJML to HTML for Email Templates Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/backend/README.md This describes the process of creating and converting email templates using MJML. After installing the MJML VS Code extension, you can create `.mjml` files in the `src` directory and use the 'MJML: Export to HTML' command to generate `.html` files for the `build` directory. ```bash Ctrl+Shift+P -> MJML: Export to HTML ``` -------------------------------- ### Set Traefik Let's Encrypt Email (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Sets the environment variable 'EMAIL' for Let's Encrypt certificate registration. A valid email address is required for notifications and recovery. ```bash export EMAIL=admin@example.com ``` -------------------------------- ### Copy Traefik Docker Compose (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Copies the Traefik Docker Compose file from a local machine to the remote server using rsync. This command assumes the file is named 'compose.traefik.yml' locally. ```bash rsync -a compose.traefik.yml root@your-server.example.com:/root/code/traefik-public/ ``` -------------------------------- ### Set Environment Variables for FastAPI Template Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Configure essential environment variables for the FastAPI application. These include settings for the environment, domain, database credentials, secret key, CORS origins, and email server details. These variables are crucial for both development and production deployments. ```bash export ENVIRONMENT=production export DOMAIN=fastapi-project.example.com export POSTGRES_PASSWORD="changethis" export SECRET_KEY="changethis" export FIRST_SUPERUSER_PASSWORD="changethis" export BACKEND_CORS_ORIGINS="https://dashboard.${DOMAIN?Variable not set},https://api.${DOMAIN?Variable not set}" ``` -------------------------------- ### Get User by Email Backend Function Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Backend function to retrieve a user's record from the database using their email address. It returns the User model instance or None if not found. Requires a SQLModel Session. ```python from app.crud import get_user_by_email user = get_user_by_email(session=session, email="user@example.com") # Returns: User | None ``` -------------------------------- ### Set Traefik Basic Auth Username (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Sets the environment variable 'USERNAME' for Traefik's HTTP Basic Authentication. The value 'admin' is used as an example. ```bash export USERNAME=admin ``` -------------------------------- ### Generate Frontend Client (Bun) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/frontend/README.md Command to manually generate the frontend client using Bun after downloading the OpenAPI JSON file. This is an alternative to the automated script. ```bash bun run generate-client ``` -------------------------------- ### Frontend TypeScript Client: Login and Authentication Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Demonstrates how to use the generated TypeScript client to log in a user, obtain an access token, and set it for subsequent authenticated requests. It also shows how to verify the token by fetching the current user's details. ```typescript import { LoginService, OpenAPI } from './client' // Login and get access token const loginResponse = await LoginService.loginAccessToken({ formData: { username: 'user@example.com', password: 'password123' } }) // Set token for subsequent requests OpenAPI.TOKEN = loginResponse.access_token // Verify token is valid const currentUser = await LoginService.testToken() console.log(`Logged in as: ${currentUser.email}`) ``` -------------------------------- ### Environment Configuration with .env File Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Details the environment variables required for configuring the application, including domain, environment type, project name, secret key, and database connection settings. Also includes a Python command to generate secure keys. ```bash # .env file configuration DOMAIN=localhost ENVIRONMENT=local PROJECT_NAME="My FastAPI Project" SECRET_KEY=your-secure-secret-key-here FIRST_SUPERUSER=admin@example.com FIRST_SUPERUSER_PASSWORD=secure-admin-password # Database POSTGRES_SERVER=localhost POSTGRES_PORT=5432 POSTGRES_DB=app POSTGRES_USER=postgres POSTGRES_PASSWORD=secure-db-password # Generate secure keys python -c "import secrets; print(secrets.token_urlsafe(32))" ``` -------------------------------- ### Generate Frontend Client (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/frontend/README.md Script to automatically generate the frontend client based on the backend's OpenAPI specification. This ensures the frontend stays synchronized with the API. ```bash bash ./scripts/generate-client.sh ``` -------------------------------- ### Get Item by ID Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Retrieves a specific item by its UUID. Users can only access their own items unless they are superusers. Requires authentication. ```bash curl -X GET "http://localhost:8000/api/v1/items/660e8400-e29b-41d4-a716-446655440001" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Health Check API Endpoint Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt A simple GET endpoint to check if the FastAPI application is running and responsive. It returns a boolean value. ```bash curl -X GET "http://localhost:8000/api/v1/utils/health-check/" ``` -------------------------------- ### Register New User (Bash) Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Allows unauthenticated users to create a new account by providing email, password, and full name. This is the public user registration endpoint. ```bash curl -X POST "http://localhost:8000/api/v1/users/signup" \ -H "Content-Type: application/json" \ -d '{ "email": "newuser@example.com", "password": "securePassword123", "full_name": "New User" }' # Response: # { # "email": "newuser@example.com", # "is_active": true, # "is_superuser": false, # "full_name": "New User", # "id": "550e8400-e29b-41d4-a716-446655440001", # "created_at": "2024-01-15T12:00:00Z" # } ``` -------------------------------- ### Get User by ID Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Retrieves a specific user by UUID. Regular users can only access their own profile; superusers can access any user. Requires authentication. ```bash curl -X GET "http://localhost:8000/api/v1/users/550e8400-e29b-41d4-a716-446655440001" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Create Item Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Creates a new item owned by the authenticated user. The request body should be a JSON object containing item details like title and description. ```bash curl -X POST "http://localhost:8000/api/v1/items/" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ \ "title": "New Item", \ "description": "Description of the new item" \ }' ``` -------------------------------- ### Clone Repository - Bash Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/README.md Clones the Full Stack FastAPI Template repository and sets it up as a new project. This involves cloning the repository, changing the directory, updating the remote origin to a new GitHub repository, adding the original template as an upstream remote, and pushing the code to the new repository. ```bash git clone git@github.com:fastapi/full-stack-fastapi-template.git my-full-stack cd my-full-stack git remote set-url origin git@github.com:octocat/my-full-stack.git git remote add upstream git@github.com:fastapi/full-stack-fastapi-template.git git push -u origin master ``` -------------------------------- ### Get Authenticated User Profile (Bash) Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Retrieves the profile information for the currently authenticated user using their JWT access token. Requires the Authorization header. ```bash curl -X GET "http://localhost:8000/api/v1/users/me" \ -H "Authorization: Bearer $TOKEN" # Response: # { # "email": "user@example.com", # "is_active": true, # "is_superuser": false, # "full_name": "John Doe", # "id": "550e8400-e29b-41d4-a716-446655440001", # "created_at": "2024-01-15T10:00:00Z" # } ``` -------------------------------- ### Generate Project with Copier Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/README.md Command to generate a new project from the Full Stack FastAPI Template using Copier. It copies the template files and prompts for configuration. ```bash copier copy https://github.com/fastapi/full-stack-fastapi-template my-awesome-project --trust ``` -------------------------------- ### Set Traefik Basic Auth Password (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Sets the environment variable 'PASSWORD' for Traefik's HTTP Basic Authentication. The value 'changethis' is a placeholder and should be replaced with a secure password. ```bash export PASSWORD=changethis ``` -------------------------------- ### Set Traefik Domain Environment Variable (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Sets the environment variable 'DOMAIN' to specify the domain name for the Traefik proxy. This is crucial for routing and Let's Encrypt certificate generation. ```bash export DOMAIN=fastapi-project.example.com ``` -------------------------------- ### Frontend TypeScript Client: User Operations Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Illustrates various user-related operations using the TypeScript client, including fetching the current user's profile, updating it, registering a new user (public endpoint), and an admin-only function to list all users. ```typescript import { UsersService } from './client' // Get current user const me = await UsersService.readUserMe() // Update current user const updated = await UsersService.updateUserMe({ requestBody: { full_name: 'New Name' } }) // Register new user (public endpoint) const newUser = await UsersService.registerUser({ requestBody: { email: 'newuser@example.com', password: 'securePassword123', full_name: 'New User' } }) // Admin: List all users const users = await UsersService.readUsers({ skip: 0, limit: 50 }) console.log(`Total users: ${users.count}`) ``` -------------------------------- ### Frontend TypeScript Client - User Operations Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Illustrates common user-related operations using the TypeScript client, including fetching, updating, and registering users. ```APIDOC ### User Operations ```typescript import { UsersService } from './client' // Get current user const me = await UsersService.readUserMe() console.log(`Current user: ${me.email}`) // Update current user const updated = await UsersService.updateUserMe({ requestBody: { full_name: 'New Name' } }) console.log(`User updated: ${updated.full_name}`) // Register new user (public endpoint) const newUser = await UsersService.registerUser({ requestBody: { email: 'newuser@example.com', password: 'securePassword123', full_name: 'New User' } }) console.log(`New user registered: ${newUser.email}`) // Admin: List all users const users = await UsersService.readUsers({ skip: 0, limit: 50 }) console.log(`Total users: ${users.count}`) ``` ``` -------------------------------- ### Disable Alembic Migrations and Use Create All Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/backend/README.md This shows how to disable the Alembic migration system and instead use SQLModel's `create_all` function to manage database schema. This involves uncommenting specific lines in `db.py` and commenting out the Alembic upgrade command in `prestart.sh`. ```python SQLModel.metadata.create_all(engine) ``` -------------------------------- ### Generate Hashed Traefik Password (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Generates a hashed version of the Traefik Basic Auth password using openssl and stores it in the 'HASHED_PASSWORD' environment variable. This is a more secure way to store credentials for Traefik. ```bash export HASHED_PASSWORD=$(openssl passwd -apr1 $PASSWORD) ``` -------------------------------- ### Create User (Admin Only) Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Creates a new user with specified attributes. Requires superuser privileges. The request body should be a JSON object containing user details. ```bash curl -X POST "http://localhost:8000/api/v1/users/" \ -H "Authorization: Bearer $ADMIN_TOKEN" \ -H "Content-Type: application/json" \ -d '{ \ "email": "newuser@example.com", \ "password": "securePassword123", \ "full_name": "New User", \ "is_active": true, \ "is_superuser": false \ }' ``` -------------------------------- ### Frontend TypeScript Client - Authentication Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Demonstrates how to use the generated TypeScript client to log in a user and authenticate subsequent requests. ```APIDOC ### Login and Authentication ```typescript import { LoginService, OpenAPI } from './client' // Login and get access token const loginResponse = await LoginService.loginAccessToken({ formData: { username: 'user@example.com', password: 'password123' } }) // Set token for subsequent requests OpenAPI.TOKEN = loginResponse.access_token // Verify token is valid const currentUser = await LoginService.testToken() console.log(`Logged in as: ${currentUser.email}`) ``` ``` -------------------------------- ### Create User Backend Function Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Backend function to create a new user in the database. It takes a UserCreate model and returns the created User model instance with a hashed password and generated UUID. Requires a SQLModel Session. ```python from sqlmodel import Session from app.crud import create_user from app.models import UserCreate user_create = UserCreate( email="user@example.com", password="securePassword123", full_name="New User", is_active=True, is_superuser=False ) # session: SQLModel Session instance user = create_user(session=session, user_create=user_create) # Returns: User model instance with hashed_password and generated UUID ``` -------------------------------- ### Generate Secret Key (Python) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/deployment.md Generates a secure, random URL-safe text string using Python's secrets module. This is used for generating secret keys for environment variables like API keys or passwords. ```python import secrets; print(secrets.token_urlsafe(32)) ``` -------------------------------- ### List Users (Admin Only) Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Retrieves a paginated list of all users. Requires superuser privileges. Accepts skip and limit query parameters for pagination. ```bash curl -X GET "http://localhost:8000/api/v1/users/?skip=0&limit=10" \ -H "Authorization: Bearer $ADMIN_TOKEN" ``` -------------------------------- ### Manage Items with TypeScript Client Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Demonstrates how to perform CRUD operations on items using the auto-generated TypeScript client. This includes listing, creating, updating, and deleting items, leveraging the ItemsService for API interactions. ```typescript import { ItemsService } from './client' // List items with pagination const items = await ItemsService.readItems({ skip: 0, limit: 100 }) // Create new item const newItem = await ItemsService.createItem({ requestBody: { title: 'My Item', description: 'Item description' } }) // Update item const updatedItem = await ItemsService.updateItem({ id: newItem.id, requestBody: { title: 'Updated Title' } }) // Delete item await ItemsService.deleteItem({ id: newItem.id }) ``` -------------------------------- ### List Items Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Retrieves items owned by the current user. Superusers can see all items. Accepts skip and limit query parameters for pagination. ```bash curl -X GET "http://localhost:8000/api/v1/items/?skip=0&limit=100" \ -H "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Run Prek Hooks Manually (Bash) Source: https://github.com/fastapi/full-stack-fastapi-template/blob/master/development.md Executes all configured 'prek' hooks manually across all files in the project. This is useful for checking and formatting code outside of the commit process. It verifies various aspects like file sizes, TOML/YAML syntax, end-of-file checks, whitespace trimming, and code formatting with Ruff and Biome. ```bash uv run prek run --all-files check for added large files..............................................Passed check toml...............................................................Passed check yaml...............................................................Passed fix end of files.........................................................Passed trim trailing whitespace.................................................Passed ruff.....................................................................Passed ruff-format..............................................................Passed biome check..............................................................Passed ``` -------------------------------- ### Authenticate User and Obtain JWT Token (Bash) Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Authenticates a user via email and password and returns a JWT access token. This token is then used for subsequent authenticated API requests. ```bash # Login to get access token curl -X POST "http://localhost:8000/api/v1/login/access-token" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "username=admin@example.com&password=changethis" # Response: # { # "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", # "token_type": "bearer" # } # Use the token in subsequent requests curl -X GET "http://localhost:8000/api/v1/users/me" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ``` -------------------------------- ### Test Email API Endpoint (Admin Only) Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Allows administrators to send a test email to verify email configuration. This endpoint requires superuser privileges and a recipient email address. ```bash curl -X POST "http://localhost:8000/api/v1/utils/test-email/?email_to=test@example.com" \ -H "Authorization: Bearer $ADMIN_TOKEN" ``` -------------------------------- ### Define User and Item Database Models with SQLModel Source: https://context7.com/fastapi/full-stack-fastapi-template/llms.txt Defines the `User` and `Item` database models using SQLModel, including fields, relationships, and data types. These models represent the structure of user and item data in the database. ```python from sqlmodel import SQLModel, Field, Relationship from pydantic import EmailStr import uuid from datetime import datetime class User(SQLModel, table=True): id: uuid.UUID = Field(default_factory=uuid.uuid4, primary_key=True) email: EmailStr = Field(unique=True, index=True, max_length=255) hashed_password: str is_active: bool = True is_superuser: bool = False full_name: str | None = Field(default=None, max_length=255) created_at: datetime | None = Field(default_factory=lambda: datetime.now(timezone.utc)) items: list["Item"] = Relationship(back_populates="owner", cascade_delete=True) class Item(SQLModel, table=True): id: uuid.UUID = Field(default_factory=uuid.uuid4, primary_key=True) title: str = Field(min_length=1, max_length=255) description: str | None = Field(default=None, max_length=255) created_at: datetime | None = Field(default_factory=lambda: datetime.now(timezone.utc)) owner_id: uuid.UUID = Field(foreign_key="user.id", nullable=False, ondelete="CASCADE") owner: User | None = Relationship(back_populates="items") ```