Skip to main content
George Khananaev
Case Study

PyNextStack: a full-stack user management starter

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

Inside the project

1 / 2 · Interface preview

PyNextStack public demo sign-in interface

PyNextStack public demo sign-in interface

Open image

Overview

PyNextStack is a starter kit for full-stack applications that need user accounts. It pairs a FastAPI backend with a Next.js frontend, handles registration, authentication, password reset, profile management, and email verification out of the box. The goal is to get to your first real feature on day one.

The problem it solves

Every new product I start spends the first week rebuilding the same user-management layer. Registration, login, session, password reset, email verification, profile pages, admin. It is all commodity work, none of it is product-differentiating, and most of it has subtle security pitfalls. PyNextStack captures the pieces I'd write anyway so I can skip straight to the part that actually matters.

What is included

  • FastAPI backend with JWT auth, password hashing (bcrypt), email verification, and password reset flows
  • Next.js frontend with typed API client, protected routes, and Material-UI components
  • Database layer abstracted so you can swap PostgreSQL, MySQL, or MongoDB
  • Email layer pluggable for SendGrid, AWS SES, SMTP, or local testing
  • Admin area with user list, role management, and audit log
  • Docker Compose for local development with hot reload on both ends

Design choices worth highlighting

The frontend and backend communicate through a typed API client generated from the FastAPI OpenAPI schema. That means when you change a backend endpoint, the TypeScript types update automatically and the frontend breaks with a compiler error. No runtime drift between the two.

Auth uses short-lived access tokens (15 minutes) paired with long-lived refresh tokens (7 days, httpOnly cookie). The access token lives in memory, the refresh token is invisible to JavaScript. This is the sweet spot between developer ergonomics and security.

Tech stack

Python, FastAPI, Pydantic, SQLAlchemy or Motor (depending on DB), Next.js App Router, React, TypeScript, Material-UI, Docker, and GitHub Actions for CI.

Takeaway

Starter kits earn their keep when they embody opinions. PyNextStack is opinionated on purpose: short-lived JWTs, refresh tokens in httpOnly cookies, typed API client, Material-UI as the component library. If your product has different needs, fork it. If it doesn't, use it and ship.

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
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 Dark Theme Auth FastAPI Server
Dark-themed Swagger UI from the FastAPI starter repository, showing an interactive documentation example1 images
Public projectGitHub

Dark Theme Auth FastAPI Server

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

A versatile FastAPI server template with authentication-protected endpoints, Redis caching, structured logging, and a custom dark theme for the API documentation. A solid foundation for production APIs that want opinions baked in from day one.

fastapipythonredisauthentication+1 more
2 min read10
Explore project