Skip to content

Latest commit

 

History

History
165 lines (135 loc) · 5.58 KB

File metadata and controls

165 lines (135 loc) · 5.58 KB

Pathfinder Implementation Plan

Implementation Status (April 2026)

  • Phase 1: Completed
  • Phase 2: Completed
  • Phase 3: Completed
  • Phase 4: Completed
  • Phase 5: Completed
  • Phase 6: Completed
  • Phase 7: Completed
  • Phase 8: Completed
  • Phase 9: Completed
  • Phase 10: Completed

Current database target in code is PostgreSQL. To run schema/seed when DB service is available:

  • npm run db:init:pg --prefix server

1. Objective

Build Pathfinder (CareerCompass) as a full-stack monorepo with:

  • React 18 + Vite frontend in client
  • Node.js 20 + Express backend in server
  • MySQL 8 database
  • JWT auth, booking, payment simulation, assessment engine, admin panel, email reminders, and AI chatbot

2. Delivery Phases

Phase 0: Local Setup and Baseline

  • Install Node.js 20 LTS and MySQL 8
  • Create database using the SQL schema and seed data from project prompt
  • Configure server/.env and client/.env
  • Run npm install at root, client, and server
  • Validate backend health endpoint and frontend Vite startup

Exit criteria:

  • Database exists with all tables
  • Backend serves GET /api/health
  • Frontend runs at localhost:5173 and can call backend

Phase 1: Backend Foundation

  • Implement server startup, middleware stack, and route mounting
  • Configure mysql2 pool in server/config/db.js
  • Add auth middleware (verifyToken, requireAdmin)
  • Add validation middleware with express-validator error formatter
  • Add auth rate-limiter for login/register routes

Exit criteria:

  • All route files are mounted and return JSON responses
  • JWT middleware works for protected endpoints
  • Auth limiter blocks excessive requests

Phase 2: Core Auth and User Flows

  • Implement register and login controllers with bcryptjs and JWT
  • Implement GET /api/auth/me endpoint
  • Add robust try/catch and standardized error responses
  • Verify role propagation in JWT payload for admin checks

Exit criteria:

  • User can register and login
  • Token contains role and identity
  • Protected routes reject missing or invalid token

Phase 3: Career, Booking, and Payment APIs

  • Implement career paths listing and details APIs with filtering/search
  • Implement booking create/mine/cancel flows
  • Implement payment process API with transaction id generation
  • Confirm booking status updates after successful payment
  • Insert activity logs for booking operations

Exit criteria:

  • User can create booking and view bookings
  • Payment marks booking as confirmed/paid
  • Data persists correctly in MySQL

Phase 4: Assessment and Recommendations

  • Implement question fetch API
  • Implement assessment submit scoring logic and recommendation mapping
  • Implement latest result fetch API
  • Validate score and top career calculations

Exit criteria:

  • Assessment answers produce deterministic scores
  • Latest result endpoint returns expected payload

Phase 5: Email + Cron Services

  • Implement confirmation and reminder email services
  • Add HTML templates for confirmation and reminder
  • Implement node-cron reminder scheduler every 30 minutes
  • Set reminder sent flags to avoid duplicate emails

Exit criteria:

  • Booking confirmation email is triggered on successful payment
  • 24hr and 1hr reminders are sent once per booking

Phase 6: Admin APIs and Reports

  • Implement admin user management, booking management, and career path CRUD
  • Implement reports endpoint for totals, weekly bookings, top careers, and revenue
  • Protect all admin routes with verifyToken + requireAdmin

Exit criteria:

  • Admin endpoints are inaccessible to non-admin users
  • Dashboard metrics are returned correctly

Phase 7: Frontend App Foundation

  • Setup i18next in main.jsx with en/hi/mr resources
  • Build AuthContext and Axios utility with JWT interceptor
  • Define routes in App.jsx with ProtectedRoute and AdminRoute
  • Add global CSS variables and base UI primitives

Exit criteria:

  • Route guards behave correctly for user/admin
  • Token persists and rehydrates on refresh
  • Language switching works

Phase 8: User Pages and Components

  • Build pages in sequence: Home, Login, Signup, Dashboard, CareerExplorer, Booking, Payment, Assessment, Results
  • Implement reusable UI components: Navbar, ChatbotWidget, CareerCard, BookingCard, Spinner, ProgressBar, FlashMessage
  • Wire frontend to backend with Axios for all data operations

Exit criteria:

  • End-to-end user flow works from signup to payment success
  • Assessment and results chart render correctly

Phase 9: Admin Pages and Analytics UI

  • Build admin login and guarded admin pages
  • Implement AdminDashboard, AdminUsers, AdminCareerPaths, AdminBookings, AdminReports
  • Add charts using react-chartjs-2 for weekly bookings and top topics

Exit criteria:

  • Admin can manage users, bookings, and career paths
  • Reports and charts match backend data

Phase 10: Stabilization and QA

  • Add ESLint + Prettier configuration and run lint fixes
  • Test all listed flows from specification
  • Validate security checklist items
  • Final README updates with setup and run instructions

Exit criteria:

  • No blocking runtime errors
  • All primary flows validated
  • Project ready for demo submission

3. Suggested Build Order (Day-wise)

  • Day 1: Phase 0, 1
  • Day 2: Phase 2, 3
  • Day 3: Phase 4, 5
  • Day 4: Phase 6, 7
  • Day 5: Phase 8
  • Day 6: Phase 9
  • Day 7: Phase 10 and demo prep

4. Immediate Next Commands

Run these from project root:

  1. npm run install:all
  2. Start MySQL and execute schema/seed SQL
  3. Configure server/.env and client/.env
  4. npm run dev

5. Notes

  • Keep all DB operations as prepared statements through mysql2 pool
  • Keep backend controllers wrapped in try/catch
  • Use React hooks and functional components only
  • Keep JWT in localStorage as specified