How moolakarapasanga/smartsunil works
Purpose and runtime
A Next.js TypeScript security-research publishing site. It serves a portfolio/home experience plus an MDX-backed cybersecurity blog organized by category. The application runs on the Next.js server/runtime and is built/deployed through standard next build / next start commands.
Core application shell and global document behavior originate in:
• app/layout.tsx
• app/page.tsx
• app/globals.css
Route layer and entry points
The App Router defines public pages for the home, portfolio, blog index, post detail, category archives, sign-in, and a specialized birthday page. Dynamic route segments turn requested slugs/categories into content queries.
Primary routes:
• app/blog/page.tsx
• app/blog/[slug]/page.tsx
• app/category/[category]/page.tsx
Supporting platform routes provide error/not-found handling and crawler metadata:
• app/error.tsx
• app/not-found.tsx
• app/sitemap.ts
Content repository and publication model
Posts are filesystem-managed MDX documents under content/posts/<category>/<slug>.mdx; frontmatter supplies post metadata. This is a content-at-build/request boundary rather than a database or CMS integration. Adding a post requires only creating an MDX file, with no component registration.
Representative content and category partitioning:
• content/posts/android/android-ssl-pinning.mdx
• content/posts/ai-security/understanding-prompt-injection.mdx
• content/posts/web/http-request-smuggling.mdx
Content discovery, metadata, and rendering pipeline
Blog pages use library code to enumerate post files, parse metadata/content, resolve a post slug, and derive category listings. MDX is then rendered with a controlled component map, allowing article authors to use site-native callouts, code blocks, commands, and HTTP request/response displays.
Pipeline boundaries:
1. Route receives slug/category.
2. Content access layer reads and resolves MDX/frontmatter.
3. Blog UI composes article chrome/navigation.
4. MDX renderer maps article markup to approved React components.
Key paths:
• lib/posts.ts
• lib/mdx.ts
• components/mdx/MDXComponents.tsx
Blog presentation architecture
The blog layout separates reusable article cards/shell/navigation from route-specific data loading. Detail pages can provide sidebar and table-of-contents structures around rendered article content, while list/category pages reuse cards.
Key components:
• components/blog/BlogShell.tsx
• components/blog/BlogCard.tsx
• components/blog/TableOfContents.tsx
Categories are governed by shared configuration and library access rather than duplicated route constants:
• config/categories.ts
• lib/categories.ts
• types/blog.ts
Shared site chrome and interactive client features
A shared chrome layer supplies header, footer, responsive navigation, and likely wraps route content consistently. Home-specific sections are isolated from the blog system. Client interactions include theme switching, copy controls, logout, and birthday audio playback.
Key paths:
• components/layout/SiteChrome.tsx
• components/layout/Header.tsx
• components/home/Hero.tsx
Authentication boundary and external dependencies
Authentication is represented by login/logout route handlers and a sign-in page; the tree does not expose the backing identity provider, session store, or database. Environment configuration is expected via .env.example, making credentials/service selection deployment-provided rather than content-layer-owned.
Auth endpoints and consumer UI:
• app/api/login/route.ts
• app/api/logout/route.ts
• app/sign-in/page.tsx
There is no visible persistent data store, external CMS, or separate backend service in the repository tree; filesystem MDX is the primary content source.
Main entry points: layout.tsx App shell · [slug]/page.tsx Post detail · posts.ts Post discovery · blog/page.tsx Blog index
Components 19
Next.js application
- Next.js runtime · Builds and serves the App Router application.
- App shell · Global document structure and styles.
app/layout.tsx - Home page
app/page.tsx - Blog index
app/blog/page.tsx - Post detail · Resolves a requested post slug.
app/blog/[slug]/page.tsx - Category archive · Resolves a requested category.
app/category/[category]/page.tsx - Error and crawler routes · Error, not-found, and sitemap handling.
app/error.tsx
MDX publishing
- Filesystem MDX posts · Category-partitioned MDX documents with frontmatter.
content/posts/android/android-ssl-pinning.mdx - Post discovery · Enumerates, parses, and resolves post content.
lib/posts.ts - Category model · Shared category definitions and lookup access.
config/categories.ts - MDX renderer · Renders MDX through an approved component map.
lib/mdx.ts
Presentation
- Site chrome · Shared header, footer, and responsive navigation.
components/layout/SiteChrome.tsx - Home sections
components/home/Hero.tsx - Blog shell · Article chrome and navigation composition.
components/blog/BlogShell.tsx - Blog cards · Reusable post previews for listing pages.
components/blog/BlogCard.tsx - MDX component map · Site-native callouts, code, commands, and HTTP displays.
components/mdx/MDXComponents.tsx
Authentication
- Sign-in page
app/sign-in/page.tsx - Login endpoint · Identity provider and session backing are deployment-provided.
app/api/login/route.ts - Logout endpoint
app/api/logout/route.ts
Connections 19
- Next.js runtime → App shell: serves
- App shell → Site chrome: wraps
- App shell → Home page: hosts
- App shell → Blog index: hosts
- App shell → Post detail: hosts
- App shell → Category archive: hosts
- Home page → Home sections: composes
- Blog index → Post discovery: lists posts
- Blog index → Blog cards: renders
- Post detail → Post discovery: resolves slug
- Category archive → Post discovery: lists category posts
- Category archive → Category model: validates category
- Post discovery → Filesystem MDX posts: reads MDX and frontmatter
- Post detail → Blog shell: composes article
- Post detail → MDX renderer: renders content
- MDX renderer → MDX component map: maps markup to
- Sign-in page → Login endpoint: submits credentials
- Site chrome → Logout endpoint: logs out through
- Next.js runtime → Error and crawler routes: handles