Skip to content

Commit 15b596f

Browse files
change the learning hub
1 parent 2b72f11 commit 15b596f

29 files changed

Lines changed: 6140 additions & 165 deletions
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# Learning Hub Revamp Plan
2+
3+
## Your question: JSON vs Markdown/README, which is better?
4+
5+
Short answer: **keep JSON as the source of truth, but render rich content inside it.** Do not migrate wholesale to `.md` files. Here is why.
6+
7+
### Why raw markdown is NOT the right move
8+
Current lesson files (e.g. [html-fundamentals.json](client/src/module/student/html/data/lessons/html-fundamentals.json)) are structured records with typed fields: `id`, `sectionId`, `orderIndex`, `difficulty`, `isInterviewQuestion`, `concepts`, `content.explanation`, `content.codeExamples[]`, `notes`, `commonPitfalls`, etc. The app relies on this shape for:
9+
10+
1. Progress tracking per `id`
11+
2. Filtering (interview questions, difficulty, concepts)
12+
3. Ordering via `orderIndex`
13+
4. Rendering code examples with separate `code`, `output`, `explanation` blocks
14+
5. Future features like search, bookmarking, quizzes, XP
15+
16+
Raw markdown throws all of that away. You would have to parse frontmatter and custom fences back out of the `.md`, which is strictly worse than just reading a field. Markdown is great for prose, bad for structured learning content.
17+
18+
### The real problem
19+
The real problem is not the format, it is that **the `explanation` field is one giant wall of text** rendered as plain paragraphs. Whether that text lives in JSON or MD, it still looks boring. The fix is on the render side.
20+
21+
### Recommended approach: hybrid
22+
- Keep the JSON schema.
23+
- Allow the `explanation` field (and notes, pitfalls) to contain **markdown + custom directives**. Render it with `react-markdown` + `remark-gfm` + `rehype-highlight`.
24+
- Add new optional fields to the JSON schema for rich blocks: `diagrams`, `flowcharts`, `interactiveDemos`, `quiz`, `visualizations`.
25+
- Render each block with a dedicated component.
26+
27+
This gives you the "write like markdown" ergonomics for authors, and the structured metadata for the app.
28+
29+
---
30+
31+
## Phase 1: Make existing content visually engaging
32+
33+
### 1.1 Markdown rendering inside lessons
34+
- Install `react-markdown`, `remark-gfm`, `rehype-highlight`, `rehype-raw`.
35+
- Create [LessonContent.tsx](client/src/components/learn/LessonContent.tsx) that accepts the `content` object and renders explanation as markdown.
36+
- Support GitHub-style tables, task lists, callouts (`> [!NOTE]`, `> [!WARNING]`).
37+
- Style with Tailwind `prose` equivalent (use `@tailwindcss/typography` or hand-rolled since we are on TW v4).
38+
39+
### 1.2 Diagrams and flowcharts (Mermaid)
40+
- Install `mermaid`.
41+
- Add a `Mermaid` renderer that lazy-loads and renders any ` ```mermaid ` code fence.
42+
- Add an optional `diagrams: [{ title, mermaid }]` array to the lesson JSON. Example use cases:
43+
- HTML rendering pipeline: `Browser -> HTTP -> Server -> HTML -> DOM -> CSSOM -> Render Tree -> Paint`
44+
- React lifecycle
45+
- Express middleware chain
46+
- SQL query execution order
47+
48+
### 1.3 Charts (Recharts, already likely in deps)
49+
- Add optional `charts: [{ type: 'bar'|'line'|'pie', title, data }]` to JSON.
50+
- Useful for: time complexity comparisons, language popularity, framework benchmarks, aptitude answer distributions.
51+
52+
### 1.4 Syntax-highlighted code with tabs
53+
- Upgrade `codeExamples` rendering to use Shiki or `rehype-highlight` with a copy button, line numbers, and a tabs UI when a lesson has multiple examples.
54+
- Add a "Run" button for JS/HTML/CSS examples via Sandpack (`@codesandbox/sandpack-react`). Instant interactive playground, zero backend.
55+
56+
### 1.5 Callout cards
57+
- Replace the plain `notes` and `commonPitfalls` lists with colored callout cards (info, warning, tip, danger). Icon + border, not pill badges (per CLAUDE.md rules).
58+
59+
---
60+
61+
## Phase 2: New interactive features
62+
63+
### 2.1 Inline quizzes per lesson
64+
- Add `quiz: [{ question, options[], correctIndex, explanation }]` to JSON.
65+
- Render as a card after the lesson. Track correct/incorrect per user in localStorage first, then persist to server.
66+
- Award XP for first-try correct answers.
67+
68+
### 2.2 Flashcards (spaced repetition lite)
69+
- Auto-generate flashcards from the `concepts` array + a new `definitions` map.
70+
- Simple SM-2 style review queue. Daily review streak.
71+
72+
### 2.3 Progress, XP and streaks
73+
- Per-lesson progress: `not-started | in-progress | completed`.
74+
- Daily streak counter on the Learning Hub landing page.
75+
- XP bar, level up, badges for: "Finished HTML track", "10-day streak", "50 interview questions answered".
76+
77+
### 2.4 TCS / exam question bank
78+
- Create [examData/](client/src/module/student/aptitude/data/exams/) with folders per exam: `tcs-nqt`, `infosys`, `wipro`, `accenture`, `capgemini`, `cognizant`.
79+
- Each JSON file: `{ exam, year, section, questions: [{ id, type, question, options, correctIndex, explanation, difficulty, topic }] }`.
80+
- New route `/student/exam-prep/:exam` with:
81+
- Topic-wise practice
82+
- Timed full mock tests with section timers matching real patterns (e.g. TCS NQT: Numerical 25m, Verbal 25m, Reasoning 25m, Coding 45m)
83+
- Score report with topic breakdown
84+
- Leaderboard (optional)
85+
- Mark questions with `isInterviewQuestion: true` to reuse the existing filter on the Learning Hub.
86+
87+
### 2.5 Daily challenge
88+
- One curated question per day on the Learning Hub home. MCQ, code, or debug-the-snippet. Mixed across tracks.
89+
- "Maintain your streak" CTA.
90+
91+
### 2.6 Code playground lessons
92+
- For JS / Python / SQL: embed Sandpack or Pyodide or sql.js so the learner can edit and run the example in place.
93+
- Add `playground: { language, starter, solution, tests }` to JSON. Auto-grade with tests.
94+
95+
### 2.7 Visual concept maps
96+
- Each track gets a clickable concept-map landing page (React Flow). Nodes are lessons, edges are prerequisites. Clearly shows progress (completed nodes turn green).
97+
- Install `reactflow`.
98+
99+
### 2.8 AI tutor per lesson
100+
- "Ask about this lesson" button. Sends lesson content + user question to Gemini (`gemini-2.5-flash-lite` per CLAUDE.md). Server endpoint under `learn-chat/` module mirroring the existing module pattern.
101+
- Rate-limit via `usageLimit` middleware, reuse an existing UsageAction (per CLAUDE.md: do not add new enum values).
102+
103+
### 2.9 Notes and bookmarks
104+
- Per-user notes per lesson, stored server-side. Bookmark important lessons. Export notes as markdown.
105+
106+
### 2.10 Community answers on interview questions
107+
- For lessons where `isInterviewQuestion: true`, let students post their own answers, upvote, and see a "top answer". Moderated by admin.
108+
109+
---
110+
111+
## Phase 3: Engagement and retention
112+
113+
- **Weekly learning digest email** using the existing broadcast email infra (recent commits show it exists).
114+
- **Certificates** on track completion, PDF generated server-side, shareable link.
115+
- **Study groups**: students join a track cohort, shared progress wall.
116+
- **Compare with friends**: opt-in progress sharing.
117+
- **Push notifications** via web push for daily challenge and streak reminders.
118+
119+
---
120+
121+
## Proposed JSON schema additions (non-breaking)
122+
123+
```ts
124+
type LessonContent = {
125+
explanation: string; // now: markdown, not plain text
126+
codeExamples?: CodeExample[];
127+
notes?: string[];
128+
commonPitfalls?: string[];
129+
130+
// NEW optional blocks
131+
diagrams?: { title: string; mermaid: string; caption?: string }[];
132+
charts?: { title: string; type: "bar" | "line" | "pie"; data: any }[];
133+
quiz?: { question: string; options: string[]; correctIndex: number; explanation: string }[];
134+
playground?: { language: "js" | "html" | "python" | "sql"; starter: string; solution?: string; tests?: string };
135+
keyTakeaways?: string[]; // rendered as a highlighted summary card
136+
furtherReading?: { title: string; url: string }[];
137+
};
138+
```
139+
140+
All new fields optional, so existing lessons keep working.
141+
142+
---
143+
144+
## Implementation order (recommended)
145+
146+
1. Markdown rendering + callouts + code copy button. Biggest visual win, smallest effort.
147+
2. Mermaid diagrams. Add 2-3 diagrams to HTML and JS fundamentals as proof.
148+
3. Inline quiz component + quiz data for one track.
149+
4. Sandpack playground for JS basics.
150+
5. XP, streak, daily challenge on the Learning Hub home.
151+
6. TCS / company exam module.
152+
7. React Flow concept maps per track.
153+
8. AI tutor endpoint.
154+
9. Flashcards and spaced repetition.
155+
10. Certificates and weekly digest.
156+
157+
---
158+
159+
## Files that will change
160+
161+
- [client/src/module/student/learn/LearnHubPage.tsx](client/src/module/student/learn/LearnHubPage.tsx): add daily challenge, streak, XP widgets.
162+
- New: [client/src/components/learn/](client/src/components/learn/) folder with `LessonContent.tsx`, `Mermaid.tsx`, `Quiz.tsx`, `Playground.tsx`, `Callout.tsx`, `ConceptMap.tsx`.
163+
- Each track's lesson renderer page (e.g. [DataAnalyticsLessonsPage.tsx](client/src/module/student/data-analytics/DataAnalyticsLessonsPage.tsx)) swaps its current text renderer for `<LessonContent content={lesson.content} />`.
164+
- New server module: `server/src/modules/learn-progress/` for XP, streaks, bookmarks, notes. Follows the routes/controller/service/validation pattern from CLAUDE.md.
165+
- New server module: `server/src/modules/learn-chat/` for AI tutor.
166+
- Prisma: new models `LessonProgress`, `LessonNote`, `LessonBookmark`, `QuizAttempt`, `DailyChallenge`, `UserStreak`. Confirm before creating migrations (per CLAUDE.md).
167+
168+
---
169+
170+
## TL;DR
171+
172+
Do not convert JSON to markdown files. Instead, let the `explanation` field contain markdown, render it richly, and add optional structured fields for diagrams, quizzes, playgrounds, and charts. Then layer on gamification (XP, streaks, daily challenge), a TCS/company exam bank, an AI tutor, and React Flow concept maps. That is what will actually bring students back, not a file-format swap.

.claude/settings.local.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"Bash(/c/Codes/internhack/server/src/module/recruiter/recruiter.service.ts:*)",
77
"Bash(npx tsc:*)",
88
"Bash(echo:*)",
9-
"Bash(npx prisma db push:*)",
9+
"Bash(npx prisma db push:*)",
1010
"Bash(npx prisma generate:*)",
1111
"Bash(npm run dev:*)",
1212
"Bash(node -e:*)",
@@ -25,7 +25,8 @@
2525
"Bash(npx tsx src/module/career/career.seed.ts)",
2626
"Bash(npx vite build)",
2727
"Bash(python3:*)",
28-
"Bash(npx prisma db pull:*)"
28+
"Bash(npx prisma db pull:*)",
29+
"Skill(seo-audit)"
2930
]
3031
}
3132
}
File renamed without changes.
File renamed without changes.

client/index.html

Lines changed: 79 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,78 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66

77
<!-- Primary Meta Tags -->
8-
<title>InternHack AI-Powered Career Platform for Students</title>
8+
<title>InternHack: AI-Powered Career Platform for Students</title>
99
<meta
1010
name="description"
11-
content="Browse curated internships, score your resume with AI-powered ATS analysis, follow guided career roadmaps, explore companies, and connect directly with recruiters all in one platform."
11+
content="Browse curated internships, score your resume with AI-powered ATS analysis, follow guided career roadmaps, explore companies, and connect directly with recruiters, all in one platform."
1212
/>
1313
<meta name="author" content="InternHack" />
14-
<meta name="robots" content="index, follow" />
14+
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1" />
15+
<meta name="googlebot" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1" />
1516
<meta name="theme-color" content="#030712" />
17+
<meta name="application-name" content="InternHack" />
18+
<meta name="apple-mobile-web-app-title" content="InternHack" />
19+
<meta name="apple-mobile-web-app-capable" content="yes" />
20+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
21+
<meta name="format-detection" content="telephone=no" />
1622

17-
<!-- Favicon -->
23+
<!-- Favicon and Manifest -->
1824
<link rel="icon" type="image/png" href="/favicon.png" />
1925
<link rel="apple-touch-icon" href="/favicon.png" />
26+
<link rel="manifest" href="/manifest.webmanifest" />
2027

2128
<!-- Open Graph / Facebook -->
2229
<meta property="og:type" content="website" />
2330
<meta property="og:url" content="https://www.internhack.xyz/" />
2431
<meta
2532
property="og:title"
26-
content="InternHack AI-Powered Career Platform for Students"
33+
content="InternHack: AI-Powered Career Platform for Students"
2734
/>
2835
<meta
2936
property="og:description"
3037
content="Browse curated internships, score your resume with AI-powered ATS analysis, follow guided career roadmaps, and connect with recruiters."
3138
/>
3239
<meta property="og:image" content="https://www.internhack.xyz/og-image.png" />
40+
<meta property="og:image:width" content="1200" />
41+
<meta property="og:image:height" content="630" />
42+
<meta property="og:image:alt" content="InternHack, AI-powered career platform for students" />
3343
<meta property="og:site_name" content="InternHack" />
3444
<meta property="og:locale" content="en_US" />
3545

3646
<!-- Twitter -->
3747
<meta name="twitter:card" content="summary_large_image" />
3848
<meta name="twitter:url" content="https://www.internhack.xyz/" />
49+
<meta name="twitter:site" content="@internhack" />
50+
<meta name="twitter:creator" content="@internhack" />
3951
<meta
4052
name="twitter:title"
41-
content="InternHack AI-Powered Career Platform for Students"
53+
content="InternHack: AI-Powered Career Platform for Students"
4254
/>
4355
<meta
4456
name="twitter:description"
4557
content="Browse curated internships, score your resume with AI-powered ATS analysis, follow guided career roadmaps, and connect with recruiters."
4658
/>
4759
<meta name="twitter:image" content="https://www.internhack.xyz/og-image.png" />
60+
<meta name="twitter:image:alt" content="InternHack, AI-powered career platform for students" />
4861

49-
<!-- Canonical -->
50-
<link rel="canonical" href="https://www.internhack.xyz/" />
62+
<!-- NOTE: Per-route canonical is injected at runtime by the <SEO> component
63+
(react-helmet-async). A hard-coded canonical was removed so deep routes
64+
no longer self-canonicalize to the homepage in the pre-JS HTML. -->
5165

5266
<!-- Structured Data (JSON-LD) -->
67+
<script type="application/ld+json">
68+
{
69+
"@context": "https://schema.org",
70+
"@type": "WebSite",
71+
"name": "InternHack",
72+
"url": "https://www.internhack.xyz",
73+
"potentialAction": {
74+
"@type": "SearchAction",
75+
"target": "https://www.internhack.xyz/jobs?search={search_term_string}",
76+
"query-input": "required name=search_term_string"
77+
}
78+
}
79+
</script>
5380
<script type="application/ld+json">
5481
{
5582
"@context": "https://schema.org",
@@ -78,8 +105,6 @@
78105
]
79106
}
80107
</script>
81-
82-
<!-- Organization Schema -->
83108
<script type="application/ld+json">
84109
{
85110
"@context": "https://schema.org",
@@ -88,18 +113,18 @@
88113
"url": "https://www.internhack.xyz",
89114
"logo": "https://www.internhack.xyz/favicon.png",
90115
"description": "AI-powered career platform connecting students with internships, coding tutorials, and career tools.",
91-
"sameAs": []
116+
"sameAs": [
117+
"https://github.com/SachinChaurasiya/InternHack"
118+
]
92119
}
93120
</script>
94121

95-
<!-- DNS Prefetch for external domains -->
96-
<link rel="dns-prefetch" href="https://fonts.googleapis.com" />
97-
<link rel="dns-prefetch" href="https://fonts.gstatic.com" />
122+
<!-- Preconnect to critical origins (preconnect supersedes dns-prefetch) -->
123+
<link rel="preconnect" href="https://fonts.googleapis.com" />
124+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
98125
<link rel="dns-prefetch" href="https://www.googletagmanager.com" />
99126

100127
<!-- Fonts (non-blocking) -->
101-
<link rel="preconnect" href="https://fonts.googleapis.com" />
102-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
103128
<link
104129
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap"
105130
rel="stylesheet"
@@ -109,17 +134,47 @@
109134
<noscript>
110135
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap" rel="stylesheet" />
111136
</noscript>
137+
138+
<!-- Google tag (gtag.js) -->
139+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4YT8LFNN50"></script>
140+
<script>
141+
window.dataLayer = window.dataLayer || [];
142+
function gtag(){dataLayer.push(arguments);}
143+
gtag('js', new Date());
144+
gtag('config', 'G-4YT8LFNN50');
145+
</script>
112146
</head>
113-
<!-- Google tag (gtag.js) -->
114-
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4YT8LFNN50"></script>
115-
<script>
116-
window.dataLayer = window.dataLayer || [];
117-
function gtag(){dataLayer.push(arguments);}
118-
gtag('js', new Date());
119-
gtag('config', 'G-4YT8LFNN50');
120-
</script>
121147
<body>
122148
<div id="root"></div>
149+
<noscript>
150+
<div style="max-width:780px;margin:40px auto;padding:24px;font-family:system-ui,sans-serif;line-height:1.6;color:#111">
151+
<h1>InternHack: AI-Powered Career Platform for Students</h1>
152+
<p>
153+
InternHack helps students land their first internship and build a career in tech.
154+
Browse curated internships, score your resume with AI-powered ATS analysis,
155+
follow guided career roadmaps, explore companies, and connect directly with recruiters.
156+
</p>
157+
<h2>What you can do on InternHack</h2>
158+
<ul>
159+
<li><a href="/jobs">Internship and job board</a>, curated listings from top companies.</li>
160+
<li><a href="/ats">AI ATS resume scorer</a>, get an instant score and actionable fixes.</li>
161+
<li><a href="/companies">Company explorer</a>, research employers before you apply.</li>
162+
<li><a href="/roadmap">Career roadmaps</a>, step-by-step guidance for frontend, backend, data, and more.</li>
163+
<li><a href="/dsa">DSA practice tracker</a>, organized problems with progress tracking.</li>
164+
<li><a href="/blog">Blog and guides</a>, interview prep, career advice, and tutorials.</li>
165+
<li><a href="/opensource">Open-source projects</a>, contribute to real codebases.</li>
166+
</ul>
167+
<h2>For recruiters</h2>
168+
<p>
169+
Post roles, review AI-ranked candidates, and reach motivated student talent.
170+
<a href="/recruiters">Learn more about recruiter tools</a>.
171+
</p>
172+
<p>
173+
InternHack is a free, AI-powered career platform.
174+
JavaScript is required to use the full application. Please enable JavaScript in your browser.
175+
</p>
176+
</div>
177+
</noscript>
123178
<script type="module" src="/src/main.tsx"></script>
124179
</body>
125180
</html>

0 commit comments

Comments
 (0)