How vnoi-admin/utilities-v2 works
Main Components
• Frontend: The “admin-panel” app in the apps directory, which is a Vue-based interface (includes App.vue, router, components, layouts, etc.) and is accessible at port 8000.
• Backend Microservices: There are several, each residing in its own subdirectory under apps:
– Auth Service: Handles authentication logic and related API endpoints (port 8002 as per README).
– User Service: Manages user-related operations, including groups, tasks, and VPN configurations.
– Internal Service: Likely used for internal application support (includes modules for group, overlay, and user).
– Printing Service: Responsible for managing printing functionalities and tasks.
• Shared Libraries: These provide cross-cutting features:
– libs/api: Likely offers API definitions or helper functions for communication between services.
– libs/common-db: Contains database modules and schemas for MongoDB models (group, overlay, printClient, printJob, user).
– libs/common: Implements decorators, DTOs, guards, helpers, etc., to be reused across services.
– libs/utils: Provides utility functions such as cryptography (key generation, etc.).
Additional Components and Infrastructure
• Database: MongoDB (as per Requirements) that is accessed by many backend microservices, likely through the common-db library.
• Configurations and Deployment:
– The config folder contains Nginx configuration files which could be acting as a reverse proxy or load balancer.
– Docker files in services and docker-compose.yaml are used to containerize and deploy the different applications.
– Yarn and Turbo (via turbo.json) are used for dependency management and workspaces, indicating a monorepo management strategy.
Relationships and Interactions
• The frontend admin-panel communicates with one or more backend microservices (auth, user, etc.) over HTTP/REST APIs (for example, the admin panel’s API endpoints may be consumed from these services).
• The microservices interact with a central MongoDB database (either directly or indirectly via the common-db library).
• Shared libraries form an underlying layer of common functionality and data structures that service modules leverage to standardize communication, validation, and business logic.
• Docker and Nginx configurations indicate orchestration between services, where Nginx might be directing traffic between the frontend and individual backend services.
Architectural Patterns and Design Principles
• Microservices Architecture: Each service is modularized (auth, user, printing, internal) and is potentially containerized for independent deployment.
• Separation of Concerns: There is a clear separation between the frontend (admin-panel) and various backend services.
• Shared Libraries: Encourage DRY (Don’t Repeat Yourself) principles by centralizing common features like database interaction (schemas, services) and authentication logic.
• Use of Docker and Nginx for container orchestration and traffic routing.
• Use of Docker for containerizing services and the role of Nginx in dispatching client requests appropriately.