How mark0-22/personal-blog works
Main System Components
a) Frontend Layer:
• Views (EJS Templates)
• Admin section
• Guest section
• Shared components (includes)
• Static Assets
• CSS files
b) Backend Layer (NestJS):
• Controllers
• Services
• Modules
• Middleware
• DTOs (Data Transfer Objects)
• Entities
Architectural Pattern Representation
a) Core Module Layer:
• AppModule (root module)
• ArticleModule (feature module)
b) MVC Pattern:
• Controllers (handling HTTP requests)
• Services (business logic)
• Views (EJS templates)
┌─────────────────────────────────────────────────────────┐
• Client Browser │
• ┘
• ↕
┌─────────────────────────────────────────────────────────┐
• NestJS Application │
• ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
• Views │ │ Controllers │ │ Services │ │
• (EJS) │←───│ │←───│ │ │
• ┘ └─────────────┘ └─────────────┘ │
• ↑ ↑ ↑ │
• ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
• Static │ │ DTOs │ │ Entities │ │
• Assets │ │ │ │ │ │
• ┘ └─────────────┘ └─────────────┘ │
• ↑ │
• ┌─────────────┐ ┌─────────────┐ │
• Auth │ │ Article │ │
• Middleware │ │ Module │ │
• ┘ └─────────────┘ │
• ┘
Component Relationships
• Client → Auth Middleware → Controllers
• Controllers ↔ Services
• Services ↔ Entities
• Controllers → Views
• Views → Static Assets
Notes for Implementation
• NestJS's modular architecture
• MVC pattern implementation
• Authentication flow
• Separation between admin and public access
• Template rendering with EJS
• Static file serving
This architecture represents a typical NestJS application with server-side rendering using EJS templates, following RESTful principles for article management, and implementing authentication for admin access.