How kpcreative/event-organiser works
Project type and purpose
• This is a Next.js full-stack web application using the App Router (v13+) for server-side rendering (SSR), static generation (SSG), nested layouts, and middleware (authentication gating). It’s bootstrapped via create-next-app and styled with Tailwind CSS.
File structure
• Top-level directories/files:
• app/ – The App Router, containing nested route segments: (auth) (sign-in, sign-up) and (root) (main pages).
• components/ – Shared UI components (Header, Footer, MobileNav, NavItems) and lower-level UI primitives (ui/button.tsx, ui/separator.tsx, ui/sheet.tsx).
• lib/ – Utility functions (utils.ts).
• constants/ – Shared constants, e.g. configuration values.
• middleware.ts – Next.js middleware for request interception (e.g. auth checks).
• Config files: next.config.ts, postcss.config.js, tailwind.config.ts, tsconfig.json.
• Global styling: app/globals.css.
README for additional insights
• Confirms Next.js, use of next/font, Vercel deployment. No backend API routes defined, so backend logic lives in server components and middleware.
a. Main components
• Client (Browser)
• Next.js Server (App Router + Middleware)
• React Server Components (pages under app/)
• React Client Components (UI primitives and shared components)
• Build & Styling Pipeline (Tailwind CSS, PostCSS)
• External Services (e.g. Vercel for fonts & hosting)
b. Relationships and interactions
1. User’s browser sends HTTP request → Next.js Server
2. Request passes through middleware.ts (e.g. auth guard)
3. Routing via app/ segments:
• Auth routes under (auth) → Sign-in / Sign-up pages
• Root layout under (root) → Primary pages
4. Server components render markup (SSR/SSG), fetching any server-side data (if any).
5. React client components hydrate on the browser, using shared UI primitives.
6. CSS pipeline (Tailwind → PostCSS → final CSS) applies styles.
7. Static assets served from /public.
8. External calls (e.g. font optimization via next/font on Vercel).
c. Architectural patterns & design principles
• Next.js App Router with nested layouts & server components
• Separation of concerns: layouts, pages, shared UI, low-level UI primitives
• Utility and constants layers for business logic and config
• Middleware for cross-cutting concerns (authentication)
• Tailwind + PostCSS for design system consistency
d. Relevant technologies
• Next.js (App Router, SSR/SSG)
• React Server & Client Components
• Tailwind CSS, PostCSS
• TypeScript
• Vercel (font optimization, hosting)