How hem9984/azlon-demo works
Main Components
• Frontend UI:
• Located in the “frontend” directory.
• Built with React (using TypeScript and Vite), Tailwind CSS, and a rich set of UI components.
• Main entry point is in frontend/src/main.tsx, with additional pages/components forming the user interface (including workflow forms and result displays).
• Backend Engine:
• Found in the “backend” directory.
• Contains a Python application (likely based on FastAPI or a similar framework) that implements the autonomous coding workflow.
• Key files include backend/main.py, as well as modular functionality in backend/src (with separate modules for client, functions, workflows, prompts, and services).
• Docker Infrastructure:
• The docker-compose.yml file orchestrates multiple services such as:
• The “restack-engine” service (exposing a UI likely on port 5233).
• The “docker-dind” service, which enables Docker-in-Docker for container builds.
• The backend service.
• The frontend service.
• External Dependencies:
• OpenAI API Key integration (configured via a .env file).
• OpenAI’s GPT models that underpin the autonomous code generation.
Relationships and Interactions
• The Frontend <--> Backend Interaction:
• The React UI is used to collect user prompts and testing conditions. These are sent to the backend service via a REST API.
• The backend processes incoming requests, invokes code generation using GPT models, and manages workflow execution.
• The Backend <--> Docker Infrastructure:
• The backend coordinates with Docker-in-Docker to dynamically build and run generated code within containerized environments.
• It also integrates with the Restack engine to display workflow state/status and manage the continuous feedback loop.
• Data Flow Overview:
• User enters a prompt and test conditions in the Frontend.
• The request is handled by the Backend, which generates code and triggers corresponding Docker container build/run operations.
• Processed workflow stages and results are routed back to both the Frontend and the Restack UI for monitoring.
Architectural Patterns & Design Principles
• Modularization:
• Both frontend and backend are organized into distinct modules/components, aiding maintainability.
• The backend separates concerns with folders for client communication, functions, services, and workflows.
• Containerization & Microservices:
• Using Docker Compose shows an architectural choice towards a microservices-like design, where each service (e.g., backend, frontend, restack-engine) is decoupled but interdependent.
• API-driven Communication:
• There is a clear API layer between the frontend (user input and display) and the backend (processing, orchestration, and monitoring).