veda-backend-patterns

Designs FastAPI backend changes to prevent enum, routing, and migration bugs.

Updated Feb 17, 2026
One-click install
npx skills add https://github.com/VedaAstro/veda-skills --skill veda-backend-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: veda-backend-patterns
Source: https://github.com/VedaAstro/veda-skills/tree/main/veda-backend-patterns
Command: npx skills add https://github.com/VedaAstro/veda-skills --skill veda-backend-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you build and debug Veda backend code without repeating fragile patterns, preventing enum mismatches, route collisions, and inconsistent API responses.

Core Features & Use Cases

  • Endpoint Design: Create FastAPI routers with the correct dependency injection, response shape, and route order.
  • Data Modeling Safety: Use enums, services, serializers, and SQLAlchemy async patterns correctly to avoid silent bugs.
  • Migration and BFF Workflow: Apply Alembic migrations safely and proxy Next.js BFF requests to FastAPI with no stale caching.
  • Use Case: When adding a new booking endpoint, the Skill guides you to define the enum first, move shared logic into a service, and keep static routes ahead of dynamic ones.

Quick Start

Ask this Skill to review or implement your FastAPI change and apply the Veda backend patterns before you write or modify the code.

Frequently Asked Questions about veda-backend-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent route collisions in FastAPI when mixing static and dynamic endpoints?

To prevent route collisions in FastAPI, you must enforce static-before-dynamic route ordering. Placing fixed path segments ahead of parameterized routes ensures the router matches the correct endpoint first and avoids shadowing static paths.

What is the best way to structure SQLAlchemy async queries and shared logic in a FastAPI backend?

The best way to structure SQLAlchemy async queries is to extract shared logic into a dedicated service layer. Separating database operations from endpoint definitions ensures consistent API responses and prevents silent async bugs.

How do I apply Alembic migrations safely when modifying SQLAlchemy data models?

To apply Alembic migrations safely, follow a safe migration workflow that matches your SQLAlchemy model changes. This prevents database schema inconsistencies and ensures async queries perform against the correct table structure.

Why do my FastAPI endpoints return inconsistent API responses or fail silently due to enum mismatches?

FastAPI endpoints fail silently due to enum mismatches when values are not explicitly defined. Requiring explicit enum values in data modeling ensures correct serialization and prevents silent bugs across endpoint creation and service layers.

Does a Next.js BFF proxy route work with FastAPI without stale caching issues?

Yes, a Next.js BFF proxy route works with FastAPI without stale caching when configured correctly. Proxying requests to FastAPI while applying specific cache-bypassing patterns ensures data freshness.