How night3y3/event-ease-assignment works
Project Type and Purpose
• This is a full-stack web application (Next.js App Router) for event management, featuring role-based authentication, event creation/publishing, public RSVP forms, attendee tracking, CSV exports, and dashboards.
• Backend and frontend are co-located in a single Next.js monorepo, using TypeScript, Tailwind CSS + shadcn/ui, NextAuth.js for auth, Prisma ORM for PostgreSQL, and deployed on Vercel.
File Structure Analysis
• Top-level “app” directory holds:
• app/api/* – JSON API routes for admin actions, events, attendees, auth, exports
• app/dashboard/* – authenticated dashboard pages (SSR/SSG) for admins, staff, owners
• app/events/*, app/login, app/register, app/page.tsx – public and auth pages
• “components” contains reusable UI components and shadcn/ui primitives.
• “lib” has data-access functions, Prisma client, Auth providers, utilities, Google Calendar integration.
• “prisma” holds schema and migration SQL.
• “hooks” and “styles” provide custom hooks and global Tailwind CSS config.
Main System Components
• Client Browser (React + Next.js pages & client components)
• Next.js Server (App Router SSR handlers + API route handlers)
• Auth Service (NextAuth.js endpoints, secure sessions, role checks)
• Business Logic Layer (lib/actions.ts, lib/data.ts, form handlers)
• ORM Layer (Prisma client)
• Database (PostgreSQL)
• External Services
• Google Calendar API (lib/google-calendar.ts)
• Email provider (NextAuth’s email adapter, if configured)
• Hosting/Deployment (Vercel)
Component Relationships & Data Flow
• Browser → HTTP(S) → Next.js Server
• Navigates to SSR pages (dashboard, events, public pages)
• Submits form data to app/api routes (register, login, RSVP, exports)
• Next.js Server (API handlers) → Prisma ORM → PostgreSQL
• Next.js Server (Server Components) → lib/* → database or external APIs
• NextAuth.js middleware intercepts auth calls, reads/writes secure cookies, consults Prisma for user/session records
• Export routes generate CSV, stream back to client
• Google Calendar integration invoked from server code, syncing events externally
Architectural Patterns & Design Principles
• Monolithic full-stack using Next.js App Router (co-located front/back code)
• Clear separation between:
• Presentation (React components in “components” & “app”)
• Business logic (“lib/actions.ts”, “lib/data.ts”)
• Data persistence (Prisma + PostgreSQL)
• Role-based access control enforced at API route level and in page layouts
• Reusable UI primitives via shadcn/ui for consistency
• Utility hooks for cross-cutting concerns (use-mobile, use-toast)