How ishant-kb/codewithishant works
1. Project shape
- This is a Next.js App Router site written in TypeScript.
- The architecture is predominantly content-driven and file-system based: most user-facing pages are generated from MDX content stored under src/content, with helper functions in src/lib turning that content into page data.
2. Primary rendering boundary
- src/app defines the route tree and page composition.
- src/components holds reusable UI and feature components used across routes.
- src/lib contains the data-access and transformation layer that reads content, builds indexes, computes metadata, and supplies navigation structures.
3. Content sources
- The repository separates authored content by domain:
- src/content/blog/* for blog posts
- src/content/notes/* for notes
- src/content/learn/* for learning material, currently present but not clearly wired to a top-level route in the tree
- Content is mostly .mdx, which means articles can mix prose with React components.
4. Blog subsystem
- Blog routes live under src/app/blog, including category pages and nested post pages.
- Supporting logic is in src/lib/blog:
- fetching all posts
- fetching a single post
- filtering by category
- computing adjacent posts, related posts, and series posts
- This indicates the blog is not just a flat list; it supports taxonomy, sequencing, and related-content navigation.
5. Notes subsystem
- Notes mirror the blog architecture under src/app/notes, with category and slug-based detail pages.
- src/lib/notes provides the same kind of content lookup and relationship logic as blog, which suggests notes are another structured content corpus rather than a separate app.
- The symmetry implies a shared presentation model but distinct content sets and routes.
6. MDX/article rendering pipeline
- src/components/features/article contains the article-specific rendering stack:
- mdx-components.tsx
- mdx-options.ts
- CodeBlock.tsx
- TableOfContents.tsx
- src/lib/content supports article enrichment:
- heading extraction
- table-of-contents generation
- reading-time calculation
- metadata handling
- tag extraction
- The flow is: MDX content → parsing/enrichment in lib/content → rendered article UI with custom MDX components.
7. Search architecture
- Search is a dedicated subsystem, not just a UI widget.
- src/lib/search contains:
- text extraction from MDX
- normalization
- search logic
- index generation/building
- A generated public/search-index.json suggests search is precomputed at build time and consumed client-side.
- UI entry points are src/app/search, src/components/features/search/Search.tsx, and CommandPalette.tsx, indicating both a full search page and an in-app quick-search experience.
8. Navigation and site structure
- src/components/features/navigation provides shared chrome:
- Navbar
- Sidebar
- Breadcrumbs
- src/lib/navigation/getSidebar.ts likely derives sidebar structure from the content tree.
- This means global navigation is content-aware, not hand-maintained in each page.
9. Visualizers subsystem
- src/app/visualizers exposes a separate browsing area for visual tools or demos.
- src/lib/visual/visualizer.ts suggests a registry or descriptor layer for visualizer pages.
- public/visualizers/bubbleSort/bubbleSort.html shows at least one visualizer is a static HTML asset, implying this area mixes Next.js pages with standalone static demo files.
10. Global layout and shared UI
- src/app/layout.tsx and src/app/globals.css define the site-wide shell and base styling.
- Feature routes such as about, contact, explore, search, and the content sections likely compose within this shared shell.
- Styling is a mix of global CSS and CSS modules for page-specific areas like about and contact.
11. SEO and static metadata
- src/app/sitemap.ts indicates automatic sitemap generation.
- public/robots.txt and public/site.webmanifest show the site is prepared for crawlability and installability.
- This is consistent with a content site optimized for search discovery rather than a highly dynamic app.
12. Build/runtime characteristics
- There is no obvious backend, database, or API layer in the tree.
- The architecture appears to be static or hybrid-rendered content served by Next.js, with most data sourced from the repository at build time or request time from local files.
- Deployment is likely optimized for Vercel, matching the Next.js defaults in the README.
13. Reusable type and utility layer
- src/types/content.ts centralizes content-shaped types.
- The utility libraries under src/lib appear to be the main contract between raw MDX content and route components.
- This reduces coupling: route pages stay thin while content logic remains in shared helpers.
14. Overall data flow
- Authored MDX and static assets live in src/content and public.
- Helper modules in src/lib parse, index, and enrich that content.
- Route files in src/app request those helpers and render pages.
- Shared feature components in src/components handle article display, navigation, search, and UI affordances.
Main entry points: layout.tsx Site shell · search Search index · blog Blog data · notes Notes data
Components 26
App routes
Next.js App Router pages and route segments.
- Site shell · Global app layout and base styles.
src/app/layout.tsx - Home · Top-level landing page.
src/app/page.tsx - Blog index · Blog listing route.
src/app/blog/page.tsx - Blog category · Category listing for blog posts.
src/app/blog/[category]/page.tsx - Blog post · Nested blog post detail page.
src/app/blog/[category]/[slug]/page.tsx - Notes index · Notes listing route.
src/app/notes/page.tsx - Notes category · Category listing for notes.
src/app/notes/[category]/page.tsx - Note detail · Nested note detail page.
src/app/notes/[category]/[slug]/page.tsx - Search · Dedicated search page.
src/app/search/page.tsx - Visualizers · Browse visual demo pages.
src/app/visualizers/page.tsx - Visualizer · Single visualizer detail page.
src/app/visualizers/[slug]/page.tsx
Content sources
MDX content organized by domain.
Lib layer
Content access, indexing, and transformation helpers.
- Blog data · Fetches blog posts and relationships.
src/lib/blog - Notes data · Fetches notes and relationships.
src/lib/notes - Content enrich · Shared article enrichment helpers for MDX content.
src/lib/content - Search index · Extracts text, normalizes it, and builds search indexes.
src/lib/search - Sidebar data · Derives navigation structure from content.
src/lib/navigation/getSidebar.ts - Visualizer registry · Descriptor layer for visualizer pages.
src/lib/visual/visualizer.ts
Components
Reusable feature and shared UI components.
- Article UI · Custom MDX components, code blocks, and table of contents.
src/components/features/article - Navigation UI · Navbar, sidebar, and breadcrumbs.
src/components/features/navigation - Search UI · Search page and command palette experiences.
src/components/features/search - Shared UI · General reusable UI and status components.
src/components/ui
Public assets
Static files and generated artifacts served from public.
- Search index · Precomputed client-consumable search data.
public/search-index.json - Bubble sort demo · Standalone visualizer HTML asset.
public/visualizers/bubbleSort/bubbleSort.html
Connections 29
- Blog MDX → Blog data: read posts · Blog content is read and structured by blog helpers.
- Notes MDX → Notes data: read notes · Notes content is read and structured by notes helpers.
- Learn MDX → Content enrich: enrich mdx · Shared content utilities can process learning MDX as well.
- Blog data → Blog index: feed list · Blog listing pages consume post collections.
- Blog data → Blog category: filter category · Category pages are built from category-filtered posts.
- Blog data → Blog post: resolve post · Detail pages load a single post and related navigation data.
- Notes data → Notes index: feed list · Notes listing pages consume note collections.
- Notes data → Notes category: filter category · Category pages are built from category-filtered notes.
- Notes data → Note detail: resolve note · Detail pages load a single note and related navigation data.
- Content enrich → Article UI: render mdx · MDX enrichment powers article presentation.
- Content enrich → Blog post: article data · Post pages use headings, metadata, reading time, and tags.
- Content enrich → Note detail: article data · Note pages use the same enrichment pipeline.
- Search index → Search index: build index · Search data is precomputed into a static JSON artifact.
- Search index → Search UI: query data · Search interfaces consume normalized search helpers.
- Search index → Blog MDX: index text · Search indexes authored blog content.
- Search index → Notes MDX: index text · Search indexes authored notes content.
- Sidebar data → Navigation UI: structure nav · Sidebar and breadcrumb structure is content-aware.
- Visualizer registry → Visualizers: list demos · Visualizer registry drives the browse page.
- Visualizer registry → Visualizer: resolve demo · Detail pages resolve a specific visualizer descriptor.
- Bubble sort demo → Visualizer: static asset · At least one visualizer is served as standalone HTML.
- Site shell → Home: shell · All routes render within the global app shell.
- Site shell → Blog index: shell · All routes render within the global app shell.
- Site shell → Notes index: shell · All routes render within the global app shell.
- Site shell → Search: shell · All routes render within the global app shell.
- Site shell → Visualizers: shell · All routes render within the global app shell.
- Navigation UI → Blog post: site chrome · Shared navigation appears across content pages.
- Navigation UI → Note detail: site chrome · Shared navigation appears across content pages.
- Search UI → Search: page ui · Search route renders dedicated search components.
- Shared UI → Search UI: support · General UI primitives support search interactions.