Skip to main content
George Khananaev
Open Source

Dark Theme Auth FastAPI Server

A FastAPI template with auth-protected endpoints, Redis, logging, and a custom dark-themed docs UI

Inside the project

1 / 1 · Dark Swagger UI

Dark-themed Swagger UI from the FastAPI starter repository, showing an interactive documentation example

Dark Swagger UI screenshot from the public repository.

Open image

Overview

Dark Theme Auth FastAPI Server is a starter template for production FastAPI applications. It bundles authentication, Redis caching, structured logging, and a custom dark-themed Swagger UI into a single repo you can clone, rename, and start building on top of.

What it gives you

  • JWT authentication with login, token refresh, and role-based access control
  • Redis integration for caching, rate limiting, and session storage
  • Structured logging with request IDs, response times, and trace correlation
  • Dark-themed docs — the Swagger UI is rebranded with a custom CSS that is easier on the eyes during long debugging sessions
  • Health check and metrics endpoints ready for Kubernetes liveness/readiness probes
  • Docker Compose for local development
  • Pytest setup with fixtures for auth and DB isolation

Design choices

The template is opinionated on purpose. JWT uses RS256 asymmetric signing so the signing key never leaves the auth service. Redis is mandatory — not optional — because production apps that "maybe need caching later" always end up bolting it on in a rush. Logging is structured JSON because grep on structured logs is a thousand times more productive than grep on free text.

Tech stack

Python 3.11+, FastAPI, Pydantic v2, Redis, Docker, pytest, and Uvicorn with workers for production. Also ships with a GitHub Actions workflow for CI (test + lint + type-check).

When to use this

Reach for this template when starting a new API service that needs to be production-ready quickly. It is not a framework and not a library — it is a shape you fill in. Fork it, delete the example routes, add your own, and ship.

Takeaway

A good template saves a day on every new project. This one captures the decisions I would otherwise make from scratch each time, so I can focus on the part that is actually novel.

Read FastAPI DocShield: protect your API docs with one line
FastAPI DocShield project illustration1 images
Public projectGitHub

FastAPI DocShield: protect your API docs with one line

HTTP Basic Auth on the OpenAPI docs endpoints for FastAPI

A tiny FastAPI extension that adds HTTP Basic Authentication to the Swagger UI, ReDoc, and OpenAPI JSON endpoints. Drop it in, set a username and password, and your API docs are no longer public. Useful when you want docs in production but not publicly indexable.

fastapipythonsecurityauthentication
2 min read14
Explore project
Read PyNextStack: a full-stack user management starter
PyNextStack public demo sign-in interface2 images
Public projectGitHub

PyNextStack: a full-stack user management starter

FastAPI backend, Next.js frontend, auth and profiles out of the box

A full-stack user management system with a Next.js frontend and FastAPI backend. Registration, authentication, profile management, and a Material-UI interface. Production-ready defaults so you can focus on your actual product instead of rebuilding the login form.

fastapinextjspythontypescript+2 more
2 min read25
Explore project
Read Travel Panel: Enterprise Platform & Leadership
Moon Holidays public website, representing the organization rather than its private application1 images
Commercial workConfidential

Travel Panel: Enterprise Platform & Leadership

Confidential commercial work · public purpose and technologies

A public overview of Travel Panel, George’s engineering leadership, and organizational AI and automation work. Internal implementation stays private.

pythonfastapitypescriptnextjs+11 more
2 min read
Read overview