I will now update src/router.tsx so it can handle dynamic route paths like /universities/:id, /programs/:id, /universities/add, and /programs/add, plus helper functions for routing.
Let's fix the minor typo in src/router.tsx at line 140: window.location.hash = #{to}`;` instead of `window.location.hash `#{to};.
Now, let's create a rich store for course details, university details, and custom added universities/courses in src/pagedata.tsx or a dedicated data store module src/store.tsx so users can add new courses and universities, and view rich details for both!
Let's inspect what detailed information we want for:
-
Course Details:
id, name, code, field, duration, feeTotal, entrance, note, eligibility, semesterCount, curriculum (array of semesters with subjects), careerRoles, topColleges, feeSplit, syllabusPdf, faqs.
-
University / College Details:
id, code, name, type, est, hq, city, province, chancellor, affiliatesCount, studentsCount, feeRange, accent, blurb, description, facilities (Hostel, Library, Placement, Sports, Labs, Bus, Wifi, etc.), programs, highlights, contactPhone, contactEmail, website, verifiedInvoices.
Let's create src/store.tsx which manages built-in + user-added courses and universities!
Let's fix the minor unused import in src/store.tsx (line 3: import { COLLEGES, type College } from "./pagedata"; is unused).
Now, let's create the four new page components:
src/pages/CourseDetail.tsx: Rich course detail page for dynamic ID (e.g. /programs/csit, /programs/mbbs, etc.), with syllabus breakdown, fee splits, eligibility, career roles, top colleges list, and direct CTA buttons.
src/pages/CourseAdd.tsx: "Add a Course / Fee Structure" form page with live preview card, validation, and submission that immediately registers into our store so it shows up everywhere on the site!
src/pages/UniversityDetail.tsx: Rich university & college detail page for dynamic ID (e.g. /universities/tu, /universities/ku, /universities/ioe-pulchowk), showing facilities, constituent vs affiliate campuses, official contact, fee ranges, entrance cutoffs, and verified receipts count.
src/pages/UniversityAdd.tsx: "Add a University or College Listing" form page with live preview card, validation, and submission that saves directly to store!
Let's build src/pages/CourseDetail.tsx first!
Now let's create src/pages/CourseAdd.tsx:
This allows users/colleges/students to submit a new course or fee structure update. It has live preview, form validation, and immediately saves to our store so the user can see it right away!
Let's clean up the minor unused imports in src/pages/CourseAdd.tsx (remove unused Link and Reveal).
Now, let's create:
3. src/pages/UniversityDetail.tsx: Detail page for Universities / Colleges (e.g. /universities/tu, /universities/ku, /universities/ioe-pulchowk).
4. src/pages/UniversityAdd.tsx: "Add University or College Listing" form page with live preview card & instant publication!
Let's build src/pages/UniversityDetail.tsx first!
Let's clean up the unused Reveal import in src/pages/UniversityDetail.tsx.
Now let's create src/pages/UniversityAdd.tsx:
"Add a University or College Listing" form page with live preview card & instant publication into local store so it appears in searches, directory, and comparisons immediately!
Now let's resolve all minor lint/type errors across our files before updating App.tsx and building:
- In
src/store.tsx: remove import { COLLEGES, type College } from "./pagedata";
- In
src/CourseAdd.tsx: remove unused Link and Reveal.
- In
src/UniversityDetail.tsx: remove unused Reveal.
- In
src/router.tsx: fix window.location.hash = #${to};.
- In
src/pages/PageShell.tsx: update RouteId or import Link from ../router.
- In
src/components/Chrome.tsx: update to use NAV_ROUTES and dynamic Link from ../router.
- In
src/App.tsx: wire up all dynamic routes (RouteInfo types):
route.type === "home" -> <Home />
route.type === "universities" -> <Universities />
route.type === "universities-add" -> <UniversityAdd />
route.type === "university-detail" -> <UniversityDetail id={route.id} />
route.type === "programs" -> <Programs />
route.type === "programs-add" -> <CourseAdd />
route.type === "program-detail" -> <CourseDetail id={route.id} />
route.type === "fees" -> <Fees />
route.type === "about" -> <About />
route.type === "contact" -> <Contact />
Let's edit each of these files clean and error-free!
First, src/store.tsx:
Now let's fix src/router.tsx: line 140 window.location.hash = #${to}; and clean types.
Now let's update src/pages/PageShell.tsx to use string paths for Link:
Let's fix line 114 in src/pages/PageShell.tsx where to: RouteId was used; replace with to: string.
Now let's update src/components/Chrome.tsx to use NAV_ROUTES and string paths:
Let's clean up the remaining minor imports in src/pages/CourseAdd.tsx and src/pages/UniversityDetail.tsx, and then update src/App.tsx!
First src/pages/CourseAdd.tsx:
Now src/pages/UniversityDetail.tsx: remove Reveal import.
Now let's update src/App.tsx to handle all route types:
Navbar receives currentPath={pathStr}
- Route conditional rendering for:
home
universities
universities-add
university-detail
programs
programs-add
program-detail
fees
about
contact
Let's update src/App.tsx now!
Now let's check src/pages/Universities.tsx and src/pages/Programs.tsx so that clicking on any course card or university/college card links directly to its detail page (/programs/csit, /universities/tu, /universities/ku, etc.), and both pages feature prominent "+ Add Course" and "+ Add University/College" buttons!
Let's check src/pages/Programs.tsx:
In src/pages/Programs.tsx, let's wrap program titles and "View Course Details" buttons with <Link to={/programs/${p.id}}> and add a hero CTA to /programs/add. Let's inspect and update src/pages/Programs.tsx.
Now let's update src/pages/Universities.tsx so that university & college cards link directly to detail pages (e.g. /universities/tu, /universities/ku, /universities/ioe-pulchowk) and feature the "+ Add University or College" CTA!
Now let's check src/components/Explore.tsx and src/components/Explorer.tsx to make sure card links point directly to /universities/${u.id} or /programs/${p.id} as well!
Let's check src/components/Explorer.tsx:
In UniversityCard, let's add a direct link button or title link to /universities/${u.id}.
In FeeSection, let's add a link to /programs/${p.id} ("Full Syllabus & Details →").
Let's update src/components/Explorer.tsx with these links!
Let's run build_project to test if all TypeScript types and Vite single-file bundles build cleanly!
The build succeeded with zero errors and generated dist/index.html seamlessly!
Here is a summary of what was created:
-
Course Detail Page (/programs/:id):
- Deep-dive page for individual degrees (e.g. BSc CSIT, MBBS, BE Computer/Civil, BBA, etc.).
- Includes tabbed navigation for:
- Overview & Fee Split: Degree level, minimum eligibility (+2 marks/GPA), entrance exam requirement, full 4-year fee total, itemized cost distribution bar (tuition, admission, lab, exam).
- Curriculum & Semesters: Semester-by-semester breakdown (Semesters I to VIII) with core subjects, practical labs, and capstone projects.
- Top Offering Campuses: Filtered list of verified constituent and private colleges offering the degree in Nepal.
- Salaries & Career Paths: Local starting salaries in Kathmandu/Pokhara, demand index, and international higher study tracks.
- Action CTAs: "Get Free Syllabus & Fee Sheet", "Suggest / Update Fee Data".
-
Add Course Form Page (/programs/add):
- User-friendly submission page for students, alumni, and college representatives.
- Form fields for: Course Name, Faculty/Field, Total 4-Yr Fee (NPR), Entrance Exam, Duration, Overview/Description, Minimum Eligibility, and Key Colleges Offering.
- Realtime Preview Card: Side-by-side live card that updates as you type.
- Instant Publication: Submitting saves to local store and redirects directly to the newly created course's published detail page (
/programs/new-slug).
-
University & College Detail Page (/universities/:id):
- Detailed page for Universities (TU, KU, PoU, PU, AFU, etc.) and specific campuses.
- Tabbed sections for:
- Overview & Highlights: Est. year, headquarters location, institutional type (Public State / Community / Private Affiliate), scale, enrolled student body.
- Programs & Fees: List of offered bachelor degrees with total fees and entrance exams.
- Campus Facilities: Infrastructure checklist (Central Library, Research Labs, Hostels, Sports Complex, Transport).
- Admissions & Official Contact: Verified website URL, official helpline phone, admissions email, and verified invoice counter badge.
-
Add University / College Form Page (/universities/add):
- Submission form for university administrators, college representatives, and student contributors.
Files built: src/router.tsx, src/store.tsx, src/pages/CourseDetail.tsx, src/pages/CourseAdd.tsx, src/pages/UniversityDetail.tsx, src/pages/UniversityAdd.tsx, src/pages/PageShell.tsx, src/components/Chrome.tsx, src/App.tsx, src/pages/Programs.tsx, src/pages/Universities.tsx, src/components/Explorer.tsx