Service Templates
Every Apso backend starts from a service template: a working GitHub repository with the framework, database wiring, local development scripts, and project structure already in place. When you run apso init, the CLI clones the template for your language. When you run apso generate, your schema is turned into code inside that structure.
You own the result. Templates are Apache-2.0 licensed, the generated code is standard framework code, and nothing in it depends on Apso at runtime.
The three templates
TypeScript
apsoai/service-template-ts scaffolds a NestJS 10 backend with TypeORM and PostgreSQL. It includes Swagger/OpenAPI documentation, request validation with class-validator, Docker Compose scripts for a local database, and a PGlite sandbox used by apso migrate to test schema changes before they touch a real database.
apso init --name my-api --language typescriptPython
apsoai/service-template-python scaffolds a FastAPI backend with SQLAlchemy 2 (async, via asyncpg), Alembic migrations, and Pydantic v2 models.
apso init --name my-api --language pythonGo
apsoai/service-template-go scaffolds a Gin backend with GORM, PostgreSQL, goose migrations, and Swagger documentation via swaggo.
apso init --name my-api --language goHow the CLI uses a template
apso initclones the template for your language into a new project directory and installs dependencies.- You define entities and relationships in
.apsorc. apso generatewrites entities, services, controllers, DTOs, and migrations into the template’sautogendirectory.- The template’s scripts run your local database and provision the schema. See the Quickstart for the full walkthrough.
What you edit and what Apso owns
| Location | Contents | Safe to edit? |
|---|---|---|
src/autogen/ | Generated entities, controllers, services, DTOs | No. Overwritten on every generate |
src/extensions/ | Your custom endpoints, hooks, and business logic | Yes. Never touched by Apso |
.apsorc | Your schema, the source of truth | Yes |
The split is the point of the template design: regenerate as often as your schema changes without losing a line of your own code. See The Extensions Pattern for how custom logic plugs in.
Looking for a general-purpose GitHub template to fork by hand? You can, they are public repositories. But apso init does the clone, dependency install, and git setup in one command, and apso generate only writes into projects with a valid .apsorc.
Related
- Quickstart builds a full API from the TypeScript template
- CLI configuration documents every
.apsorcfield - Local development covers the compose and provision scripts