Skip to content

Update and rename prompt to prompt.txt - #62

Draft
zyntromedia wants to merge 3 commits into
mainfrom
zyntromedia-patch-9
Draft

Update and rename prompt to prompt.txt#62
zyntromedia wants to merge 3 commits into
mainfrom
zyntromedia-patch-9

Conversation

@zyntromedia

Copy link
Copy Markdown
Member

Title: 60 Prompts for Building FastAPI Web Apps
Kicker: FastAPI development reference
Theme: Developer reference
Genre: memo

60 Prompts for Building FastAPI Web Apps

A complete reference of example prompts to build FastAPI web applications — from project scaffold to production deploy, integrations, and real-world apps.


Getting Started & Project Setup

  1. "Build a FastAPI web app with a clean project structure — app/main.py, routers/, models/, schemas/, and database.py."
  2. "Create a FastAPI project scaffold with requirements.txt, .env config, and a README with run instructions."
  3. "Set up a FastAPI app with CORS enabled for a React frontend running on a different port."
  4. "Add environment-based configuration to a FastAPI app — dev, staging, and prod settings via pydantic-settings."

Database & Models

  1. "Build a FastAPI app with SQLAlchemy models and a PostgreSQL database, including a migration setup."
  2. "Create a FastAPI CRUD API for a 'products' table — GET, POST, PUT, DELETE endpoints with proper Pydantic schemas."
  3. "Add async SQLAlchemy support to a FastAPI app using asyncpg for PostgreSQL."
  4. "Set up SQLite for local development and PostgreSQL for production in the same FastAPI app."

Authentication & Security

  1. "Add JWT authentication to a FastAPI app — login endpoint, token refresh, and protected routes."
  2. "Implement OAuth2 password flow with hashed passwords (bcrypt) for user signup and login in FastAPI."
  3. "Add role-based access control (admin/user) to FastAPI routes with dependency injection."
  4. "Secure a FastAPI API with API-key authentication for third-party clients."

Validation & Schemas

  1. "Build Pydantic schemas with validation for a user registration form — email format, password strength, and field constraints."
  2. "Add request/response models with nested serialization for a blog app — posts with author and comments."
  3. "Create a FastAPI endpoint that accepts file uploads with size and type validation."

Advanced Features

  1. "Add pagination, sorting, and filtering to a FastAPI list endpoint for a large dataset."
  2. "Build a background task system in FastAPI — run a job in the background and poll its status."
  3. "Add WebSocket support to a FastAPI app for real-time chat or live notifications."
  4. "Implement rate limiting on a FastAPI API to prevent abuse."
  5. "Add full-text search to a FastAPI app using PostgreSQL's built-in search features."

Testing & Quality

  1. "Write unit tests for FastAPI endpoints using pytest and TestClient."
  2. "Set up automated tests with a test database fixture that runs against a clean schema."
  3. "Add request logging and structured error handling to a FastAPI app."

Docs & Production

  1. "Customize FastAPI's auto-generated Swagger docs — add descriptions, tags, and examples to all endpoints."
  2. "Containerize a FastAPI app with Docker and docker-compose, including the database service."
  3. "Deploy a FastAPI app with Gunicorn + Uvicorn workers behind an Nginx reverse proxy."
  4. "Add health-check and readiness endpoints to a FastAPI app for Kubernetes or Docker health probes."
  5. "Set up automatic OpenAPI schema generation and versioned API routes (/v1, /v2)."

Real-World Examples (Batch 1)

  1. "Build a complete FastAPI todo app with a frontend — CRUD endpoints, SQLite, and a simple HTML/JS interface."
  2. "Create a FastAPI REST API for a small e-commerce store — products, orders, cart, and checkout endpoints."

Integrations & Third-Party Services

  1. "Build a FastAPI app that sends emails via SMTP — a contact form endpoint that renders an HTML template."
  2. "Create a FastAPI endpoint that uploads files to S3 (or a cloud bucket) and returns the public URL."
  3. "Add Stripe payment integration to a FastAPI app — create a checkout session and handle the webhook."
  4. "Build a FastAPI app that calls an external REST API (e.g. weather or news) and caches responses in Redis."
  5. "Add Google OAuth login to a FastAPI app with social auth and session persistence."

Async & Performance

  1. "Rewrite a slow synchronous FastAPI endpoint as async with httpx to make concurrent external calls."
  2. "Add Redis caching to a FastAPI app for expensive database queries with a TTL-based cache layer."
  3. "Build a FastAPI app that streams large files or data in chunks with StreamingResponse."
  4. "Add database connection pooling to a FastAPI app and explain how to tune pool size."
  5. "Implement a job queue in FastAPI using Celery or RQ — enqueue a task, track its status, and fetch results."

Data Processing & AI

  1. "Build a FastAPI app that accepts a CSV upload, processes it with pandas, and returns summary statistics as JSON."
  2. "Create a FastAPI endpoint that runs a machine-learning model (pickle/onnx) and returns predictions."
  3. "Add a text-summarization or sentiment-analysis endpoint to a FastAPI app using a Hugging Face model."
  4. "Build a FastAPI app that generates embeddings and stores them in a vector database (pgvector) for similarity search."
  5. "Create a FastAPI image-upload endpoint that resizes/compresses images with Pillow and stores them."

Templating & Frontend

  1. "Build a FastAPI app with Jinja2 templates — a server-rendered multi-page site with a base layout."
  2. "Add static files (CSS/JS/images) to a FastAPI app and wire them into Jinja templates."
  3. "Create a FastAPI app that serves a single-page React build from a dist/ folder."

Error Handling & Middleware

  1. "Add custom exception handlers to a FastAPI app — return structured JSON errors with proper HTTP codes."
  2. "Build a FastAPI middleware that logs every request with method, path, status, and duration."
  3. "Add request timing and a simple metrics endpoint (/metrics) exposing request counts and latencies."
  4. "Implement a global exception handler that catches unhandled errors and returns a safe 500 response."

Real-World App Examples (Batch 2)

  1. "Build a complete FastAPI blog — posts, comments, tags, and user authentication."
  2. "Create a FastAPI URL shortener with SQLite, collision-free slugs, and redirect tracking."
  3. "Build a FastAPI REST API for a library — books, authors, borrow/return, and overdue reports."
  4. "Create a FastAPI inventory system with stock levels, low-stock alerts, and supplier endpoints."
  5. "Build a FastAPI notes app with full CRUD, search, and per-user isolation."
  6. "Create a FastAPI API for a fitness tracker — workouts, exercises, sets, and progress charts data."

Advanced Production

  1. "Add OpenTelemetry tracing to a FastAPI app and export traces to a local Jaeger or Grafana stack."
  2. "Build a FastAPI app with feature flags, graceful shutdown hooks, and a --reload dev profile."

Signed-off-by: Zyntro <zyntro.ai.studio@gmail.com>
@zyntromedia zyntromedia self-assigned this Aug 21, 2026
@zyntromedia zyntromedia added dependencies การอัปเดตหรือจัดการ dependency ของโปรเจกต์ bug Something isn't working documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers invalid This doesn't seem right question Further information is requested performance ปัญหาหรือการปรับปรุงที่เกี่ยวข้องกับความเร็วและประสิทธิภาพของระบบ refactor การปรับโครงสร้างโค้ดโดยไม่เปลี่ยนพฤติกรรม release งานที่เกี่ยวข้องกับการเตรียมเวอร์ชันใหม่ discussion ใช้สำหรับประเด็นที่ต้องการการพูดคุย/ตัดสินใจร่วมกัน labels Aug 21, 2026
@zyntromedia zyntromedia added this to the Feature milestone Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependencies การอัปเดตหรือจัดการ dependency ของโปรเจกต์ discussion ใช้สำหรับประเด็นที่ต้องการการพูดคุย/ตัดสินใจร่วมกัน documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed invalid This doesn't seem right performance ปัญหาหรือการปรับปรุงที่เกี่ยวข้องกับความเร็วและประสิทธิภาพของระบบ question Further information is requested refactor การปรับโครงสร้างโค้ดโดยไม่เปลี่ยนพฤติกรรม release งานที่เกี่ยวข้องกับการเตรียมเวอร์ชันใหม่

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant