|
3 | 3 | Dirigent is an open-source project, contributions of all kind are welcome, including |
4 | 4 | [financial contributions][codedmonkey-sponsor]. |
5 | 5 |
|
| 6 | +This guide contains technical information and instructions about the development process of the project that you should |
| 7 | +follow when contributing code. |
| 8 | + |
| 9 | +## Project information |
| 10 | + |
| 11 | +### Technology stack |
| 12 | + |
| 13 | +- **Languages & frameworks**: |
| 14 | + - PHP 8.3+ |
| 15 | + - Symfony 7.3 |
| 16 | + - PostgreSQL 16.x (via Doctrine ORM 3.x) |
| 17 | + - TypeScript |
| 18 | +- **Development requirements**: |
| 19 | + - Docker |
| 20 | + - Symfony CLI |
| 21 | +- **Package managers**: |
| 22 | + - **PHP**: Composer |
| 23 | + - **TypeScript**: NPM |
| 24 | +- **Frontend**: Twig, EasyAdmin 4.x |
| 25 | +- **Frontend (JavaScript)**: Webpack Encore, Stimulus |
| 26 | +- **Linting**: Rector, PHP-CS-Fixer, PHPStan |
| 27 | +- **Testing**: PHPUnit 12.x, Testcontainers |
| 28 | + |
| 29 | +### Coding style |
| 30 | + |
| 31 | +#### PHP |
| 32 | + |
| 33 | +Dirigent follows the [PER coding style][per-coding-style] and the [Symfony coding standards][symfony-coding-standards]. |
| 34 | + |
6 | 35 | ## Running Dirigent locally |
7 | 36 |
|
8 | | -To run Dirigent locally, follow the [Running from source code][dirigent-docs-install-source] guide in the documentation, |
| 37 | +### Installation |
| 38 | + |
| 39 | +To run Dirigent locally, follow the [Running from source code][docs-install-source] guide in the documentation, |
9 | 40 | up to the *Configure services* section. |
10 | 41 |
|
11 | 42 | Additional requirements: |
12 | 43 |
|
13 | 44 | - Symfony binary |
14 | 45 | - Docker |
15 | 46 |
|
| 47 | + |
16 | 48 | ```shell |
17 | 49 | # Optionally, copy the example Docker Compose configuration override file |
18 | | -cp compose.override.example.yaml composer.override.yaml |
| 50 | +cp compose.override.example.yaml compose.override.yaml |
| 51 | + |
| 52 | +# Install dependencies |
| 53 | +composer install |
| 54 | +npm install |
19 | 55 |
|
20 | | -# Start Docker services |
| 56 | +# Build frontend assets |
| 57 | +npm run build # or watch for changes with: npm run watch |
| 58 | + |
| 59 | +# Run services through Docker Compose |
21 | 60 | docker compose up -d |
22 | 61 |
|
23 | | -# Start Symfony local server |
| 62 | +# Run the Symfony development server |
24 | 63 | symfony server:start -d |
| 64 | + |
| 65 | +# Create & fill the development database |
| 66 | +symfony console doctrine:database:create --if-not-exists |
| 67 | +symfony console doctrine:schema:update --force |
| 68 | +symfony console doctrine:fixtures:load --no-interaction |
25 | 69 | ``` |
26 | 70 |
|
27 | | -## Lint & test your code |
| 71 | +## Lint & validate the code |
28 | 72 |
|
29 | 73 | ```shell |
30 | | -# Run all linters |
| 74 | +# Run all linting jobs |
31 | 75 | symfony composer lint |
| 76 | + |
| 77 | +# Individual linters |
| 78 | +symfony composer lint:refactor # Rector (automatically applies changes) |
| 79 | +symfony composer lint:coding-style # PHP-CS-Fixer (automatically applies changes) |
| 80 | +symfony composer lint:static-analysis # PHPStan level 5 |
| 81 | +symfony composer lint:container # Symfony container validation |
| 82 | +symfony composer lint:templates # Twig template validation |
32 | 83 | ``` |
33 | 84 |
|
34 | | -### Running PHPUnit tests |
| 85 | +### Running tests |
35 | 86 |
|
36 | 87 | ```shell |
37 | | -# Before running the tests, make sure the testing database is ready |
| 88 | +# Prepare the Symfony test environment (if the database schema changed) |
38 | 89 | symfony composer tests:setup |
| 90 | +``` |
| 91 | + |
| 92 | +```shell |
| 93 | +# Run all tests |
| 94 | +symfony composer tests |
39 | 95 |
|
40 | | -# Run PHP tests |
| 96 | +# Run only PHP tests |
41 | 97 | symfony composer tests:php |
| 98 | +symfony composer tests:php:unit |
| 99 | +symfony composer tests:php:functional |
42 | 100 |
|
43 | | -# Run tests on Docker images |
44 | | -symfony composer tests:docker |
| 101 | +# Run tests for Docker images |
| 102 | +symfony composer tests:docker |
| 103 | +symfony composer tests:docker:standalone |
45 | 104 | ``` |
46 | 105 |
|
47 | 106 | [codedmonkey-sponsor]: https://github.com/sponsors/codedmonkey |
48 | | -[dirigent-docs-install-source]: https://dirigent.dev/docs/installation/source |
| 107 | +[docs-install-source]: ./docs/installation/source.md |
| 108 | +[per-coding-style]: https://www.php-fig.org/per/coding-style/ |
| 109 | +[symfony-coding-standards]: https://symfony.com/doc/current/contributing/code/standards.html |
0 commit comments