How liangliang723/sun-panel works
Main Components
• Frontend Client:
• Vue.js application (present in the “src” directory, “public”, “index.html”, and assets).
• Related modules like components (apps, common, deskModule), API integration (src/api), routing (src/router), and state management (src/store).
• Backend API Server:
• Go service as a core API server, combining multiple modules (e.g., system, panel, openness) which are segmented in the “service/api/api_v1” directories.
• Middleware (e.g., AdminInterceptor, LoginInterceptor, and PublicModeInterceptor), routers (in “service/router”), and business logic (in “service/lib”, “service/global”, “service/initialize”) components.
• Configuration & Initialization:
• Supporting/Infrastructure Elements:
• Docker and compose files, which show the deployment packaging. Also include CI/CD workflows from “.github/workflows.”
• Mention utilities such as caching (both in “service/lib/cache” and “service/initialize/redis”) and rate limiting (“service/global/rateLimit.go” and related files).
Relationships and Interactions
• Client-Server Interaction:
• Separate API endpoints catering to different modules, e.g., “system”, “panel”, “openness.”
• Backend Internal Flow:
• Initialization routines and configuration loading as the fundamental startup steps for the backend.
• Data Flow & Caching:
• If applicable, include interactions with caching layers (in-memory or Redis based on “service/lib/cache” and “service/initialize/redis”) and other utility libraries.
• Docker and Deployment:
• Docker containers (Dockerfile and docker-compose.yml) to show the container boundaries, and note the build pipelines from CI workflows.
Architectural Patterns and Technologies
• Use the MVC or layered approach in the backend (separating API routing, controller/middleware logic, and business logic).
• Clear separation of concerns between the client (view layer using Vue.js) and server (API and services written in Go).
• Docker deployment strategy and the use of container orchestration with docker-compose.