Project structure
Understand how SWAT is organized so you can quickly find what to modify, extend or replace in your own project.
SWAT is built on a classic Symfony project structure, extended with a modular frontend organization
and a dedicated CI/CD setup.
The goal is to keep the project easy to understand, easy to maintain and easy to adapt.
Backend logic follows Symfony conventions, while frontend assets, automation workflows
and project tooling are organized in a predictable way.
| Directory | Description |
|---|---|
| src/ | Contains the Symfony application logic, including controllers and project-specific services. |
| templates/ | Contains the Twig templates used to render layouts, partials and page-specific views. |
| assets/ | Contains the frontend entry points, SCSS modules, TypeScript scripts, frontend tests and static images. |
| config/ | Includes Symfony configuration files and environment-specific framework setup. |
| public/ | Public entry point of the application and location of the compiled frontend assets. |
| tests/ | Contains the PHPUnit tests used for backend validation in the CI pipeline. |
The frontend is organized in a modular way so styles and scripts remain maintainable and reusable. The assets/ directory clearly separates entry points, styles, scripts, tests and static images.
| Directory | Description |
|---|---|
| assets/app.ts and assets/app.scss | Main frontend entry points where global scripts, styles and dependencies are imported. |
| assets/styles/ | Contains SCSS modules organized by page, component or visual section. |
| assets/scripts/ | Contains small targeted TypeScript modules for specific frontend behaviors. |
| assets/scripts/tests/ | Contains the frontend unit tests executed with Vitest. |
| assets/images/ | Stores static visual assets that are bundled through the frontend build process. |
The backend follows a conventional Symfony structure.
Controllers handle routing and page rendering, while services contain reusable application logic.
The templates/ directory contains the Twig views used by the project,
including layouts, reusable partials and page-specific templates for the SWAT website.
| Directory | Description |
|---|---|
| src/ | Contains the Symfony application logic, including controllers and project-specific services. |
| templates/ | Contains the Twig templates used to render the different pages and shared layouts. |
SWAT includes a set of configuration files and tooling to support development, testing and deployment. These files define dependencies, build configuration, environment setup and validation rules.
| File | Description |
|---|---|
| composer.json | Defines the PHP dependencies and Symfony packages used by the project. |
| package.json | Defines the frontend dependencies and npm scripts used for linting, testing and asset compilation. |
| webpack.config.js | Configures the Webpack Encore build process for TypeScript, SCSS and assets. |
| tsconfig.json | Provides the TypeScript compiler configuration for the frontend scripts. |
| phpunit.dist.xml | Defines the PHPUnit configuration used for backend validation. |
| vitest.config.ts | Defines the Vitest configuration used for frontend unit tests. |
| .env files | Provide example environment variables for development and testing. They should not contain real secrets. Production-specific values should be defined on the target environment. |
The .github/workflows directory contains the GitHub Actions workflows that automate validation and deployment. These workflows handle pull request checks, preproduction deployment and production deployment, providing a predictable delivery process.
| File | Description |
|---|---|
| .github/workflows/ci.yml | Validation workflow that runs on pull requests, installs dependencies, executes checks and builds assets. |
| .github/workflows/deploy-preprod.yml |
Deployment workflow that runs when changes are pushed to the dev branch. It can serve as a starting point for Docker or reverse-proxy-based environments. |
| .github/workflows/deploy-production.yml |
Deployment workflow that runs when a version tag matching v* is pushed. It can serve as a starting point for traditional hosting platforms or VPS setups with SSH access. |