System Architecture
Overview of the system architecture, design decisions, and data flow.
Last updated: 2025-07-02
· 1 min read
System Architecture
This document describes the architecture of our Zero-Database content management system.
High-Level Design
The system follows a simple flow:
Markdown Files → Content Loader → In-Memory Cache → Express Routes → EJS Templates → HTML
Core Components
1. Content Loader
The contentLoader.js service reads all Markdown files and JSON data at startup:
import { readFileSync } from 'node:fs';
import { glob } from 'glob';
export async function initializeApplicationData() {
// Load all content files in parallel
const [blogFiles, docFiles] = await Promise.all([
glob('content/blog/**/*.md'),
glob('content/docs/**/*.md')
]);
// ... parse and cache
}
2. In-Memory Cache
All data is stored in a singleton cache object:
export const cache = {
blogs: [],
docs: [],
projects: [],
socials: [],
navigation: [],
config: {}
};
3. Markdown Processing Pipeline
Note
The pipeline processes Markdown through multiple custom plugins in a specific order for correct rendering.
- Inline code highlighting
- Media player (images/audio/video detection)
- GitHub-style anchors
- Table of Contents
- Multimd-table
- Admonitions
- macOS code blocks with syntax highlighting
- Figure plugin
- Image lazy loading
- Tab plugin
- Dokapi (API documentation)
- Custom tabs
Data Flow
Request → Middleware → Controller → Service (cache) → View (EJS) → Response
Deployment
The app runs on Vercel’s serverless infrastructure with cold-start handling:
- Cold start: Initializes cache from disk
- Warm start: Reuses existing in-memory cache
- Guard middleware: Holds requests until initialization completes