# FastAPI Webservice Copier Template

Generate backend-only Python services for Ubuntu, with FastAPI, uv, SQLite and systemd. Select Taskiq, FastMCP and ntfy independently at generation time.

## Highlights

- **Ready to run**: Typed REST endpoints, health checks, SQLite and an installed CLI.
- **Optional background jobs**: Redis Streams, Taskiq worker and a separate periodic scheduler.
- **Agent-ready MCP**: Standalone FastMCP on the existing HTTP server.
- **Push notifications**: Publish application events to a configured ntfy instance.
- **Fast feedback**: Ruff, ty, pytest, benchmarks and machine-readable diagnostics.
- **Repeatable deployment**: Shared CI, systemd units, cached configuration and gzip compression.

## Quick start

```bash
uvx copier copy --vcs-ref HEAD --data 'project_name=Backup Service' \
  gh:RuchirChawdhry/copier-fastapi-webservice backup-service
cd backup-service
git init -b main
task setup
cp .env.example .env
uv run backup-service init-db
uv run backup-service serve
```

Choose no when asked about jobs if Redis is not required. For a job-enabled service, install and start Redis first.

Open [FastAPI interactive docs](http://127.0.0.1:8000/docs) locally, or run `curl http://127.0.0.1:8000/health/ready`.

## Guides

- [Getting Started](https://ruchirchawdhry.github.io/copier-fastapi-webservice/getting-started/index.md) — feature selection and first run.
- [Configuration](https://ruchirchawdhry.github.io/copier-fastapi-webservice/configuration/index.md) — environment settings and secrets.
- [HTTP API](https://ruchirchawdhry.github.io/copier-fastapi-webservice/http-api/index.md) — requests, health and compression.
- [Background Jobs](https://ruchirchawdhry.github.io/copier-fastapi-webservice/background-jobs/index.md) — submit work and run the scheduler.
- [MCP](https://ruchirchawdhry.github.io/copier-fastapi-webservice/mcp/index.md) — register tools and connect agents.
- [Notifications](https://ruchirchawdhry.github.io/copier-fastapi-webservice/notifications/index.md) — send ntfy messages.
- [Deployment](https://ruchirchawdhry.github.io/copier-fastapi-webservice/deployment/index.md) — install and operate Ubuntu services.
- [Development and CI](https://ruchirchawdhry.github.io/copier-fastapi-webservice/development-and-ci/index.md) — checks and benchmarks.
- [Diagnostics](https://ruchirchawdhry.github.io/copier-fastapi-webservice/diagnostics/index.md) — diagnose failures with JSON.

[Source repository](https://github.com/RuchirChawdhry/copier-fastapi-webservice) · [Actions](https://github.com/RuchirChawdhry/copier-fastapi-webservice/actions)
