How onedesign/craft-starter works
Main Components
• DDEV Infrastructure: Clearly illustrate that local development is containerized through DDEV. Represent the Docker containers (for PHP/Apache/Nginx, Node, and possibly a separate database container) and highlight that commands like “ddev composer”, “ddev npm”, and “ddev craft” are consistently used.
• Craft CMS Application ("app" directory): Show the core backend, including:
• Application bootstrap (bootstrap.php)
• Configuration files (in app/config, app/config/project, etc.)
• Template rendering (Twig templates in app/templates)
• Craft plugins (like Servd, CKEditor, Imager X, etc.) integrated as part of the business logic.
• Storage and routing (e.g., .env file, routes.php)
• Entry point and assets (src/entry.html, src/scripts/main.js)
• Styles (Tailwind CSS setup with postcss.config.js and tailwind.config.js, SCSS files in src/styles)
• Static assets (images and fonts in src/static)
• Theme configurations (theme/config files for additional customization)
• External Services or Plugins: Identify key Craft plugins such as Servd for assets and hosting, CKEditor, SEOMatic, etc. Also, note any external database and hosting interactions if available.
Relationships and Data Flow
• Data flow between the frontend build process (Vite, Tailwind CSS) and the Craft backend. For example, show how the built CSS and JavaScript files are injected into the Twig templates.
• Dependency flows from configuration files to runtime behavior (e.g., composer.json for PHP backend dependencies and package.json for Node dependencies).
Architectural Patterns and Design Principles
• Separation of Concerns: Illustrate that the project cleanly divides frontend (Vite, assets, styling) from backend (Craft CMS, PHP, database connections) logic.
• Containerization: Emphasize how DDEV and Docker localize and encapsulate the environment, ensuring consistency across development and production.
• Modular Configuration: Highlight the extensive use of configuration files in the “app/config” and “app/config/project” directories, which enable environment-specific and project-specific settings.
• Third-Party Integrations: Point out the integration of third-party services via Craft plugins (e.g., Servd for asset management, image optimization with Imager X).