Skip to Content
APSO is in public beta. Get started
GuidesTemplates

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 typescript

Python

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 python

Go

apsoai/service-template-go  scaffolds a Gin  backend with GORM, PostgreSQL, goose migrations, and Swagger documentation via swaggo.

apso init --name my-api --language go

How the CLI uses a template

  1. apso init clones the template for your language into a new project directory and installs dependencies.
  2. You define entities and relationships in .apsorc.
  3. apso generate writes entities, services, controllers, DTOs, and migrations into the template’s autogen directory.
  4. 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

LocationContentsSafe to edit?
src/autogen/Generated entities, controllers, services, DTOsNo. Overwritten on every generate
src/extensions/Your custom endpoints, hooks, and business logicYes. Never touched by Apso
.apsorcYour schema, the source of truthYes

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.

Last updated on