How yiisoft/yii2-app-advanced works
Project Type and Purpose
• This is a full-stack web application template using the Yii 2 framework.
• Its purpose is to provide a skeleton structure for building complex web applications. It separates concerns into three tiers (frontend, backend, console) and provides shared functionality (common), which helps in team development and environment-specific configuration.
File Structure for Architectural Clues
• Key top-level directories:
• frontend: Contains the user-facing web application (controllers, models, views, assets, and web entry point).
• backend: Hosts the administrative or internal interface with similar structure to the frontend.
• console: Contains command-line scripts, controllers, and migrations for running background tasks and database migrations.
• common: Shares configuration files, models, mail templates, tests, and widgets used by both frontend and backend.
• environments: Provides environment-specific overrides (e.g., for development and production).
• docs and vendor: The documentation and third-party libraries.
• Other supporting files include Dockerfiles, Vagrant setup, Codeception test configurations, and CI/CD workflows in the .github directory – each indicating aspects of deployment, testing, and continuous integration.
• Frontend Application: Mark as “Frontend” and include elements like assets, configuration, controllers, models, views, and entry scripts (web/ directory).
• Backend Application: Mark as “Backend” with its corresponding subcomponents (controllers, views, assets, models, and config).
• Console Application: Display this as a separate block with its controllers, migration scripts, and models.
• Common Shared Library: Show this as a central repository of shared components (common/config, common/models, common/mail, and common/tests).
Relationships and Interactions
• That the Frontend and Backend are separate web applications communicating with users via HTTP. Indicate:
• Frontend receives standard web requests from the public internet (user browsers).
• Backend often serves administrative tasks and has a similar HTTP flow.
• That the Console application is used for tasks like running migrations and background jobs which may interact with the Database or affect both Frontend and Backend.
• If applicable, include data flows (or dependencies) toward external persistence (e.g., a DB, which isn’t directly visible in the file tree but is a common part of any Yii application).
Important Architectural Patterns & Technologies
• Separation of concerns: MVC pattern in both the Frontend and Backend.
• That the shared “common” directory centralizes shared logic, adhering to DRY principles.
• Annotations for environment-based configuration (overrides in environments/dev and environments/prod).
• Mention build/deployment support using Docker, Vagrant, and CI/CD pipelines found in .github and docker-compose.yml.