How tcube-1/military-academy-web works
Purpose and Runtime
This is a TypeScript Next.js application using the App Router. Its visible product surface is a course-oriented site with home navigation and pages for academic/intermediate and defence-related courses. A separate backend source tree exists, but no API route bridge is present in the tree.
Primary web runtime entry points:
• src/app/layout.tsx
• src/app/page.tsx
• src/app/home/page.tsx
Route Structure
The App Router serves:
• / from src/app/page.tsx
• /home from src/app/home/page.tsx
• Arbitrary nested course paths under /home/* through the catch-all route src/app/home/[...courses]/page.tsx
The catch-all page is the central routing boundary for course-specific content. It likely interprets route segments and selects course views; this is the main extension point for adding course URLs.
Shared Application Shell
src/app/layout.tsx defines the root document/layout boundary for all pages. Global visual styling is applied through:
• src/app/globals.css
• src/app/layout.tsx
Home-facing shared UI is separated into reusable components:
• src/app/components/home/NavBar.tsx
• src/app/components/home/Ribbon.tsx
This keeps navigation and promotional/header content outside route page files.
Course Content Composition
Course content is implemented as React component modules rather than as a data-driven CMS or backend API. Top-level course groupings include:
• src/app/components/courses/Degree.tsx
• src/app/components/courses/Intermidte.tsx
Intermediate/exam content is split by destination:
• src/app/components/courses/inter/IitPage.tsx
• src/app/components/courses/inter/NdaPage.tsx
• src/app/components/courses/inter/NeetPage.tsx
The route layer should compose these components rather than embed their content directly.
Defence Course Domain
Defence content is organized as independent presentation modules under a dedicated domain folder:
• src/app/components/courses/defence/IndianArmy.tsx
• src/app/components/courses/defence/IndianAirForce.tsx
• src/app/components/courses/defence/IndianNavy.tsx
src/app/components/courses/defence/IndianCostGuard.tsx is an additional defence branch component. This folder is the clear boundary for expanding defence-specific pages or consolidating shared defence metadata.
Backend and Infrastructure Boundary
A separate TypeScript backend entry point exists at:
• src/backend/index.ts
• src/backend/database/db.ts
Database connectivity is isolated under src/backend/database/db.ts; the actual database vendor/service is not identifiable from the supplied tree. Backend error and async-request conventions are centralized in:
• src/backend/config/ApiError.ts
• src/backend/config/asyncHandler.ts
• src/backend/config/httpStatus.ts
No src/app/api routes, external API clients, or hosted service integrations are visible. Consequently, the Next.js UI and backend appear structurally separate, and any future dynamic course data requires an explicit integration boundary between the App Router and src/backend.
Main entry points: [...courses]/page.tsx /home/* course route · layout.tsx Root layout · home/page.tsx /home page · index.ts Backend entry
Components 20
Next.js App Router
- Root layout · Document boundary and global styling.
src/app/layout.tsx - Global styles
src/app/globals.css - / landing page
src/app/page.tsx - /home page
src/app/home/page.tsx - /home/* course route · Central URL-to-course composition boundary.
src/app/home/[...courses]/page.tsx - Home navigation
src/app/components/home/NavBar.tsx - Home ribbon
src/app/components/home/Ribbon.tsx
Course Components
- Degree courses
src/app/components/courses/Degree.tsx - Intermediate courses
src/app/components/courses/Intermidte.tsx - IIT content
src/app/components/courses/inter/IitPage.tsx - NDA content
src/app/components/courses/inter/NdaPage.tsx - NEET content
src/app/components/courses/inter/NeetPage.tsx - Defence course views · Independent branch presentation modules.
- Indian Army
src/app/components/courses/defence/IndianArmy.tsx - Indian Air Force
src/app/components/courses/defence/IndianAirForce.tsx - Indian Navy
src/app/components/courses/defence/IndianNavy.tsx - Indian Coast Guard
src/app/components/courses/defence/IndianCostGuard.tsx
Separate Backend
No API bridge to the App Router is present.
- Backend entry · Structurally separate from the Next.js runtime.
src/backend/index.ts - Database connection · Database vendor is not identified.
src/backend/database/db.ts - API conventions · Shared API errors, async handling, and status codes.
src/backend/config/ApiError.ts
Connections 19
- Root layout → Global styles: applies
- Root layout → / landing page: wraps
- Root layout → /home page: wraps
- Root layout → /home/* course route: wraps
- /home page → Home navigation: uses
- /home page → Home ribbon: uses
- /home/* course route → Degree courses: selects
- /home/* course route → Intermediate courses: selects
- /home/* course route → IIT content: selects
- /home/* course route → NDA content: selects
- /home/* course route → NEET content: selects
- /home/* course route → Defence course views: selects
- Defence course views → Indian Army: contains
- Defence course views → Indian Air Force: contains
- Defence course views → Indian Navy: contains
- Defence course views → Indian Coast Guard: contains
- Backend entry → Database connection: connects through
- Backend entry → API conventions: uses
- /home/* course route → Backend entry: no integration bridge · Dynamic course data would require an explicit boundary.