How learningcampili/basic-auth works
Project type and purpose
• This is a full-stack web application built on Next.js (React) that provides user authentication, profile management, contact forms, and email workflows (confirmation, password reset).
• It uses Prisma as an ORM backed by a relational database (e.g., PostgreSQL), NextAuth for session management, a mailing library (in src/lib/mail.ts + JSX email templates), and Tailwind CSS for styling.
File structure
• Top-level:
• docker-compose.yml – brings up local services (database).
• prisma/ – schema and migrations for the database model.
• src/app/ – Next.js “app router” pages and API routes (server and client components).
• src/api/ – under app/api for NextAuth and email verification endpoints.
• src/components/ – reusable UI components (forms, navbar, avatars).
• src/actions/ – server-side business logic (auth, contacts, password resets).
• src/lib/ – helpers (Prisma client, mail sender, Zod schemas, utils).
• emails/ + src/templates/ – TSX templates for transactional emails.
• next.config.mjs, postcss.config.mjs, tailwind.config.ts, tsconfig.json – build and tooling config.
README for additional insights
• It’s a standard create-next-app scaffold, optimized for both server-rendered and static pages.
Elements
• Browser → Next.js UI
• Browser → API Routes → Actions → Prisma → DB
• Actions → Mail Service
• NextAuth → OAuth Providers
• Blue for UI layers,
• Green for business/data layers,
• Orange for external services.