ysskrishna logoysskrishna

FastAPI Supabase Starter

Clone once. Your Python API already checks Supabase tokens before protected routes run.

Get it
Built with
Starter Kits & Boilerplates
Auth & Security
Backend & APIs
FastAPI
Supabase
SQL
SQLAlchemy
SQLite
Python
uv
JWT
Details
FreeMIT licenseCreated June 3, 2025Updated November 19, 2026
Share this product

You fixed sign-in. Now the API has to believe the token.

Your users authenticate with Supabase. Your backend still needs to read that access token, reject bad requests, and keep user rows in step. On a new project, that work eats the first day: secret config, validation, a protected handler or two, something to test with.

FastAPI Supabase Starter hands you that plumbing so you extend routers instead of reinventing guards.

Validate once. Protect every route.

What you get

  • Protected handlers that expect a Supabase token. Incoming requests with a valid JWT can reach user routes. Bad or missing tokens do not.
  • User create and profile fetch already sketched. Documented endpoints let you create a user row from the token payload and read back the signed-in user.
  • A local database to start. SQLite runs out of the box, with room to point at another database when you are ready.
  • Interactive API docs for smoke tests. Open the built-in docs URL on your machine and exercise routes without writing a separate client first.
  • Cross-origin requests enabled. Browser frontends on another origin can call the API while you wire the UI.
  • Free and open source. MIT licensed. Bring your own Supabase project and credentials.

Your first morning after cloning

For example, you paste project credentials into the environment template, install dependencies the way the repository describes, and start the dev server. You sign in through Supabase the way you already do, copy the access token, and call the documented user routes with that token in the header. The protected path responds. You add your first real business route beside the sample user handlers.

Ready to try it?

Frequently asked questions

Do I need my own Supabase project?

Yes. You supply the project identifier, JWT secret, and database URL from your Supabase settings. Clients send the access token as a bearer token when calling protected routes.

What endpoints come with the starter?

The repository documents user management routes to create a user in the database using the Supabase JWT payload and to fetch the current user details, both requiring a valid Supabase JWT.

How do I run it on my machine?

The repository documents a uv workflow to create a virtual environment and sync dependencies. You start the application with the entry point described there. The dev server listens on localhost port 8000, and interactive API docs are on the docs path.

How does JWT protection work here?

The project integrates Supabase JWT authentication with automatic token validation and parsing, protected route handling, and HS256 as described in the repository. You obtain tokens through Supabase Auth on the client or via Supabase's auth APIs, then pass them to this API.

Why not let the frontend talk to Supabase only?

For many apps that is enough. When you need custom logic, server-side checks, or a stable HTTP API in Python, you still want a backend that validates the same tokens. This starter is for that middle layer, not for replacing Supabase Auth.

Why not wire JWT validation myself?

You can. This repository is for skipping repeated layout: configuration helpers, validation utilities, sample user routes, and docs you would otherwise copy from project to project.

Is it production-ready as shipped?

No. The product page and README frame it as starter plumbing for prototyping, learning route guards, and quick experiments. HTTPS, secret handling, claim checks, and anything beyond the sample routes remain your responsibility.

Is it free?

Yes. It is open source under the MIT license.

Continue exploring

ProductNextjs Supabase Starter

Nextjs Supabase Starter

Protected sign-in and a dashboard shell on Supabase, ready to fork before you build features.
Auth & Security
Starter Kits & Boilerplates
+7
ProductFastAPI Clerk Starter

FastAPI Clerk Starter

A FastAPI API with Clerk JWT checks and user routes ready on day one.
Auth & Security
Backend & APIs
+8
BlogCover image for How Microservices Verify JWTs Without Calling the Auth Service

How Microservices Verify JWTs Without Calling the Auth Service

Auth & Security
Backend & APIs
+1
8 min read
ProductFastAPI Nextjs Clerk Starter

FastAPI Nextjs Clerk Starter

Sign-in in the browser, checked tokens on your Python API, without a week of auth wiring.
Auth & Security
Backend & APIs
+9
ProductFastapi Sync Async Starter Template

Fastapi Sync Async Starter Template

Start your FastAPI service with sync and async database patterns wired, tested, and ready to run in Docker.
Backend & APIs
Starter Kits & Boilerplates
+8
ProductFastAPI UV vs Requirements File

FastAPI UV vs Requirements File

Two Docker builds, one FastAPI app. Compare packaging paths on your machine.
DevOps & Infrastructure
Backend & APIs
+6