How doitsu2014/my-cms works
Overall System Components
• Application Core: The “application_core” directory encapsulates the domain logic with command handlers (create, read, modify, delete) for different entities (category, media, post, tag).
• Database & ORM Layer: The project uses SeaORM to interact with a PostgreSQL database (as defined in the .env file). Also include “entities” in both “application_core/src/entities” and related migration scripts in the “migration” directory.
• Deployment and Infrastructure: There are Docker files, Helm charts (in the deployments/charts folder), and Github Actions workflows for CI/CD pipelines. Don’t forget to include external tools such as Jaeger for tracing.
• Configuration & Cross-Cutting Concerns: The .env file centralizes configuration (e.g., database, port, media settings, and OTLP exporter settings). Jaeger is used for tracing performance and logging.
• Testing: Recognize that there are both unit test helpers in “test_helpers” and integration test setups (using testcontainers).
Relationships and Interactions
• Requests from external clients (via REST or GraphQL) hit the API layer (src/api). These controllers then translate the requests into commands that pass to the application core.
• The application core’s command handlers execute the necessary business logic, interacting with entities generated by SeaORM to perform DB operations.
• The database layer communicates with external PostgreSQL. Migrations (in migration directory) update the schema.
• Deployment components (Docker & Helm charts) manage the containerization and orchestration of the system in production. CI/CD workflows tie into this process.
• Cross-cutting services such as Jaeger’s tracing and possibly S3-based media storage (configured via environment variables) are integrated as needed.
Architectural Patterns and Key Design Principles
• Modular Command-based Architecture: Notice how commands for different entities (category, media, post, tag) are kept in separate folders with clear “create”, “read”, “modify”, “delete” submodules.
• Layered Structure: The clear separation between the API (controllers) and the application core (business logic) illustrates a clean separation of concerns.
• Database Abstraction: SeaORM is used as an ORM to abstract database operations, implying a potential repository or data access pattern.
• Containerization & CI/CD: The Dockerfile, helm charts, and GitHub workflows highlight a modern DevOps approach.
• Traceability: Integration with Jaeger for distributed tracing adds an observability layer to the system.
Additional Recommendations
• Cross-functional components that appear in multiple parts of the codebase – for example, a common “src/common” shared between API and library logic.
• That configuration is externalized, using the .env file, and affects various parts of the system (API settings, database connections, S3 configuration, tracing).
• Notes on testing and CI/CD: show how the “test_helpers” and GitHub workflows integrate with the development and deployment processes.