Full-stack auth, RBAC, billing, and admin — in one npm install.
Under 10 minutes to your first login screen. 0 lines of auth code to write.
The MVP handles auth, sessions, roles, audit, themes, and billing. You write the code that makes your app different.
You write: components, pages, business logic, custom API routes. Everything else is inherited from the MVP framework.
Under 10 minutes if you have the env vars. Under 30 if you're setting up a new IDP tenant.
npm install @payez/next-mvpOne package. Everything you need.
Set 4 env varsVIBE_API_URL, VIBE_CLIENT_ID, VIBE_CLIENT_SECRET, NEXTAUTH_SECRET
Add middleware.tsOne import: createSlimMiddleware from @payez/next-mvp
Add providers.tsxSessionProvider + LoginRecorderProvider + ThemeProvider
Add auth routeapp/api/auth/[...nextauth]/route.ts — one import, auto-discovers OAuth providers
npm run devLogin screen, session management, theme switcher, admin dashboard — running.
After step 6 — you have a login screen, session management, theme switcher, and a full admin dashboard with Users, Sessions, Audit, Logs, and Roles tabs. First protected route? Add one line to the middleware publicRoutes array. The admin panel is already at /admin.
vibe_app schema — your foundationEvery app gets these 9 tables in the vibe_app schema. PostgreSQL with JSONB columns where flexibility matters. All tables have created_at/updated_at. All foreign keys cascade properly.
usersCore user record — id, email, display_name, created_at. The single source of truth for identity across all schemas.
user_rolesRole assignments — user_id FK to users, role_name, assigned_by, assigned_at. Powers the RBAC middleware.
rolesRole definitions — name, description, is_system. System roles are immutable; custom roles are yours.
sessionsActive session tracking — user_id, token, IP, user_agent, expires_at. Redis-backed distributed sessions.
audit_logEvery admin action logged — who, what, when, target_user, details (JSONB). Compliance-ready from day one.
organizationsMulti-tenant org support — name, slug, settings (JSONB). Built-in multi-tenancy without any wiring.
org_membershipsUser-to-org mapping — user_id, org_id, role. Users can belong to multiple orgs with different roles.
page_permissionsRoute-level RBAC — route_pattern, required_roles, requires_2fa. Per-route access control and 2FA enforcement.
app_settingsKey-value config store — key, value (JSONB), updated_by. Runtime configuration without redeployment.
Built on VibeSQL — full PostgreSQL 16 over HTTP. Read the VibeSQL docs →
Every item below is working, tested, and wired into the MVP. You don't configure it. You don't maintain it. It's there when you npm run dev.
OAuth/OIDC login flow via federated IDP — Google, GitHub, or any custom provider. Auto-discovered from the IDP.
Learn more →Token lifecycle, location tracking, concurrent session limits. Redis-backed for distributed deploys.
Learn more →Middleware checks roles on every route. System roles + custom roles. No manual auth checks in your code.
Learn more →Full admin UI — Users, Sessions, Audit, Logs, Roles tabs. Works out of the box with your data.
Learn more →Light/dark mode with persistence — localStorage + Redis for cross-device sync. No setup required.
Learn more →Structured audit trail for compliance. Every admin action, every state change, logged with full context.
Learn more →Middleware validates JWT + role on every API call. Your routes are protected by default, not by choice.
Learn more →Checkout, webhook handling, credit management with optimistic locking. Server-side subscription lifecycle.
Learn more →Free/Premium/Ultimate with configurable limits per feature. Built-in upgrade prompts and enforcement.
Learn more →Per-route 2FA requirements via the page_permissions table. Sensitive routes can require step-up auth.
Learn more →vibe-app-logger for structured app logs + audit logs. Visible in the admin dashboard. Graylog-ready.
Learn more →Configurable per-route rate limits. Protects your API from abuse without any configuration.
Learn more →Create your own PostgreSQL schema namespace. Every table that references a user uses REFERENCES vibe_app.users(id). One source of truth. No sync jobs.
When you create app-specific tables (e.g. ideal_resume), they live in their own PostgreSQL schema namespace. Your tables reference vibe_app.users(id) — the developer never manages user identity. It's inherited.
Custom tables are accessed via the Vibe API: GET /v1/data/{schema}/{table}. On the frontend: fetch('/api/vibe/data/ideal_resume/resumes'). The API handles auth, pagination, and filtering — you just query.
-- Your app's schema namespace
CREATE TABLE ideal_resume.resumes (
id SERIAL PRIMARY KEY,
user_id INTEGER REFERENCES vibe_app.users(id),
name TEXT,
file_data JSONB,
score INTEGER,
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Frontend access (auth handled automatically)
-- fetch('/api/vibe/data/ideal_resume/resumes')
-- Or direct Vibe API
-- GET /v1/data/ideal_resume/resumes?user_id=eq.42
-- The FK means: no separate user table,
-- no mapping, no sync. One source of truth.AI agents can scaffold, customize, and deploy apps on this framework. The MVP is structured so an agent never has to implement auth, sessions, roles, or audit — it just builds features.
The MVP turns “build a SaaS app” into “build the features that make your app unique.” Whether the builder is a human developer or an AI agent, the contract is the same.
10K MAU free. Auth, RBAC, audit, billing, admin dashboard — all included. Custom schemas from day one. No credit card required.