How parklez/blog works
Main Components
• Frontend (Client-side): Represented by the “blog” directory. This is an Angular application that handles the user interface, routing for different pages (home, about, post-reader, login, register, projects, etc.), and client-side logic. Highlight key modules (e.g., home, about, login-signin, register-signup, shared components) and show that these modules interact with backend APIs via HTTP.
• Backend (Server-side): Found in the “server” directory. This NodeJS application provides RESTful APIs (CRUD operations for posts, authentication flows, and project management endpoints). It includes configuration files (found in the “config” subdirectory), models for blog posts, projects, and users, and uses routing files to define API endpoints.
• Database: Indicated by files such as “server/src/config/database.js” and “server/src/lib/mongo.js” (implying a MongoDB connection). Represent this external dependency that the backend communicates with for persistent data storage.
• Static Content and Markdown Posts/Projects: The “_posts” and “_projects” directories hold markdown files and related content. These may be used for static content generation (potentially in tandem with GitHub Pages as outlined in the README) and might be pre-compiled.
• CI/CD / Deployment Tools: The “.github” directory with workflows (e.g., gh-pages.yml) signals usage of GitHub Actions for deployment, specifically for updating the GitHub Pages hosting the static content.
Relationships & Interactions
• The Angular “blog” client interacts with the NodeJS server over defined API endpoints (such as for CRUD operations on posts and user authentication).
• The server processes requests from the frontend, performs business logic, and communicates with the MongoDB database for data persistence.
• Markdown static assets in “_posts” and “_projects” might be pre-compiled or integrated into the static content served by GitHub Pages, potentially via build scripts.
• Continuous integration and deployment are handled through GitHub workflows to deploy the latest versions automatically.
Architectural Patterns & Technologies
• MVC or Modular Pattern: The separation in the “blog” folder (with multiple modules, components, routing, services, and shared assets) indicates an MVC-like structure in Angular.
• RESTful API Design: In the “server” directory, routing is organized by resource (e.g., posts, projects, login, register).
• Authentication middleware exists (e.g., in “server/src/middleware/auth.js”) suggesting the use of token-based or session-based security.
• The use of NodeJS and likely Express.js (given the file structure) for building server routes.
• GitHub Actions for automated CD/CI processes.
• Database integration with MongoDB.