Skip to content

Commit bb50c93

Browse files
Add webapp packages
1 parent 53e2a85 commit bb50c93

38 files changed

+9451
-1247
lines changed

.env

+21
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,24 @@
1818
APP_ENV=dev
1919
APP_SECRET=71ee6db5361f4ccc0e445260c622a703
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=16&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

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
services:
3+
###> doctrine/doctrine-bundle ###
4+
database:
5+
ports:
6+
- "5432"
7+
###< doctrine/doctrine-bundle ###
8+
9+
###> symfony/mailer ###
10+
mailer:
11+
image: axllent/mailpit
12+
ports:
13+
- "1025"
14+
- "8025"
15+
environment:
16+
MP_SMTP_AUTH_ACCEPT_ANY: 1
17+
MP_SMTP_AUTH_ALLOW_INSECURE: 1
18+
###< symfony/mailer ###

compose.yaml

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

composer.json

+44-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,43 @@
77
"php": ">=8.2",
88
"ext-ctype": "*",
99
"ext-iconv": "*",
10+
"doctrine/dbal": "^3",
11+
"doctrine/doctrine-bundle": "^2.12",
12+
"doctrine/doctrine-migrations-bundle": "^3.3",
13+
"doctrine/orm": "^3.2",
14+
"phpdocumentor/reflection-docblock": "^5.4",
15+
"phpstan/phpdoc-parser": "^1.29",
16+
"symfony/asset": "7.1.*",
17+
"symfony/asset-mapper": "7.1.*",
1018
"symfony/console": "7.1.*",
19+
"symfony/doctrine-messenger": "7.1.*",
1120
"symfony/dotenv": "7.1.*",
21+
"symfony/expression-language": "7.1.*",
1222
"symfony/flex": "^2",
23+
"symfony/form": "7.1.*",
1324
"symfony/framework-bundle": "7.1.*",
25+
"symfony/http-client": "7.1.*",
26+
"symfony/intl": "7.1.*",
27+
"symfony/mailer": "7.1.*",
28+
"symfony/mime": "7.1.*",
29+
"symfony/monolog-bundle": "^3.0",
30+
"symfony/notifier": "7.1.*",
31+
"symfony/process": "7.1.*",
32+
"symfony/property-access": "7.1.*",
33+
"symfony/property-info": "7.1.*",
1434
"symfony/runtime": "7.1.*",
15-
"symfony/yaml": "7.1.*"
16-
},
17-
"require-dev": {
35+
"symfony/security-bundle": "7.1.*",
36+
"symfony/serializer": "7.1.*",
37+
"symfony/stimulus-bundle": "^2.19",
38+
"symfony/string": "7.1.*",
39+
"symfony/translation": "7.1.*",
40+
"symfony/twig-bundle": "7.1.*",
41+
"symfony/ux-turbo": "^2.19",
42+
"symfony/validator": "7.1.*",
43+
"symfony/web-link": "7.1.*",
44+
"symfony/yaml": "7.1.*",
45+
"twig/extra-bundle": "^2.12|^3.0",
46+
"twig/twig": "^2.12|^3.0"
1847
},
1948
"config": {
2049
"allow-plugins": {
@@ -47,7 +76,8 @@
4776
"scripts": {
4877
"auto-scripts": {
4978
"cache:clear": "symfony-cmd",
50-
"assets:install %PUBLIC_DIR%": "symfony-cmd"
79+
"assets:install %PUBLIC_DIR%": "symfony-cmd",
80+
"importmap:install": "symfony-cmd"
5181
},
5282
"post-install-cmd": [
5383
"@auto-scripts"
@@ -64,5 +94,15 @@
6494
"allow-contrib": false,
6595
"require": "7.1.*"
6696
}
97+
},
98+
"require-dev": {
99+
"phpunit/phpunit": "^9.5",
100+
"symfony/browser-kit": "7.1.*",
101+
"symfony/css-selector": "7.1.*",
102+
"symfony/debug-bundle": "7.1.*",
103+
"symfony/maker-bundle": "^1.0",
104+
"symfony/phpunit-bridge": "^7.1",
105+
"symfony/stopwatch": "7.1.*",
106+
"symfony/web-profiler-bundle": "7.1.*"
67107
}
68108
}

0 commit comments

Comments
 (0)