Skip to content

Commit 155bcc4

Browse files
committed
Add webapp packages
1 parent 0e4214b commit 155bcc4

38 files changed

+9428
-1237
lines changed

.env

+21
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,24 @@
1818
APP_ENV=dev
1919
APP_SECRET=2f9294e5316fbfe3f204b7489e352f55
2020
###< symfony/framework-bundle ###
21+
22+
###> doctrine/doctrine-bundle ###
23+
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
24+
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
25+
#
26+
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
27+
# DATABASE_URL="mysql://app:[email protected]:3306/app?serverVersion=8.0.32&charset=utf8mb4"
28+
# DATABASE_URL="mysql://app:[email protected]:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
29+
DATABASE_URL="postgresql://app:[email protected]:5432/app?serverVersion=15&charset=utf8"
30+
###< doctrine/doctrine-bundle ###
31+
32+
###> symfony/messenger ###
33+
# Choose one of the transports below
34+
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
35+
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
36+
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
37+
###< symfony/messenger ###
38+
39+
###> symfony/mailer ###
40+
# MAILER_DSN=null://null
41+
###< symfony/mailer ###

.env.test

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# define your env variables for the test env here
2+
KERNEL_CLASS='App\Kernel'
3+
APP_SECRET='$ecretf0rt3st'
4+
SYMFONY_DEPRECATIONS_HELPER=999999
5+
PANTHER_APP_ENV=panther
6+
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,18 @@
88
/var/
99
/vendor/
1010
###< symfony/framework-bundle ###
11+
12+
###> phpunit/phpunit ###
13+
/phpunit.xml
14+
.phpunit.result.cache
15+
###< phpunit/phpunit ###
16+
17+
###> symfony/phpunit-bridge ###
18+
.phpunit.result.cache
19+
/phpunit.xml
20+
###< symfony/phpunit-bridge ###
21+
22+
###> symfony/asset-mapper ###
23+
/public/assets/
24+
/assets/vendor
25+
###< symfony/asset-mapper ###

assets/app.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import './bootstrap.js';
2+
/*
3+
* Welcome to your app's main JavaScript file!
4+
*
5+
* This file will be included onto the page via the importmap() Twig function,
6+
* which should already be in your base.html.twig.
7+
*/
8+
import './styles/app.css';
9+
10+
console.log('This log comes from assets/app.js - welcome to AssetMapper! 🎉');

assets/bootstrap.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { startStimulusApp } from '@symfony/stimulus-bundle';
2+
3+
const app = startStimulusApp();
4+
// register any custom, 3rd party controllers here
5+
// app.register('some_controller_name', SomeImportedController);

assets/controllers.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"controllers": {
3+
"@symfony/ux-turbo": {
4+
"turbo-core": {
5+
"enabled": true,
6+
"fetch": "eager"
7+
},
8+
"mercure-turbo-stream": {
9+
"enabled": false,
10+
"fetch": "eager"
11+
}
12+
}
13+
},
14+
"entrypoints": []
15+
}
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Controller } from '@hotwired/stimulus';
2+
3+
/*
4+
* This is an example Stimulus controller!
5+
*
6+
* Any element with a data-controller="hello" attribute will cause
7+
* this controller to be executed. The name "hello" comes from the filename:
8+
* hello_controller.js -> "hello"
9+
*
10+
* Delete this file or adapt it for your use!
11+
*/
12+
export default class extends Controller {
13+
connect() {
14+
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js';
15+
}
16+
}

assets/styles/app.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
background-color: skyblue;
3+
}

bin/phpunit

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
if (!ini_get('date.timezone')) {
5+
ini_set('date.timezone', 'UTC');
6+
}
7+
8+
if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
9+
if (PHP_VERSION_ID >= 80000) {
10+
require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
11+
} else {
12+
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
13+
require PHPUNIT_COMPOSER_INSTALL;
14+
PHPUnit\TextUI\Command::main();
15+
}
16+
} else {
17+
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
18+
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
19+
exit(1);
20+
}
21+
22+
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
23+
}

compose.override.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '3'
2+
3+
services:
4+
###> doctrine/doctrine-bundle ###
5+
database:
6+
ports:
7+
- "5432"
8+
###< doctrine/doctrine-bundle ###
9+
10+
###> symfony/mailer ###
11+
mailer:
12+
image: sj26/mailcatcher
13+
ports: ["1025", "1080"]
14+
###< symfony/mailer ###

compose.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: '3'
2+
3+
services:
4+
###> doctrine/doctrine-bundle ###
5+
database:
6+
image: postgres:${POSTGRES_VERSION:-15}-alpine
7+
environment:
8+
POSTGRES_DB: ${POSTGRES_DB:-app}
9+
# You should definitely change the password in production
10+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
11+
POSTGRES_USER: ${POSTGRES_USER:-app}
12+
volumes:
13+
- database_data:/var/lib/postgresql/data:rw
14+
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
15+
# - ./docker/db/data:/var/lib/postgresql/data:rw
16+
###< doctrine/doctrine-bundle ###
17+
18+
volumes:
19+
###> doctrine/doctrine-bundle ###
20+
database_data:
21+
###< doctrine/doctrine-bundle ###

composer.json

+43-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,42 @@
77
"php": ">=8.2",
88
"ext-ctype": "*",
99
"ext-iconv": "*",
10+
"doctrine/doctrine-bundle": "^2.11",
11+
"doctrine/doctrine-migrations-bundle": "^3.3",
12+
"doctrine/orm": "^2.17",
13+
"phpdocumentor/reflection-docblock": "^5.3",
14+
"phpstan/phpdoc-parser": "^1.25",
15+
"symfony/asset": "7.0.*",
16+
"symfony/asset-mapper": "7.0.*",
1017
"symfony/console": "7.0.*",
18+
"symfony/doctrine-messenger": "7.0.*",
1119
"symfony/dotenv": "7.0.*",
20+
"symfony/expression-language": "7.0.*",
1221
"symfony/flex": "^2",
22+
"symfony/form": "7.0.*",
1323
"symfony/framework-bundle": "7.0.*",
24+
"symfony/http-client": "7.0.*",
25+
"symfony/intl": "7.0.*",
26+
"symfony/mailer": "7.0.*",
27+
"symfony/mime": "7.0.*",
28+
"symfony/monolog-bundle": "^3.0",
29+
"symfony/notifier": "7.0.*",
30+
"symfony/process": "7.0.*",
31+
"symfony/property-access": "7.0.*",
32+
"symfony/property-info": "7.0.*",
1433
"symfony/runtime": "7.0.*",
15-
"symfony/yaml": "7.0.*"
16-
},
17-
"require-dev": {
34+
"symfony/security-bundle": "7.0.*",
35+
"symfony/serializer": "7.0.*",
36+
"symfony/stimulus-bundle": "^2.13",
37+
"symfony/string": "7.0.*",
38+
"symfony/translation": "7.0.*",
39+
"symfony/twig-bundle": "7.0.*",
40+
"symfony/ux-turbo": "^2.13",
41+
"symfony/validator": "7.0.*",
42+
"symfony/web-link": "7.0.*",
43+
"symfony/yaml": "7.0.*",
44+
"twig/extra-bundle": "^2.12|^3.0",
45+
"twig/twig": "^2.12|^3.0"
1846
},
1947
"config": {
2048
"allow-plugins": {
@@ -47,7 +75,8 @@
4775
"scripts": {
4876
"auto-scripts": {
4977
"cache:clear": "symfony-cmd",
50-
"assets:install %PUBLIC_DIR%": "symfony-cmd"
78+
"assets:install %PUBLIC_DIR%": "symfony-cmd",
79+
"importmap:install": "symfony-cmd"
5180
},
5281
"post-install-cmd": [
5382
"@auto-scripts"
@@ -64,5 +93,15 @@
6493
"allow-contrib": false,
6594
"require": "7.0.*"
6695
}
96+
},
97+
"require-dev": {
98+
"phpunit/phpunit": "^9.5",
99+
"symfony/browser-kit": "7.0.*",
100+
"symfony/css-selector": "7.0.*",
101+
"symfony/debug-bundle": "7.0.*",
102+
"symfony/maker-bundle": "^1.0",
103+
"symfony/phpunit-bridge": "^7.0",
104+
"symfony/stopwatch": "7.0.*",
105+
"symfony/web-profiler-bundle": "7.0.*"
67106
}
68107
}

0 commit comments

Comments
 (0)