Every premium and members-only resource for $9.99/month, as a no-commitment subscription. See the plans

PalateKit

Menu

Request a resource

Describe the resource you are missing in one sentence. We will email you when it is published.

0 / 280

Unlock PalateKit

Unlock everything

Plan

Paying means accepting our terms of sale.

Secure payment by Stripe. Receipts and invoices sent by email.

Welcome back

Sign in to install, download or save this resource. A free account is enough for free resources.

Production FastAPI layered architecture v1.0.0

Use this resource to design a production FastAPI service in layers: routers, services and repositories

New

  • 536 downloads
  • 126 likes
  • 215 saves

Free

Install with the CLI

In a terminal, from the folder you want:

npx --yes palatekit@latest install fastapi-layered-architecture-rule

First time: connect the CLI with

npx --yes palatekit@latest login

Cursor keeps the router, service, repository and ORM or HTTP layers separate: handlers of ten lines or fewer, authentication dependencies on protected routes, response_model on every endpoint, business logic in services, and no imports that go back up to routers.

Mostly picked by

Updated November 2, 2026

Card for “Production FastAPI layered architecture”

Details

Works in
Install guides
Generates with
Your agent's model
Licence
CC0-1.0

Similar resources

View all

What you get

  • The .mdc file (in English): layer, import and route rules for FastAPI
  • Good and bad router examples, including an idempotent charge endpoint

Good fit for

  • A payment or wallet API where writes must be protected
  • A team whose business logic currently lives in the routers

Not for

    Tags

    • fastapi
    • python
    • architecture
    • idempotency

    About

    You say

    “Move the billing logic out of the router into a service, with an idempotency key.”

    Card for “Production FastAPI layered architecture”

    Rule published by PatrickJS under the CC0-1.0 license, delivered in its original version.

    Show more

    How to use it

    1. Copy the .mdc file into your project's .cursor/rules/ folder
    2. Ask Cursor to design a production FastAPI service in layers: routers, services and repositories
    3. Adjust the rule to your conventions

    Content preview

    Files

    • fastapi-layered-architecture-rule.mdc8.3 KB
    • LICENSE6.5 KB
    • NOTICE-PALATEKIT.md0.6 KB

    Origin and licence

    Listed unmodified

    Author
    PatrickJS
    Source
    github.com/PatrickJS/awesome-cursorrules/blob/b044f956f021b6e8877f16781bcfc466a6a120e9/rules/fastapi-production-architecture-cursorrules-prompt-file.mdc
    Licence
    CC0-1.0

    Notice

    « fastapi-production-architecture-cursorrules-prompt-file » (PatrickJS, CC0-1.0) livré dans sa version d'origine : fiche en français et en anglais par PalateKit.

    User reviews

    –

    No ratings yet

    Loading reviews…

    Delete your review?

    Your rating and comment will be removed from the page.