How atulvermagithub/better-auth-complete-auth works
Project type and purpose
• This is a full-stack web application built on Next.js (React + server-side/edge functions).
• Its main domain is user authentication (sign-in, 2FA, password reset), organization/invite management, user profiles, and related workflows (email delivery, Stripe subscriptions).
File structure
• Top-level files: next.config.ts, docker-compose.yml, drizzle.config.ts, package.json, README.md, etc.
• src/app: Next.js “app router” pages and API routes under src/app/api/auth.
• src/app/auth, src/app/login, src/app/2fa, src/app/reset-password → authentication UIs.
• src/app/admin → admin UI.
• src/app/organizations, invites → org management UI.
• src/app/profile → user profile UI.
• src/components: shared React UI components (buttons, dialogs, tables).
• src/lib: library code for auth clients, OAuth providers, Stripe integration, email templates and delivery, utility functions.
• src/drizzle: Drizzle ORM setup and schema definitions for the database.
• Configuration: .env.example, docker-compose.yml (likely brings up the database), drizzle.config.ts.
README for additional insights
• Bootstrapped with create-next-app.
Detail
• Routes (e.g., /api/auth/[...all]) and their responsibilities.
• Drizzle schema folder feeding into the ORM layer.
• Call out the email templates and Stripe module in the business logic layer.