Files
backend-python/copier.yml
T
2026-09-08 23:59:31 +02:00

120 lines
2.6 KiB
YAML

_subdirectory: template
_templates_suffix: .jinja
_answers_file: .copier/backend.yml
_envops:
keep_trailing_newline: true
project_name:
type: str
help: Project name
project_slug:
type: str
help: Package name, snake_case
default: "{{ project_name | lower | replace(' ', '_') | replace('-', '_') | replace('.', '_') }}"
project_description:
type: str
default: "{{ project_name }}"
author_name:
type: str
default: ""
author_email:
type: str
default: ""
layout:
type: str
help: Where the backend lives
choices:
In backend/ next to other parts: part
At the root of the project: root
default: part
backend_services:
type: str
multiselect: true
help: Services, each runs as python -m <module> from one image
choices:
FastAPI api: api
aiogram bot: aiogram_bot
kurigram userbot: kurigram_userbot
taskiq worker: taskiq_worker
APScheduler scheduler: scheduler
default:
- aiogram_bot
database:
type: str
choices:
none: none
MongoDB (Beanie): mongo
PostgreSQL (SQLModel + Alembic): postgres
default: mongo
use_dishka:
type: bool
when: "{{ database != 'postgres' }}"
help: Dishka dependency injection
default: true
use_redis:
type: bool
help: Redis for cache, FSM storage and the taskiq broker
default: false
taskiq_broker:
type: str
when: "{{ 'taskiq_worker' in backend_services }}"
choices:
in-memory: memory
Redis: redis
PostgreSQL (taskiq-pg):
value: postgres
validator: "{% if database != 'postgres' %}Requires the PostgreSQL database{% endif %}"
default: memory
include_payments:
type: bool
when: "{{ 'aiogram_bot' in backend_services }}"
help: CryptoPay (aiosend) deposit and withdraw handlers
default: false
use_llm:
type: bool
help: pydantic-ai agent with Gemini
default: false
dynamic_config:
type: bool
when: "{{ database != 'none' }}"
help: DynamicConfig stored in the database with scripts/config/edit.py
default: "{{ database != 'none' }}"
serve_spa:
type: bool
when: "{{ layout == 'part' and 'api' in backend_services }}"
help: Serve the frontend build from the api as a SPA
default: false
install_deps:
type: bool
help: uv sync after generation
default: true
part_dir:
type: str
when: false
default: "{{ 'backend' if layout == 'part' else '.' }}"
prefix:
type: str
when: false
default: "{{ 'backend/' if layout == 'part' else '' }}"
_tasks:
- "{% if _copier_operation == 'copy' and install_deps %}sh -c 'cd {{ part_dir }} && uv sync'{% else %}true{% endif %}"
- "{% if install_deps %}sh -c 'cd {{ part_dir }} && uv run ruff format -q'{% else %}true{% endif %}"