How nonsouddy/sir_john_spelling_bee works
Project type and purpose
• This is a full-stack Next.js 13 application (using the App Router) that serves both a public website (marketing pages, blog, resources, FAQ, contact, registration, etc.) and an authenticated administration panel (contestant/event/material/staff management).
• It integrates with:
• A relational database via Prisma (likely PostgreSQL)
• Sanity.io as a headless CMS for blog posts and possibly other content
• File storage for uploads (images, materials) served from the public folder or a cloud provider
• Email service for registration/payment confirmations
• Built-in Next.js route-handlers (app/api) and React Server Actions (actions/server)
File structure
• “app/” holds the Next.js App-Router pages and layouts. Under “(root)” are public pages; under “(Admin)” are admin pages.
• “app/api/” contains Next.js route-handler endpoints (REST-style serverless functions).
• “actions/fetch/” are client-side fetch wrappers for API calls; “actions/server/” are React Server Actions for mutations.
• “components/” holds reusable React UI components (grouped by feature).
• “lib/” contains utility modules: prisma client, token handling, email templates, formatting, etc.
• “prisma/” holds the schema and migrations.
• “sanity/” contains the Sanity studio config, schemas, and client.
• “app/schemas” uses Zod schemas for data validation.
• “assets/” and “public/” serve static CSS, images, SVGs.
Details
• Include:
• Next.js App Router layouts (root vs Admin)
• app/api route-handlers vs actions/server
• Fetch wrappers (actions/fetch)
• Prisma → schema.prisma
• Sanity Studio & schemas
• Static asset directory
• Middleware layer (middleware.ts) for auth
• This level of granularity ensures every architectural element is represented.
• Don’t hesitate to break out sub-components (e.g., Email Service vs Token Service vs File Storage) for clarity.