How rahul1015s/rahulwebdev works
1. This is a Next.js App Router portfolio site for Rahul Verma, built as a hybrid of public marketing pages, a content site, and several authenticated admin/dashboard surfaces.
2. The top-level app/ directory is the main boundary. It is split into route groups for:
- public-facing pages (app/(public), app/blog, app/case-studies, landing pages, resume)
- authentication flows (app/(auth))
- authenticated admin tools (app/admin)
- authenticated personal dashboard (app/dashboard)
- API route handlers (app/api/...)
3. The public site is mostly static/SEO-driven, with reusable sections and landing components assembled from components/sections, components/landing, components/layout, and components/cards. The homepage and local-service landing pages appear to be marketing-oriented, while blog and case-study pages are content-driven.
4. Blog content is a major subsystem. There are public blog list/detail pages, blog-specific components, and API endpoints for blog data and Open Graph image generation. Blog rendering also tracks visitors, with dedicated visitor-count components and visitor-related models/API routes.
5. Case studies are a second content subsystem, parallel to blog. They have public listing/detail routes plus admin CRUD pages and API endpoints for create/read/update/delete. This suggests content is persisted in a backend datastore rather than hardcoded.
6. The admin area is a content management surface for blog posts, case studies, newsletter tools, and site settings. It uses dedicated admin components such as editors, tables, and row actions, and exposes matching /api/admin/* endpoints for server-side mutations.
7. The dashboard area is separate from admin and looks more like a personal productivity/data dashboard. It includes pages for focus and settings, plus server actions and API routes for GitHub and contest data, indicating live aggregation from external services.
8. Authentication is handled as a first-class subsystem, with pages for login, signup, magic-link, forgot-password, two-factor, and email verification. The auth implementation is split between lib/auth.ts, lib/auth-client.ts, providers/AuthProvider.tsx, and the catch-all auth API route, so auth state and session handling are centralized.
9. Persistence is MongoDB-based. The models/ directory contains schemas for posts, case studies, visitors, tags, categories, newsletter subscribers, site settings, dashboard stats, streaks, and focus-day data, which shows the app uses a document database for both content and user/activity records.
10. Cross-cutting backend logic lives in lib/. This includes API helpers, SEO configuration, blog utilities, newsletter/email templates, token handling, landing-variant selection, and dashboard integrations. The lib/dashboard/ subfolder likely orchestrates external data fetching and domain-specific transformations for the dashboard views.
11. Newsletter functionality is a standalone flow. There are public subscribe/unsubscribe/confirm/send API routes, a newsletter form component, and email template utilities, which implies email delivery and tokenized subscription confirmation are part of the architecture.
12. The app also includes infrastructure for SEO, metadata, and crawlability: custom robots/sitemap routes, a manifest, SEO helpers, and Open Graph image endpoints. That makes search visibility and share cards an explicit part of the site design.
13. Shared UI is organized by concern rather than by route. components/ui contains the design system primitives, while feature folders like components/auth, components/blog, components/dashboard, components/newsletter, and components/admin wrap those primitives into higher-level workflows.
14. Supporting providers and hooks handle global client behavior such as analytics, theming, responsive behavior, and likely auth/session context. This keeps the route components focused on page composition while shared runtime concerns stay in one place.
15. Overall data flow is: browser pages render from App Router routes, feature components call route handlers or server actions, API routes read/write MongoDB models and sometimes external services (GitHub/contest data, email delivery), and SEO/OG/robots/sitemap endpoints support discoverability and sharing.
Main entry points: layout.tsx App shell · page.tsx Blog & cases · auth.ts Backend lib · post.ts Mongo models
Components 19
Public site
Marketing pages, resume, blog, and case studies.
- Home · Primary public landing experience and service landing pages.
app/page.tsx - Blog & cases · Public blog and case-study listings/details.
app/blog/page.tsx - Resume · Resume and portfolio-oriented public pages.
app/resume/layout.tsx - Public UI · Sections, landing pieces, layout, cards, and contact components used by marketing pages.
components/sections/HeroSection.tsx - Content UI · Blog, case-study, and visitor-count presentation components.
components/blog/BlogClient.tsx
Auth flows
Login and account verification surfaces.
- Auth flows · Login, signup, magic link, password reset, 2FA, and email verification.
app/(auth)/login/page.tsx - Auth API · Catch-all auth handler that centralizes authentication state and sessions.
app/api/auth/[...all]/route.ts
Admin CMS
Authenticated content management and site settings.
- Admin console · Authenticated management surface for content and settings.
app/admin/page.tsx - Admin APIs · Server-side CRUD and site-settings/statistics endpoints for admin workflows.
app/api/admin/posts/route.ts - Admin UI · Editors, tables, row actions, and admin-specific workflows.
components/admin/PostTable.tsx
Personal dashboard
Productivity and live external-data dashboard surfaces.
- Dashboard · Personal dashboard with focus and settings views.
app/dashboard/page.tsx - Dashboard APIs · Live GitHub and contest data endpoints for the dashboard.
app/api/dashboard/github/route.ts - Dashboard UI · Dashboard navigation, shell, and focus/settings controls.
components/dashboard/dashboard-shell.tsx
Platform
Shared UI, backend helpers, persistence, and cross-cutting app infrastructure.
- App shell · Root layout and global styles for the App Router app.
app/layout.tsx - Content APIs · Blog, case-study, taxonomy, visitor, and Open Graph endpoints.
app/api/blog/route.ts - Newsletter APIs · Subscribe, confirm, unsubscribe, and send routes.
app/api/newsletter/subscribe/route.ts - Backend lib · Auth, SEO, email, newsletter templates, landing variants, dashboard integrations, and API utilities.
lib/auth.ts - Mongo models · Document schemas for posts, case studies, visitors, newsletter, settings, and dashboard activity.
models/post.ts - Client runtime · Theme, analytics, auth provider, and responsive/client behavior.
providers/AuthProvider.tsx
Connections 24
- App shell → Home: renders · Global shell hosts the public landing experience.
- App shell → Auth flows: routes · Root app boundary includes the authentication surfaces.
- App shell → Admin console: routes · Root app boundary includes the admin area.
- App shell → Dashboard: routes · Root app boundary includes the personal dashboard.
- App shell → Blog & cases: routes · Root app boundary includes blog and case-study content.
- Home → Public UI: composes · Marketing pages are assembled from shared sections and landing components.
- Blog & cases → Content UI: uses · Public content pages rely on blog and case-study feature components.
- Blog & cases → Content APIs: reads · Content pages fetch posts, cases, visitors, and SEO assets.
- Blog & cases → Mongo models: persists · Blog and case-study content are backed by MongoDB models.
- Admin console → Admin UI: composes · Admin screens are built from editors, tables, and action components.
- Admin console → Admin APIs: mutates · Admin UI talks to CRUD and settings endpoints.
- Admin APIs → Mongo models: writes · Admin handlers create, update, and delete persisted content.
- Dashboard → Dashboard UI: composes · Dashboard pages use a dedicated shell and controls.
- Dashboard → Dashboard APIs: reads · Dashboard surfaces aggregate GitHub and contest data.
- Dashboard APIs → Backend lib: uses · Dashboard routes depend on integration and transformation helpers.
- Dashboard APIs → Mongo models: reads · Dashboard stats and focus data are stored in MongoDB.
- Auth flows → Auth API: authenticates · Auth pages rely on the centralized auth route handler.
- Auth API → Backend lib: uses · Auth flow shares token, email, and auth helper logic.
- Newsletter APIs → Backend lib: uses · Newsletter endpoints use email templates and token utilities.
- Newsletter APIs → Mongo models: writes · Subscription state is stored in MongoDB.
- Content UI → Backend lib: uses · Content features use blog utilities, SEO helpers, and visitor logic.
- Public UI → Client runtime: depends on · Shared client behavior is provided by theme, analytics, and auth context.
- Admin UI → Client runtime: depends on · Admin interactions rely on shared client providers and hooks.
- Dashboard UI → Client runtime: depends on · Dashboard interactions rely on shared client providers and hooks.