How kodeinkgp-technology-web-3-0-society/kik-nextjs works
1. Overall shape
- This is a Next.js App Router site for the KodeinKGP student society.
- The repository combines a public marketing/content site with several interactive subsystems: deKodeX, PDS practice/lab, articles, events, leaderboard, auth/registration, and team pages.
2. Front-end composition
- UI is split between src/Components/ and route-level page files under src/app/.
- src/Components/ holds reusable presentation blocks such as the navbar, footer, landing sections, auth forms, loaders, buttons, cards, and deKodeX-specific UI.
- src/app/ provides the actual routed screens and stitches those components together.
3. Routing and page boundaries
- The top-level routes include landing/home, articles, events, teams, tech-triad, auth, registration, summary, leaderboard, PDS, and deKodeX.
- Dynamic routes are used where content is indexed by an identifier, especially:
- src/app/dekodeX/[QuestionID]/
- src/app/leaderboard/[page]/
- src/app/pds/lab/[topic]/[subTopic]/[ind]/
- This indicates a content-driven UI where each route is backed by structured data rather than hardcoded screens.
4. deKodeX challenge system
- src/app/dekodeX/ is the most application-like subsystem.
- It includes a problem arena, modal dialogs, leaderboard view, per-question pages, and loading states.
- Supporting API routes handle the challenge lifecycle: auth, question retrieval, submission, leaderboard, Turnstile verification, and certificate issuance/checking.
5. Backend boundary and external services
- src/backend/firebase.js and src/backend/firebaseAdmin.js show a split between client Firebase usage and server/admin Firebase access.
- requireAuth.js and middleware.js suggest route-level protection for authenticated flows.
- The use of Cloudflare Turnstile is explicit via verifyTurnstile, indicating bot protection on sensitive endpoints like submission/auth.
6. Data model and content sources
- Much of the site is data-driven from JSON and static files in src/data/ and public/data/.
- src/data/ contains curated content for articles, events, teams, animations, and PDS question banks.
- public/data/ and public/testcases.json appear to store challenge inputs, outputs, or downloadable artifacts used by deKodeX/PDS features.
- This means the app often renders from local structured content instead of a remote CMS.
7. PDS subsystem
- src/app/pds/ is a separate learning/practice area with theory and lab sections.
- The lab section is hierarchical and topic/subtopic-driven, with components for lab cards, questions, subtopics, and a login modal.
- This subsystem likely serves problem-solving content from local JSON question banks and is distinct from deKodeX in both UX and content structure.
8. Articles and media
- src/app/articles/ and public/article support article browsing with animation wrappers and related data files.
- The project uses Lottie animations heavily, with JSON assets in src/data/animations/ and article-specific animation metadata in src/data/articles/.
- Static images for events and articles are stored under public/, keeping rich media separate from code.
9. Authentication and user state
- src/app/auth/ and src/Components/Auth/ implement sign-in/sign-up UI.
- src/contexts/authContext.jsx plus src/hooks/useAuthToken.js indicate shared client-side auth state and token handling.
- src/backend/requireAuth.js and protected API routes show that auth is enforced both in the UI and on the server side.
10. Operational tooling and migration
- The backup/ folder contains a Firestore migration script, suggesting an earlier or ongoing data migration path.
- src/backend/runtimeCache.js implies server-side caching for performance or rate-sensitive lookups.
- netlify.toml shows the app is intended to deploy on Netlify, even though it is built with Next.js.
11. Styling and build setup
- Styling uses Tailwind CSS with supporting PostCSS and global CSS.
- next.config.mjs, tailwind.config.js, and eslint.config.mjs define the build/runtime and code-quality boundaries.
- The codebase is organized as a typical Next.js application with static assets in public/, app routes in src/app/, and shared logic in src/backend/ and src/contexts/.
12. How data flows through the system
- Static content and JSON are loaded into route components for most public pages.
- Interactive features such as deKodeX and auth move through API routes, which then access Firebase/admin services and return computed state such as validation, submissions, leaderboard data, or certificates.
- The architecture is therefore a mix of static content delivery and server-backed interactive workflows centered around Firebase.
Main entry points: route.js deKodeX API · layout.jsx Root Layout · app/page.jsx Home · pds/page.jsx PDS Home
Components 30
App Shell
Next.js App Router entrypoints and global styling.
- Root Layout · Global app wrapper and shared document structure.
src/app/layout.jsx
Public Site
Marketing and content-facing routes.
- Home · Top-level public landing page.
src/app/page.jsx - Articles · Article browsing and animated article views.
src/app/articles/page.jsx - Events · Event listing and showcase page.
src/app/events/page.jsx - Teams · Team roster and role pages.
src/app/teams/page.jsx - Tech Triad · Standalone informational page.
src/app/tech-triad/page.jsx
deKodeX
Interactive challenge and submission subsystem.
- deKodeX Home · Main challenge arena entry point.
src/app/dekodeX/page.jsx - Problem Arena · Interactive question and submission workspace.
src/app/dekodeX/ProblemArena.jsx - Question Page · Per-question deKodeX page for a question identifier.
src/app/dekodeX/[QuestionID]/page.jsx - Leaderboard · Rankings view for challenge users.
src/app/leaderboard/page.jsx - deKodeX API · Challenge auth, questions, submissions, leaderboard, and certificates.
src/app/dekodeX/api/auth/route.js
PDS
Practice and lab learning subsystem.
- PDS Home · Practice-and-lab entry page.
src/app/pds/page.jsx - PDS Lab · Topic-driven lab navigation and question flow.
src/app/pds/lab/page.jsx - PDS Theory · Theory content page for the PDS area.
src/app/pds/theory/page.jsx
Platform
Auth, backend services, and shared UI.
- Navbar · Primary navigation across the site.
src/Components/Header/navbar.jsx - Landing · Home-page hero and featured sections.
src/Components/Landing/landing.jsx - Footer · Site-wide footer component.
src/Components/Footer/footer.jsx - Auth Page · Sign-in and sign-up screen.
src/app/auth/page.jsx - Registration · Application or event registration flow.
src/app/regform/page.jsx - Summary · Post-registration summary and confirmation.
src/app/regsummary/page.jsx - Auth Context · Client-side auth state and token sharing.
src/contexts/authContext.jsx - Firebase Client · Client-side Firebase access layer.
src/backend/firebase.js - Firebase Admin · Privileged Firebase access for protected operations.
src/backend/firebaseAdmin.js - Require Auth · Server-side access control helper.
src/backend/requireAuth.js - Turnstile Verify · Bot-check verification for sensitive flows.
src/app/dekodeX/api/verifyTurnstile/route.js
Content Data
Local JSON and static assets consumed by routes.
- Articles Data · Article metadata and animation descriptors.
src/data/articles/articles-data.json - Events Data · Events catalog and image mappings.
src/data/events/EventsData.json - Teams Data · Team rosters and membership content.
src/data/teams/content.json - Question Banks · PDS and practice question sets.
src/data/qna/lab-questions.json - Challenge Data · deKodeX question and event data used by routes.
src/data/deKodeX/event-que.json
Connections 26
- Root Layout → Home: wraps · The root layout surrounds the public entry page.
- Root Layout → Articles: routes · Layout enables all routed pages.
- Root Layout → Events: routes · Layout enables all routed pages.
- Root Layout → Teams: routes · Layout enables all routed pages.
- Root Layout → deKodeX Home: routes · Layout enables all routed pages.
- Root Layout → PDS Home: routes · Layout enables all routed pages.
- Home → Navbar: uses · Home page composes the shared navigation.
- Home → Landing: uses · Home page composes landing sections.
- Home → Footer: uses · Home page includes the shared footer.
- Articles → Articles Data: reads · Article route renders from local article metadata.
- Events → Events Data: reads · Events route renders from local event data.
- Teams → Teams Data: reads · Team pages render from curated roster data.
- deKodeX Home → Problem Arena: uses · Main deKodeX page mounts the interactive arena.
- Question Page → deKodeX API: calls · Dynamic question pages fetch question state and submit results.
- deKodeX API → Firebase Admin: uses · Protected challenge endpoints rely on server Firebase access.
- deKodeX API → Firebase Client: uses · Some challenge flows use client Firebase integration.
- deKodeX API → Turnstile Verify: verifies · Sensitive endpoints verify bot protection tokens.
- deKodeX API → Require Auth: guards · Authenticated challenge operations are protected server-side.
- deKodeX API → Challenge Data: reads · Challenge endpoints resolve questions and titles from local data.
- Leaderboard → deKodeX API: calls · Leaderboard pages fetch paginated ranking data.
- Auth Page → Auth Context: uses · Auth UI shares client login state.
- Auth Page → Firebase Client: uses · Authentication flows connect to Firebase client services.
- Registration → Auth Context: uses · Registration flow shares auth/token state.
- PDS Home → PDS Lab: links · PDS home routes into the lab experience.
- PDS Home → PDS Theory: links · PDS home routes into theory content.
- PDS Lab → Question Banks: reads · Lab questions are driven by local question banks.