How mahammadwahab540/prism-education works
Project Type and Purpose
• This is a single-page front-end application (SPA) built with Vite, TypeScript, React, Tailwind CSS and shadcn-ui.
• Its primary purpose is to provide a rich UI for managing “capstone” projects, user profiles, analytics dashboards, tenant administration, and integrations with an LLM-based “Capstone Orchestrator.”
File Structure Analysis
• Top-level:
• index.html, main.tsx – entry point for the Vite React app
• src/
– pages/ – route components mapped by your React router
– components/ – presentational and container components organized by feature (admin, analytics, capstone, dashboard, ui, etc.)
– contexts/, hooks/ – React Contexts for global state (Auth, LearningPath, Notifications, ProfilePanel) and custom hooks for encapsulated logic
– lib/ – domain logic + mock/facade for the Capstone Orchestrator + utilities + telemetry + mock data
– services/ – API layer wrapping HTTP calls (e.g. tenants.ts, export.ts)
– types/ – shared TypeScript types and Zod schemas validating orchestrator payloads
• Config & tooling:
• Vite (vite.config.ts), TS configs (tsconfig.*), ESLint, Tailwind, PostCSS
Key Insights from README
• “Capstone Orchestrator” module uses Zod schemas, system & developer prompts, and offers both mock and real LLM invocation.
• No backend code in this repo; it expects external REST endpoints (e.g. tenant management, exports).
• Full UI driven by React + shadcn-ui + Tailwind
Major Components
A. Client (Browser)
1. React SPA – entry point at main.tsx → App.tsx → Router → pages/*
2. UI Layer – shadcn-ui + Tailwind components in src/components/ui and feature-specific components
3. State Management – React Contexts (AuthContext, NotificationContext, etc.) + Hooks
B. Business-Logic Layer (in-browser)
1. Capstone Orchestrator Facade (src/lib/capstoneOrchestrator.ts)
2. Validation & Transformation (Zod schemas + orchestrationToRoadmap)
C. API Layer
1. services/*.ts – HTTP wrappers calling external REST endpoints (tenant management, exports)
2. Telemetry & Analytics (src/lib/telemetry.ts)
D. External Services
1. REST API server (authentication, tenant data, analytics back-end)
2. LLM endpoint (OpenAI or similar) for production orchestration
3. Optional Mock Data for local dev
Relationships & Interactions
• User interacts with React UI → triggers Actions
• UI dispatches through Contexts/Hooks → calls service functions or lib/orchestrator functions
• services/*.ts functions → HTTP → REST API → returns JSON → UI updates
• Orchestrator in mock mode bypasses REST/LLM for dev; in prod it sends prompts to LLM endpoint
• Telemetry calls fire on key user events to telemetry endpoint
Architectural Patterns & Design Principles
• Feature-driven component organization (each domain area under src/components)
• Separation of concerns: UI components vs. contexts vs. services vs. domain logic in lib vs. types/schemas
• Mock-first development for LLM orchestration
• Type safety end-to-end with TypeScript and Zod
• Single SPAs with client-side routing