# fastapi-backend-template

fastapi-backend-template bootstraps a backend project using FastAPI, async SQLAlchemy 2.0, Alembic migrations, PostgreSQL, and Docker. Ideal for setting up a clean Python API structure.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 244 installs · ★ 18 repo stars
- Author: rebyteai-template
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/rebyteai-template/rebyte-skills/tree/HEAD/fastapi-backend-template/SKILL.md
- Updated: 2026-06-16
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/fastapi-backend-template

## What it does

This skill guides the AI assistant in pulling and configuring a structured FastAPI foundation. The stack features asynchronous SQLAlchemy 2.0, Alembic database migrations, and PostgreSQL data persistence.

The workflow clones the starter template repository with shallow depth, safely handles existing folder contents, reinitializes Git tracking, creates a `venv` virtual environment, and installs dependencies from `requirements.txt`.

Running the application requires Python 3.11 or newer along with an accessible PostgreSQL server. Without these prerequisites in place, the local `uvicorn` dev server fails during startup.

## Requirements
- Works with: PostgreSQL, Docker

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add rebyteai-template/rebyte-skills --skill fastapi-backend-template -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/fastapi-backend-template/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/fastapi-backend-template/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add rebyteai-template/rebyte-skills --skill fastapi-backend-template -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/fastapi-backend-template/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add rebyteai-template/rebyte-skills --skill fastapi-backend-template -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/fastapi-backend-template/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install rebyteai-template/rebyte-skills fastapi-backend-template
```

2. **Manually: put the files in place**
- File: `.github/skills/fastapi-backend-template/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add rebyteai-template/rebyte-skills --skill fastapi-backend-template -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/rebyteai-template/rebyte-skills --path fastapi-backend-template
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/fastapi-backend-template/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add rebyteai-template/rebyte-skills --skill fastapi-backend-template -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/rebyteai-template/rebyte-skills/tree/HEAD/fastapi-backend-template/SKILL.md

## When to use it
- bootstrap a structured FastAPI application from a repository template
- configure asynchronous database sessions with SQLAlchemy 2.0
- apply schema migrations with Alembic
- prepare a backend service for Docker containerization

## Example prompts
- Scaffold a new FastAPI project with PostgreSQL using the fastapi-backend-template
- Set up a Python API repository with async SQLAlchemy and Alembic migrations

## Similar
- [python-fastapi-scalable-api-cursorrules-prompt-fil](https://affpapa.org/en/nevibecode/rules/python-fastapi-scalable-api-cursorrules-prompt-fil.md) — rule · ★ 41178 repo stars
- [fastapi-pro](https://affpapa.org/en/nevibecode/skills/fastapi-pro.md) — skill · 201 installs
- [sqlalchemy-postgres](https://affpapa.org/en/nevibecode/skills/sqlalchemy-postgres.md) — skill · 510 installs
- [python-backend-expert](https://affpapa.org/en/nevibecode/skills/python-backend-expert.md) — skill · 138 installs
- [fastapi-templates](https://affpapa.org/en/nevibecode/skills/fastapi-templates.md) — skill · 25840 installs
- [backend-development](https://affpapa.org/en/nevibecode/skills/backend-development.md) — skill · 2400 installs

From the same set: [rebyteai-template/rebyte-skills](https://affpapa.org/en/nevibecode/by/rebyteai-template/rebyte-skills.md) — 12 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
