Scaffold
Vorlagen und Boilerplate-Generierung für gängige Projekttypen mit Best-Practice-Standards.
Entscheidungsbaum für Projekttypen
Was baust du?
│
├─ API / Backend-Service
│ ├─ REST-API
│ │ ├─ Python → FastAPI (async, OpenAPI Auto-Dokumentation)
│ │ ├─ Node.js → Express oder Fastify (Fastify für Performance)
│ │ ├─ Go → Gin (ergonomisch) oder Echo (reich an Middleware)
│ │ └─ Rust → Axum (Tower-Ökosystem, async-first)
│ ├─ GraphQL-API
│ │ ├─ Python → Strawberry + FastAPI
│ │ ├─ Node.js → Apollo Server oder Pothos + Yoga
│ │ ├─ Go → gqlgen (code-first)
│ │ └─ Rust → async-graphql + Axum
│ └─ gRPC-Service
│ ├─ Python → grpcio + protobuf
│ ├─ Go → google.golang.org/grpc
│ └─ Rust → tonic
│
├─ Webanwendung
│ ├─ Full-Stack mit SSR
│ │ ├─ React-Ökosystem → Next.js 14+ (App Router)
│ │ ├─ Vue-Ökosystem → Nuxt 3
│ │ ├─ Svelte-Ökosystem → SvelteKit
│ │ └─ Inhaltslastig / Multi-Framework → Astro
│ ├─ SPA (nur Client)
│ │ ├─ React → Vite + React + React Router
│ │ ├─ Vue → Vite + Vue + Vue Router
│ │ └─ Svelte → Vite + Svelte + svelte-routing
│ └─ Statische Seite
│ ├─ Blog / Docs → Astro oder VitePress
│ └─ Marketing / Landingpage → Astro oder Next.js (statischer Export)
│
├─ CLI-Tool
│ ├─ Python → Typer (einfach) oder Click (komplex)
│ ├─ Node.js → Commander + Inquirer
│ ├─ Go → Cobra + Viper
│ └─ Rust → Clap (derive API)
│
├─ Bibliothek / Paket
│ ├─ npm-Paket → TypeScript + tsup + Vitest
│ ├─ PyPI-Paket → uv + pyproject.toml + pytest
│ ├─ Go-Modul → go mod init + go test
│ └─ Rust-Crate → cargo init --lib + cargo test
│
└─ Monorepo
├─ JavaScript/TypeScript → Turborepo + pnpm Workspaces
├─ Full-Stack JS → Nx
├─ Go → Go Workspaces (go.work)
├─ Rust → Cargo Workspaces
└─ Python → uv Workspaces oder hatch
Stack-Auswahlmatrix
| Projekttyp | Sprache | Framework | Datenbank | ORM/Query | Deploy-Ziel |
|---|---|---|---|---|---|
| REST-API | Python | FastAPI | PostgreSQL | SQLAlchemy + Alembic | Docker / AWS ECS |
| REST-API | Node.js | Fastify | PostgreSQL | Prisma oder Drizzle | Docker / Vercel |
| REST-API | Go | Gin | PostgreSQL | sqlx (raw) oder GORM | Docker / Fly.io |
| REST-API | Rust | Axum | PostgreSQL | sqlx | Docker / Fly.io |
| Web-App | TypeScript | Next.js 14+ | PostgreSQL | Prisma oder Drizzle | Vercel / Docker |
| Web-App | TypeScript | Nuxt 3 | PostgreSQL | Prisma | Vercel / Netlify |
| Web-App | TypeScript | Astro | SQLite / keine | Drizzle | Cloudflare / Netlify |
| CLI-Tool | Python | Typer | SQLite | sqlite3 stdlib | PyPI |
| CLI-Tool | Go | Cobra | SQLite / BoltDB | sqlx | GitHub Releases |
| CLI-Tool | Rust | Clap | SQLite | rusqlite | crates.io |
| Bibliothek | TypeScript | tsup | n/a | n/a | npm |
| Bibliothek | Python | hatch/uv | n/a | n/a | PyPI |
Schnell-Scaffold-Befehle
Python (API)
# FastAPI mit uv
mkdir my-api && cd my-api
uv init --python 3.12
uv add fastapi uvicorn sqlalchemy alembic psycopg2-binary pydantic-settings
uv add --dev pytest pytest-asyncio httpx ruff mypy
Node.js (Web-App)
# Next.js 14+
npx create-next-app@latest my-app --typescript --tailwind --eslint --app --src-dir --import-alias "@/*"
# Vite + React
npm create vite@latest my-app -- --template react-ts
Go (API)
mkdir my-api && cd my-api
go mod init github.com/user/my-api
go get github.com/gin-gonic/gin
go get github.com/jmoiron/sqlx
go get github.com/lib/pq
Rust (CLI)
cargo init my-cli
cd my-cli
cargo add clap --features derive
cargo add serde --features derive
cargo add anyhow tokio --features tokio/full
Monorepo (Turborepo)
npx create-turbo@latest my-monorepo
# Oder manuell:
mkdir my-monorepo && cd my-monorepo
npm init -y
npm install turbo --save-dev
mkdir -p apps/web apps/api packages/shared
API-Projektvorlage
Verzeichnisstruktur (FastAPI-Beispiel)
my-api/
├── src/
│ └── my_api/
│ ├── __init__.py
│ ├── main.py # FastAPI-App, Lebensdauer, Middleware
│ ├── config.py # pydantic-settings Konfiguration
│ ├── database.py # SQLAlchemy-Engine, Session
│ ├── dependencies.py # Gemeinsame FastAPI-Abhängigkeiten
│ ├── routers/
│ │ ├── __init__.py
│ │ ├── health.py # Health-Check-Endpunkt
│ │ └── users.py # User-CRUD-Endpunkte
│ ├── models/
│ │ ├── __init__.py
│ │ └── user.py # SQLAlchemy-Modelle
│ ├── schemas/
│ │ ├── __init__.py
│ │ └── user.py # Pydantic-Anfrage-/Antwortschemata
│ └── services/
│ ├── __init__.py
│ └── user.py # Geschäftslogik
├── alembic/
│ ├── alembic.ini
│ ├── env.py
│ └── versions/
├── tests/
│ ├── conftest.py # Fixtures: Test-DB, Client, Factories
│ ├── test_health.py
│ └── test_users.py
├── pyproject.toml
├── Dockerfile
├── docker-compose.yml
├── .env.example
├── .gitignore
└── .dockerignore
Verzeichnisstruktur (Express/Fastify-Beispiel)
my-api/
├── src/
│ ├── index.ts # Einstiegspunkt, Serverstart
│ ├── app.ts # Express/Fastify-Setup
│ ├── config.ts # Umgebungskonfiguration mit Zod-Validierung
│ ├── database.ts # Prisma-Client oder Drizzle-Konfiguration
│ ├── middleware/
│ │ ├── auth.ts
│ │ ├── error-handler.ts
│ │ └── request-logger.ts
│ ├── routes/
│ │ ├── health.ts
│ │ └── users.ts
│ ├── services/
│ │ └── user.service.ts
│ └── types/
│ └── index.ts
├── prisma/
│ └── schema.prisma
├── tests/
│ ├── setup.ts
│ └── routes/
│ └── users.test.ts
├── package.json
├── tsconfig.json
├── Dockerfile
├── docker-compose.yml
├── .env.example
└── .gitignore
Web-App-Projektvorlage
Verzeichnisstruktur (Next.js App Router)
my-app/
├── src/
│ ├── app/
│ │ ├── layout.tsx # Root-Layout
│ │ ├── page.tsx # Startseite
│ │ ├── loading.tsx # Globales Lade-UI
│ │ ├── error.tsx # Globaler Error Boundary
│ │ ├── not-found.tsx # 404-Seite
│ │ ├── globals.css # Globale Styles + Tailwind
│ │ ├── (auth)/
│ │ │ ├── login/page.tsx
│ │ │ └── register/page.tsx
│ │ ├── dashboard/
│ │ │ ├── layout.tsx
│ │ │ └── page.tsx
│ │ └── api/
│ │ └── health/route.ts
│ ├── components/
│ │ ├── ui/ # Wiederverwendbare Primitive
│ │ └── features/ # Funktionsspezifische Komponenten
│ ├── lib/
│ │ ├── db.ts # Datenbank-Client
│ │ ├── auth.ts # Auth-Helfer
│ │ └── utils.ts # Gemeinsame Hilfsfunktionen
│ └── types/
│ └── index.ts
├── public/
│ └── favicon.ico
├── tests/
│ ├── setup.ts
│ └── components/
├── next.config.ts
├── tailwind.config.ts
├── tsconfig.json
├── package.json
├── .env.local.example
└── .gitignore
CLI-Tool-Projektvorlage
Verzeichnisstruktur (Python / Typer)
my-cli/
├── src/
│ └── my_cli/
│ ├── __init__.py
│ ├── __main__.py # python -m my_cli Einstieg
│ ├── cli.py # Typer-App, Befehlsgruppen
│ ├── commands/
│ │ ├── __init__.py
│ │ ├── init.py # my-cli init
│ │ └── run.py # my-cli run
│ ├── config.py # Konfigurationsdatei-Laden (TOML/YAML)
│ └── utils.py
├── tests/
│ ├── conftest.py
│ └── test_commands.py
├── pyproject.toml # [project.scripts] Einstiegspunkt
├── .gitignore
└── README.md
Verzeichnisstruktur (Go / Cobra)
my-cli/
├── cmd/
│ ├── root.go # Root-Befehl, globale Flags
│ ├── init.go # my-cli init
│ └── run.go # my-cli run
├── internal/
│ ├── config/
│ │ └── config.go # Viper-Konfigurationsladen
│ └── runner/
│ └── runner.go # Kernlogik
├── main.go # Einstiegspunkt, ruft cmd.Execute() auf
├── go.mod
├── go.sum
├── Makefile
└── .gitignore
Bibliotheksprojekt-Vorlage
Verzeichnisstruktur (npm-Paket)
my-lib/
├── src/
│ ├── index.ts # Öffentliche API-Exporte
│ ├── core.ts # Kernimplementierung
│ └── types.ts # Öffentliche Typdefinitionen
├── tests/
│ └── core.test.ts
├── package.json # "type": "module", exports-Map
├── tsconfig.json # declaration: true, declarationMap: true
├── tsup.config.ts # Build-Konfiguration: cjs + esm
├── vitest.config.ts
├── .npmignore
├── .gitignore
├── CHANGELOG.md
└── LICENSE
Verzeichnisstruktur (PyPI-Paket)
my-lib/
├── src/
│ └── my_lib/
│ ├── __init__.py # Öffentliche API, __version__
│ ├── core.py
│ └── py.typed # PEP 561 Marker
├── tests/
│ ├── conftest.py
│ └── test_core.py
├── pyproject.toml # Build-System, Metadaten, Tool-Konfiguration
├── .gitignore
├── CHANGELOG.md
└── LICENSE
Monorepo-Vorlage
Turborepo + pnpm Workspaces
my-monorepo/
├── apps/
│ ├── web/ # Next.js Frontend
│ │ ├── src/
│ │ ├── package.json # hängt von @repo/shared ab
│ │ └── tsconfig.json # erweitert ../../tsconfig.base.json
│ └── api/ # Fastify Backend
│ ├── src/
│ ├── package.json
│ └── tsconfig.json
├── packages/
│ ├── shared/ # Geteilte Typen, Hilfsfunktionen, Validatoren
│ │ ├── src/
│ │ ├── package.json # "name": "@repo/shared"
│ │ └── tsconfig.json
│ ├── ui/ # Geteilte React-Komponenten
│ │ ├── src/
│ │ └── package.json # "name": "@repo/ui"
│ └── config/ # Geteilte Konfigurationen
│ ├── eslint/
│ ├── typescript/
│ └── package.json
├── turbo.json # Pipeline: build, test, lint
├── pnpm-workspace.yaml # packages: ["apps/*", "packages/*"]
├── package.json # Root devDeps: turbo
├── tsconfig.base.json # Geteilte TypeScript-Konfiguration
├── .gitignore
└── .npmrc
Cargo Workspaces (Rust)
my-workspace/
├── crates/
│ ├── my-core/ # Kernbibliothek
│ │ ├── src/lib.rs
│ │ └── Cargo.toml
│ ├── my-cli/ # CLI-Binärdatei
│ │ ├── src/main.rs
│ │ └── Cargo.toml # hängt von my-core ab
│ └── my-server/ # API-Binärdatei
│ ├── src/main.rs
│ └── Cargo.toml
├── Cargo.toml # [workspace] members = ["crates/*"]
├── Cargo.lock
├── .gitignore
└── rust-toolchain.toml
Checkliste für häufige Ergänzungen
Projekt-Setup abgeschlossen? Füge diese hinzu:
│
├─ Versionskontrolle
│ ├─ [ ] .gitignore (sprachspezifisch)
│ ├─ [ ] .gitattributes (Zeilenumbrüche, Binärdateien)
│ └─ [ ] Branch-Schutzregeln
│
├─ CI/CD
│ ├─ [ ] GitHub Actions Workflow (Test bei PR, Deploy bei Merge)
│ ├─ [ ] Matrix-Tests (Betriebssystem, Laufzeitversionen)
│ └─ [ ] Release-Automatisierung
│
├─ Docker
│ ├─ [ ] Multi-Stage-Dockerfile
│ ├─ [ ] docker-compose.yml (App + Datenbank + Cache)
│ ├─ [ ] .dockerignore
│ └─ [ ] Health-Check-Endpunkt
│
├─ Code-Qualität
│ ├─ [ ] Linter (ESLint, Ruff, golangci-lint, Clippy)
│ ├─ [ ] Formatierer (Prettier, Black/Ruff, gofmt, rustfmt)
│ ├─ [ ] Pre-Commit-Hooks (Husky, pre-commit)
│ └─ [ ] Typprüfung (TypeScript strict, mypy, go vet)
│
├─ Tests
│ ├─ [ ] Test-Framework konfiguriert (Vitest, pytest, go test)
│ ├─ [ ] Coverage-Berichterstattung
│ ├─ [ ] Test-Datenbank eingerichtet
│ └─ [ ] CI-Test-Pipeline
│
├─ Editor
│ ├─ [ ] .editorconfig
│ ├─ [ ] .vscode/settings.json
│ └─ [ ] .vscode/extensions.json
│
└─ Dokumentation
├─ [ ] README.md (Projektbeschreibung, Setup, Verwendung)
├─ [ ] CONTRIBUTING.md
└─ [ ] API-Dokumentation (OpenAPI, godoc, rustdoc)
Konfigurationsdatei-Vorlagen
.editorconfig (Universell)
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{py,rs}]
indent_size = 4
[*.go]
indent_style = tab
[*.md]
trim_trailing_whitespace = false
[Makefile]
indent_style = tab
pyproject.toml (Python)
[project]
name = "my-project"
version = "0.1.0"
requires-python = ">=3.12"
[tool.ruff]
target-version = "py312"
line-length = 88
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "SIM"]
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
[tool.mypy]
strict = true
tsconfig.json (TypeScript - Streng)
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
Häufige Fallstricke
| Fallstrick | Warum passiert es | Vermeidung |
|---|---|---|
| Falsche .gitignore für die Sprache | Generische Vorlage verwendet, sprachspezifische Einträge fehlen | Verwende gitignore.io oder GitHub-Vorlagen für deinen Stack |
| .env.example vergessen | Teammitglieder wissen nicht, welche Umgebungsvariablen benötigt werden | Erstelle .env.example mit jeder Variable (leere Werte) zu Projektbeginn |
| Lockfile nicht committet | Inkonsistente Abhängigkeitsversionen in verschiedenen Umgebungen | Committe package-lock.json, uv.lock, go.sum, Cargo.lock |
| Port/Host im Code hartkodiert | Funktioniert lokal, bricht in Docker/Cloud | Immer aus Umgebungsvariable lesen mit sinnvollem Standardwert |
| Tests an reale Datenbank gekoppelt | Tests schlagen fehl ohne laufende DB, CI-Setup ist komplex | Verwende Test-Container oder In-Memory-SQLite für Unit-Tests |
| Fehlender Health-Check-Endpunkt | Deployment-Orchestrator kann Bereitschaft nicht prüfen | Füge /health-Endpunkt hinzu, der Datenbankverbindung und andere Abhängigkeiten prüft |
Verwendung als KI-Agent
Wenn du als KI-Assistent zur Projekteinrichtung aufgefordert wirst:
- Frage nach dem Projekttyp (API, Web-App, CLI, Bibliothek, Monorepo)
- Entscheide anhand des Entscheidungsbaums über die Technologie
- Scaffolde mit den Schnellbefehlen oder Verzeichnisstruktur-Vorlagen
- Konfiguriere mit den Checklisten und Vorlagen
Die Verzeichnisstrukturen sind bewusst allgemein gehalten, sodass sie sich an jedes Framework anpassen lassen – passe sie nach Bedarf an.