How geniewizards/zenmo works
Main Components Identification
• Common Utilities and Middlewares: Identify a shared “common” layer (src/common) that includes helper functions, middlewares (e.g., authentication, error handling, logging), and utility libraries. These act as cross-cutting concerns.
• External Services: Optionally, include components for external integrations like authentication services (using Lucia Auth) or any external API that may interact with the OpenAPI documentation.
• Containerization & Deployment: Highlight Docker and Docker Compose configuration files (Dockerfile, docker-compose.yml, Makefile commands) which manage deployment and environment orchestration.
• Testing Infrastructure: Acknowledge the k6 test configuration and test scripts (inside the k6 directory) for load testing, indicating that tests are routed externally to validate API performance.
Relationships/Interactions
• Within the server, routes are directed to specific modules that handle requests, possibly via middleware (authentication, logging, error handling).
• These modules then interact with the database layer, where repositories and database adapters (using Drizzle) manage CRUD operations.
• To include dependency links from the modules and common utilities to shared middleware and helper functions.
Architectural Patterns & Design Principles
• Modular Design: The project is organized into modules; represent each module as a self-contained unit.
• Separation of Concerns: Divide the system into API routing, business logic (modules), common services (helpers, middleware), and data persistence.
• Containerization: Include Docker and Docker Compose as part of the deployment process which encapsulates the environment.
• Testing Integration: Show that tests (both unit/integration and performance tests with k6) interact with the system to ensure quality.
Relevant Technologies, Frameworks, and Libraries
• Languages & Runtimes: TypeScript, Bun.
• ORM/Database: Drizzle (with PostgreSQL).
• Authentication: Lucia Auth.
• API Documentation: OpenAPI & Scalar.
• Containerization: Docker & Docker Compose.
• Testing: Bun’s built-in testing along with k6 for performance scenarios.
Elements
• Clear labels: Ensure every component and module (like “Accounts Module”, “Auth Module”, “Database Adapter”, “Middleware”) is clearly marked.