How eric-jxl/django-vue-admin works
Main Components
• Frontend:
• Vue application located under the “web” directory.
• Uses D2Admin and additional UI libraries. Implements views (in “src/views”), components, layouts, configuration files, plugins, and state management (store).
• Backend:
• Django application found under “backend”.
• Organized into standard Django modules – the “application” package for settings, ASGI/WGI configuration, celery for asynchronous tasks, and “dvadmin” for the administrative functions.
• Core business logic is implemented in modules such as “dvadmin/system” (views, models, management commands, etc.).
• Contains plugins and additional utilities that support features like authentication, authorization (JWT based), logging, and exception management.
• Database & External Services:
• The project is configured to work with MySQL (as indicated in the README instructions); it is recommended to show MySQL as the primary database.
• External components include Celery (for background processing) and possibly Daphne for ASGI serving.
• Deployment/Containerization:
• Docker Compose files and associated docker environment directories (docker_env) indicate separate containers for Django, MySQL, nginx, and optionally Celery.
Relationships and Interactions
• Frontend-to-Backend Communication:
• Backend Architecture:
• Separation of concerns: models (data persistence), views (business logic and API endpoints), and management commands (initialization and background tasks).
• Background and Asynchronous Processing:
• How asynchronous tasks (Celery) integrate with the main Django application.
• Docker Environment:
• How nginx, Django, MySQL, and Celery containers interact under Docker Compose.
Architectural Patterns and Design Principles
• Full-Stack Separation:
• Clear division between frontend (Vue components, state management, API services) and backend (Django’s MVC/MVT structure).
• Modular Design:
• The backend’s structure under “dvadmin” and “plugins” suggests a modular design where administrative functions and feature plugins are decoupled.
• Containerized Deployment:
• The presence of Docker and docker-compose configurations implies a micro-environment setup where each service is isolated.
• RESTful API / Swagger Integration:
• The generated Swagger documentation further signifies a REST API layer for backend services.
Relevant Technologies, Frameworks, and Libraries
• Frontend: Vue, D2Admin, ESLint, Babel, Jest (for unit tests), Vuex, Vue Router.
• Backend: Django (with Django REST Framework possibly inferred from directories such as “static/rest_framework”), Celery for asynchronous processing, and JWT for authentication.
• Auxiliary Tools: Docker Compose for container orchestration, MySQL as the database, and Nginx as a reverse proxy.