How akshay0611/blogvista works
Main System Components
a) Frontend Layer:
• Next.js App Router (indicated by the /app directory structure)
• UI Components (in /components directory)
• Client-side Theme Management
• Static Pages (about, contact, privacy, terms)
• Dynamic Blog Posts
b) Backend Layer:
• API Routes (in /pages/api)
• Database Connection Layer (in /lib/dbConnect.js)
• Data Models (in /models)
c) Database:
• MongoDB (as mentioned in README)
┌─────────────────────────────────────────┐
• Client │
• ┌─────────────┐ ┌────────────────────┐ │
• Static │ │ Dynamic Pages │ │
• Pages │ │ (Blog Posts) │ │
• ┘ └────────────────────┘ │
• ┌─────────────────────────────────────┐ │
• UI Components Layer │ │
• (Header, Footer, FeaturedPosts) │ │
• ┘ │
• ┬─────────────────────┘
┌───────────────────▼─────────────────────┐
• Next.js API Routes │
• (/pages/api/blogs/*) │
• ┬─────────────────────┘
┌───────────────────▼─────────────────────┐
• Database Connection Layer │
• (lib/dbConnect.js) │
• ┬─────────────────────┘
┌───────────────────▼─────────────────────┐
• MongoDB │
• (Blog Data Store) │
• ┘
Component Relationships
Key interactions:
• Client-to-API communication for blog posts
• API-to-Database flow through dbConnect
• Theme provider's global state management
• Dynamic routing for blog posts ([id] pages)
Technical Details
Annotations for:
• TypeScript implementation
• MongoDB connection configuration
• API route handlers
• Component composition
• Theme switching mechanism