TrueSpec

The Verified Spec Hub.

Browse verified specs — complete solutions with working code, env vars, and edge cases.

How It Works

Right Context.
Valid Build.
First Try.

Give your AI IDE verified, working code to reference — instead of letting it guess.

Search by task, language, or framework. Every spec is verified and ready to use as context.

Step 1 of 4
Find Spec
# You need OAuth 2.0 in your Next.js app.
# Instead of Googling and piecing together
# outdated blog posts, you search TrueSpec.
 
Spec #042: "OAuth 2.0 with NextAuth.js"
Tags: Auth, Next.js, OAuth
Assertions: 14/14 passed

Latest Specs

Intermediate

Next.js Google OAuth Login

Complete Google OAuth flow with NextAuth.js, token handling, session management

Auth & Identity
Beginner

Supabase Email/Password Auth

Sign up, sign in, password reset, and protected routes with Supabase Auth

Auth & Identity
Intermediate

JWT Authentication in Express.js

Access/refresh token pattern with middleware guards and secure cookie storage

Auth & Identity
Beginner

Firebase Auth with React

Google/GitHub sign-in, onAuthStateChanged listener, and route protection

Auth & Identity
Beginner

Clerk Auth in Next.js App Router

Drop-in auth with Clerk, middleware protection, and user metadata

Auth & Identity
Intermediate

Passwordless Magic Link Auth

Email magic link flow with Resend and custom token verification

Auth & Identity
Intermediate

GitHub OAuth with FastAPI

OAuth2 Authorization Code flow with token exchange and user profile fetch

Auth & Identity
Advanced

Role-Based Access Control (RBAC)

Role/permission system with middleware, database schema, and route guards

Auth & Identity
Advanced

Add 2FA/TOTP to Any App

TOTP with otplib, QR code generation, and backup codes

Auth & Identity
Intermediate

Secure Session Management with Redis

Express sessions with Redis store, expiration, and fingerprinting

Auth & Identity
Beginner

Prisma + PostgreSQL Full Setup

Schema design, migrations, seeding, CRUD operations, and relations

Database & ORM
Intermediate

Drizzle ORM with SQLite

Type-safe queries, schema push, migrations, and joins

Database & ORM
Beginner

MongoDB CRUD with Mongoose

Schema validation, virtuals, populate, indexes, and aggregation

Database & ORM
Intermediate

Supabase Row-Level Security

RLS policies for user-scoped data, admin bypass, and testing

Database & ORM
Intermediate

Redis Caching for API Responses

Cache-aside pattern, TTL, invalidation, and cache stampede prevention

Database & ORM
Advanced

Safe Database Migrations

Zero-downtime migration patterns, rollback strategies, and data backfills

Database & ORM
Intermediate

Full-Text Search in PostgreSQL

tsvector, tsquery, ranking, trigram similarity, and search indexing

Database & ORM
Beginner

SQLite for Desktop/Local Apps

better-sqlite3 setup, WAL mode, concurrent access, and performance tuning

Database & ORM
Advanced

Connection Pooling Done Right

PgBouncer, Prisma pool, Supabase pooler, and pool sizing formula

Database & ORM
Intermediate

TypeORM with NestJS

Entity setup, repositories, migrations, relations, and query builder

Database & ORM