A modern, playful (Duolingo-inspired) digital guidance platform scaffold for Indian students. Frontend: Vite + React + TailwindCSS + Framer Motion. Backend: Node.js + Express (mock/in-memory + JSON files, no real DB). Includes quiz-based AI recommendations, college directory, timeline tracker, and a floating chatbot integrating with a hypothetical Mistra API.
NOTE: This is a scaffold for rapid prototyping / hackathon usage. It contains TODOs for production hardening (validation, security, accessibility, performance).
- Light/Dark theme with toggle (persistent via localStorage) using green primary palette (#34D399 / #059669), accent purple (#7C3AED), badge yellow (#FBBF24).
- Landing page with hero + CTA (Take Quick Quiz).
- 10-question aptitude & interest quiz (MCQ, slider, tags) with animated step transitions.
- Recommendation flow POSTs
{ userProfile, quizAnswers }to/api/mistra/recommendreturning mock AI career suggestions. - Course-to-Career mapping displayed as animated degree cards with salary, roles, exams, growth.
- Government Colleges Directory using
server/data/colleges.json+ district filter. - Timeline Tracker using
server/data/timeline.jsonwith vertical timeline & upcoming events sidebar. - Floating animated chatbot (bobbing FAB) opening slide-up panel; chats with
/api/mistra/chat(mock if no API key). - Simple auth:
/api/auth/loginreturns{ token: "fake-jwt", user: { email } }stored inlocalStorage. - API helper consolidating calls & token header injection.
root
ββ client/ # Vite React app
β ββ index.html
β ββ package.json
β ββ tailwind.config.cjs
β ββ postcss.config.cjs
β ββ src/
β ββ styles.css # Tailwind + theme CSS vars
β ββ main.jsx
β ββ App.jsx # Routing, theme provider, layout
β ββ pages/
β β ββ Home.jsx
β β ββ Quiz.jsx
β β ββ Directory.jsx
β β ββ Timeline.jsx
β β ββ Recommendations.jsx
β ββ components/
β β ββ ThemeToggle.jsx
β β ββ Chatbot.jsx
β β ββ LoginForm.jsx
β ββ services/
β ββ api/mistra.js # API helper
β
ββ server/
β ββ index.js # Express app entry
β ββ package.json
β ββ routes/
β β ββ auth.js
β β ββ mistra.js
β ββ utils/
β β ββ callMistra.js
β ββ data/
β ββ colleges.json
β ββ timeline.json
β
ββ .env.example
ββ README.md
# From repository root
cd server
npm install
cd ../client
npm installCopy .env.example to .env inside server/ (optional for mock):
Copy-Item .env.example server/.envSet MISTRA_API_KEY only if you have one; otherwise mock data is returned.
cd server
npm run devServer: http://localhost:4000
Open new terminal:
cd client
npm run devFrontend: http://localhost:5173 (Vite default)
Visit the frontend URL. Quiz, Directory, Timeline, Chatbot should function. Recommendations & Chat use mock data if no Mistra key.
- User opens Login page (
/login). - Submits any email/password.
- Backend returns static token
fake-jwt. - Token stored in
localStorage(used by API helper). - TODO: Replace with real JWT generation + password hashing + logout.
POST /api/mistra/recommend
{
"userProfile": { "grade": "11", "location": "MH" },
"quizAnswers": { "1": "Math", "4": 7, "10": ["Creative", "Curious"] }
}Returns mock JSON (see sample below) if no API key.
POST /api/mistra/chat with { "message": "What is a good degree for AI?" }.
Returns { "reply": "Mock response about: ..." } unless real API key present.
When you provide a valid MISTRA_API_KEY and MISTRA_API_URL in server/.env the backend will:
- Call the Mistra API for both
/api/mistra/recommendand/api/mistra/chat. - Attempt to parse JSON directly. If the model returns narrative text containing a JSON block, it extracts the first
{ ... }segment. - For recommendations you should instruct your model (system prompt already does) to output ONLY JSON matching:
Create server/.env:
PORT=4000
MISTRA_API_URL=https://api.mistra.example/v1/generate
MISTRA_API_KEY=sk_live_your_real_keyRestart the server after adding the key. If responses are not JSON, check server logs and refine the system instruction to force strict JSON.
- Timeout: 30s default (returns
Mistra request timed out). - Non-200: surfaces first 300 chars of response body.
- Malformed JSON: falls back to
{ raw: "...original text..." }for recommendations, or raw text for chat.
Consider adding: retries with exponential backoff, JSON schema validation (Zod), structured logging, and streaming responses for the chat endpoint (SSE/WebSockets).
See end of this README for a full example; used by frontend to render recommendations.
- CSS variables for surfaces / text colors switch via
light/darkclass on<html>. - Tailwind utilities for spacing, rounded corners (
rounded-2xl), shadows (shadow-lg, customshadow-soft). - Framer Motion used for: page transitions, quiz transitions, card fade/slide, chatbot slide & bob animation.
- Buttons: scale on hover via Tailwind + motion wrappers.
- Input validation (e.g., Zod / Joi) for all requests.
- Proper auth (JWT signing, refresh tokens, password hashing with bcrypt/argon2).
- Rate limiting & CORS tightening.
- Logging & monitoring (winston/pino + structured logs).
- Accessibility checks (ARIA labels for interactive elements, focus management for modal/chatbot panel).
- Unit/integration tests.
- Error boundaries on the React side.
- Streaming chat (Server-Sent Events or WebSockets).
- Security headers (helmet).
- College/timeline data persistence (DB: PostgreSQL / MongoDB) & admin panel.
MIT (or add your preferred license).
{
"recommended_streams": ["Engineering", "Computer Science"],
"recommended_degrees": [
{
"name": "B.Tech Computer Engineering",
"description": "Focus on software systems, algorithms, and emerging tech.",
"average_salary_range": "4-12 LPA",
"key_job_roles": ["Software Developer", "Data Analyst"],
"government_exams": ["GATE", "ISRO Scientist"],
"growth_outlook": "High demand with AI & automation expansion."
}
],
"suggested_colleges": ["IIT Sample", "Government Engineering College A"],
"next_steps": [
"Strengthen math basics",
"Practice logical reasoning",
"Explore small coding projects"
]
}Happy building! β¨
{ "recommended_streams": ["Engineering"], "recommended_degrees": [ { "name": "B.Tech Computer Engineering", "description": "...", "average_salary_range": "4-12 LPA", "key_job_roles": ["Software Developer"], "government_exams": ["GATE"], "growth_outlook": "..." } ], "suggested_colleges": ["College A"], "next_steps": ["Step 1", "Step 2"] }