Production-ready boilerplate for building async microservices in Python (FastAPI + Pydantic), Go, and Rust (Axum + sqlx). All templates include async PostgreSQL, health checks, Docker support, and common microservice patterns.
Use this to rapidly scaffold new microservices—copy a template, rename it, and start building.
pgx v5 – Concurrent Postgres driver with connection pool
Standard library – Config, JSON, errors
Run Locally
cd go
cp .env.example .env # Edit if needed
go run ./cmd/server
Key Files
File
Purpose
internal/config/
Env-based config
internal/database/
Pool, migrations
internal/models/
Request/response structs
internal/handlers/
HTTP handlers
internal/services/
Business logic
Adding a New Resource
Add model structs in internal/models/
Add service in internal/services/
Add handler in internal/handlers/
Register routes in cmd/server/main.go
Environment Variables
Variable
Default
Description
APP_NAME
go-microservice
Service name
PORT
8080
Server port
DATABASE_URL
postgres://...
Postgres connection string
DEBUG
false
Debug mode
Rust Microservice
Stack
Axum – Async web framework
sqlx – Async Postgres with connection pooling
serde – Serialization for JSON
tokio – Async runtime
Run Locally
cd rust
cp .env.example .env # Edit if needed
cargo run
Key Files
File
Purpose
src/config.rs
Env-based config
src/database.rs
Pool, schema init
src/models.rs
Structs with serde (Create, Read, Update)
src/handlers.rs
HTTP handlers
Adding a New Resource
Add model structs in src/models.rs
Add handler logic in src/handlers.rs
Register routes in src/main.rs
Environment Variables
Variable
Default
Description
APP_NAME
rust-microservice
Service name
PORT
8081
Server port
DATABASE_URL
postgres://...
Postgres connection string
RUST_LOG
info
Log level
API Endpoints
All services expose the same API surface (shared items table):
Method
Path
Description
GET
/health
Liveness probe
GET
/health/ready
Readiness probe
GET
/items
List items (paginated)
GET
/items/{id}
Get item by ID
POST
/items
Create item
PATCH
/items/{id}
Partial update
DELETE
/items/{id}
Delete item
Example: Create an Item
curl -X POST http://localhost:8081/items \
-H "Content-Type: application/json" \
-d '{"name": "My Item", "description": "A test item"}'
Docker
Build & Run
# All services
docker compose up -d
# Specific service
docker compose up -d python-service
# or: go-service, rust-service# Rebuild after changes
docker compose up --build -d