AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL unreviewed MIT Self-run

Backend Fastapi

skill-freddy-schuetz-hackathon-n8n-starter-backend-fastapi · by freddy-schuetz

Stack und Muster für ein eigenes Python-Backend (Muster B — Compute-/DB-/Geo-Service via FastAPI + Docker). Verwenden beim Bauen/Erweitern/Deployen eines eigenen Backends, wenn n8n nicht reicht (schwere Rechen-/DB-/Geo-Logik, Routing, Raster), bei FastAPI, uvicorn, Dockerfile oder psycopg/Postgres-DSN. Lauffähiges Beispiel: backend-example/.

No reviews yet
0 installs
40 views
0.0% view→install

Install

$ agentstack add skill-freddy-schuetz-hackathon-n8n-starter-backend-fastapi

Open-source listing, not yet scanned by AgentStack. Follow the source repository for install instructions.

Security review

⚠ Flagged

1 finding(s); flagged for manual review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures
  • high Destructive filesystem operation.

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Reliability & compatibility

Not yet reviewed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Backend Fastapi? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

FastAPI-Backend bauen & deployen (Muster B)

Service-Seite der Backend-Eskalationsleiter aus frontend-build. Lauffähiges Referenz-Beispiel in diesem Repo: backend-example/ — Stack von dort kopieren statt neu erfinden. Die Frontend-/Proxy-Seite (/api-Rewrite, BACKEND_URL) steht in frontend-build (Muster B), hier nur der Service.

Wann (n8n bleibt #1)

Erst Muster A — n8n versuchen. FastAPI nur, wenn eigene Rechen-/DB-/Geo-Logik n8n sprengt:

  • Routing/Graphen (pgRouting/PostGIS), Höhenmodelle/Raster (rasterio/DEM), schwere Geometrie (shapely), eigene ML-/Rechenlogik.

Stack

| Bereich | Festlegung | |---------|-----------| | Sprache | Python 3.12 | | Framework | FastAPI (fastapi>=0.110) + uvicorn (>=0.29) | | DB-Client | psycopg[binary] (v3) → Postgres (+ optional pgRouting/PostGIS) | | Geo (optional) | rasterio (DEM/GeoTIFF — Wheels bündeln GDAL, kein System-GDAL nötig), shapely, numpy | | AI (falls nötig) | Anthropic direkt via ANTHROPIC_API_KEY (gleicher Key wie Frontend-Muster-C) | | Container | Docker (Image auf beliebigem VPS lauffähig) |

Struktur (aus backend-example/)

backend/
  app/
    main.py            # FastAPI-App: app = FastAPI(title="…", version="…"), Routes
    core/              # Domänen-/Rechenlogik
    data_sources/      # externe Adapter (APIs, Dateien, …)   [optional]
    __init__.py
  requirements.txt
  Dockerfile
  .dockerignore
  data/                # Cache → Docker-VOLUME, NICHT committen   [optional]

Dockerfile-Baseline

FROM python:3.12-slim
WORKDIR /app
# nur nötige System-Libs (z.B. für rasterio/GDAL-Wheels) + TLS-Roots
RUN apt-get update && apt-get install -y --no-install-recommends \
        libexpat1 ca-certificates \
    && rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir --upgrade pip
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app ./app
EXPOSE 8080
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]

Konventionen

  • Port 8080 im Container (= Proxy-Kontrakt mit Next: frontend/next.config rewritet /api/*http://127.0.0.1:8080 lokal bzw. BACKEND_URL-Subdomain in Prod).
  • /health-Endpoint liefert {"status": "ok", …} — für Reverse-Proxy/Smoke-Test.
  • DB per Env-DSN, nie hardcoden: ein _dsn()-Helfer liest os.environ["_DB_DSN"], dann psycopg.connect(_dsn()).
  • Secrets/Tokens ausschließlich über os.environ (z.B. ANTHROPIC_API_KEY, Drittanbieter-Keys) — nie im Code, nie im Image.
  • Explizite Versionen in requirements.txt; Geo-Stack über Wheels (kein System-GDAL).

Deploy

  • Docker-Image bauen und auf einem VPS laufen lassen, hinter einem Reverse-Proxy mit TLS (eigene Subdomain). Env-Vars (DSN, API-Keys) am Container setzen, nicht im Image.
  • Nach Deploy: GET /health der Subdomain prüfen, dann einen echten Endpoint gegen den Happy-Path.
  • Hinweis: FastAPI-Backends laufen nicht auf Vercel-Serverless — dafür einen eigenen Host/VPS nutzen (Frontend bleibt auf Vercel).

Neues Backend starten

backend-example/ kopieren, app/main.py (title/version) und requirements.txt anpassen, eigenen _DB_DSN definieren (falls DB). Frontend-Anbindung (/api-Rewrite) → Skill frontend-build (Muster B).

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.