How botirbakhtiyarov/autoinstaller_django works
Main Components
• Web Server & Django Application:
• AutoInstaller: Contains global configurations (settings.py, urls.py, WSGI/ASGI entry points).
• Installer App: Manages user-facing actions, including browsing apps, processing payments, and exposing API endpoints for installations.
• Management App: Provides the admin interface for app uploads, script management, and other administrative functions.
• Database:
• PostgreSQL (as mentioned in the README’s prerequisites) that stores app data, user purchases, and metadata.
• API Layer:
• REST endpoints (e.g., /api/install/<app_name>/) that facilitate installation commands both from the frontend and a Windows batch file.
• Client Components (Windows-specific):
• LocalApp.exe: A standalone executable responsible for processing installation commands.
• install_app.bat: A batch script wrapping the API call and triggering LocalApp.exe, which uses custom URLs (myapp://) to initiate installs.
• External Services & Deployment:
• WeChat Payment Gateway: Responsible for handling payments via QR codes.
• Docker & Docker Compose: Container orchestration components to deploy the server.
• Custom protocol registration (“myapp://”) that bridges the web API and local system installation.
Relationships and Data Flows
• User Workflow:
• A user visits the frontend (templates in the Installer directory) and browses available apps.
• Payment process via WeChat triggers a change in state, captured by the Installer’s views and corresponding database updates.
• When a user clicks “安装” (Install), the web client creates a custom protocol link (myapp://...) that triggers LocalApp.exe on the client machine.
• API & Batch Script Workflow:
• Running the command “install_app <app_name>” causes the batch file to call the API endpoint, which returns an install_url.
• The batch file then triggers LocalApp.exe with the received install URL, which in turn fetches and runs the installation script.
• Administration Workflow:
• Admins access the Management component using the admin interface (templates in Management) to upload and modify app details.
• Docker & Deployment:
• The Dockerfile and docker-compose.yml facilitate containerized deployment.
• Nginx (or another reverse proxy) and gunicorn are mentioned for production; these can be factored in as the deployment layer.
Architectural Patterns and Technologies
• MVC or MTV (Model-Template-View) pattern for separating concerns in Django.
• RESTful API design for the installation triggers.
• Integration of external payment services (WeChat) and custom protocol handling.
• Use of Docker to encapsulate environment configuration and dependencies.
• Technologies: Python 3.10, Django 4.2, Docker, PostgreSQL (external), and Windows utilities (batch scripting, custom protocol registration).