How qiayue/gitbase works
Main Components
a) Client-Side Layer:
• Next.js Frontend (src/app directory)
• UI Components (src/components)
• Admin Interface (/admin routes)
• Authentication System (login-related components)
b) Server-Side Layer:
• Next.js API Routes (src/app/api)
• Authentication Middleware (middleware.js)
• Content Management System
c) External Services:
• GitHub API (for content storage)
• Vercel (for deployment)
[Client Layer]
• ↕
[Server Layer]
• ↕
[External Services]
Detailed Component Breakdown
Client Layer (Top):
• Public Pages (/, /posts, /resources)
• Admin Interface (/admin/*)
• UI Components
• Authentication Forms
• Use orange for admin-related components
Server Layer (Middle):
• API Routes Handler
• Authentication Middleware
• Content Processing (Markdown → HTML)
• GitHub Integration Logic
• Use green for API components
• Use yellow for middleware components
External Services (Bottom):
• GitHub Repository
• data/json (content storage)
• data/md (markdown files)
• Vercel Platform
• Use purple for external services
Data Flow Indicators
• Client-to-Server API calls
• Server-to-GitHub content operations
• Authentication flow
• Content update flow
Admin UI → API Routes → GitHub API → Repository
• ↑ ↓
• Content Sync ───────────┘
Login Page → API Routes → Middleware → Protected Routes
Important Notes
• Database-free architecture
• GitHub integration as a primary storage mechanism
• Admin interface's connection to content management
• Authentication boundary between public and protected routes