How hack-psu/check-in works
Project Type and Purpose
• This is a full-stack web application built with Next.js (app router) and React.
• It delegates authentication and data storage to Firebase and consumes various domain-specific REST endpoints via a custom API client.
File Structure
• src/app — Next.js pages and layouts (React UI entry points).
• app/layout.tsx sets up global layout and providers.
• Sub-directories (auth, judging, scan, manual, etc.) each expose a page.tsx.
• src/common
• /config — environment & Firebase initialization.
• /context — React context providers (AuthGuard, FirebaseProvider, LayoutProvider).
• /api — domain-specific modules (analytics, event, hackathon, judging, scan, etc.). Each has entity.ts, hook.ts (React hooks), provider.ts, and index.ts exports.
• /types — shared TypeScript types.
• src/components — shared UI pieces (e.g. BottomNavbar).
• src/lib — utility functions.
• Configuration files (.eslintrc.json, next.config.js, tailwind.config.ts, etc.) orchestrate build, linting, styling.
README
• Confirms a Next.js app bootstrapped via create-next-app.
• Mentions font optimization, dev scripts, Vercel for deployment.
• No in-repo backend; data is fetched via the API client to external services (likely a separate REST API or Firebase).
Main Components
a. Client Browser (User)
b. Next.js Frontend
• Pages & Layouts (React components under src/app)
• Shared Components & Utilities (src/components, src/lib)
• Context Providers (AuthGuard, FirebaseProvider)
• API Client Layer (src/common/api/*)
c. External Services
• Firebase (Authentication, Firestore/Realtime DB)
• External REST API(s) for analytics, events, judging, etc.
• Vercel CDN/Hosting
d. Data Flow & Interactions
• HTTP(S) requests from client → Next.js serverless functions (if any) or directly to external APIs.
• Auth flows via Firebase SDK.
• Static asset serving via Vercel CDN.
Architectural Patterns & Design Principles
• Component-based UI (React).
• Single unified layout wrapping nested pages (Next.js app router).
• Context-based dependency injection (AuthGuard ensures protected routes; FirebaseProvider initializes SDK).
• Modular API layer: each domain area has its own provider, hook, and entity definitions.
• Separation of concerns: UI (src/app + src/components), business/data logic (src/common/api + src/common/context), configuration (src/common/config).