Skip to content

Commit d7989f8

Browse files
committed
first commit public
0 parents  commit d7989f8

255 files changed

Lines changed: 39261 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.DS_Store

10 KB
Binary file not shown.

.dockerignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
**/*.log
2+
**/*.md
3+
**/*.php~
4+
**/*.dist.php
5+
**/*.dist
6+
**/*.cache
7+
**/._*
8+
**/.dockerignore
9+
**/.DS_Store
10+
**/.git/
11+
**/.gitattributes
12+
**/.gitignore
13+
**/.gitmodules
14+
**/compose.*.yaml
15+
**/compose.*.yml
16+
**/compose.yaml
17+
**/compose.yml
18+
**/docker-compose.*.yaml
19+
**/docker-compose.*.yml
20+
**/docker-compose.yaml
21+
**/docker-compose.yml
22+
**/Dockerfile
23+
**/Thumbs.db
24+
.github/
25+
docs/
26+
public/bundles/
27+
tests/
28+
var/
29+
vendor/
30+
.editorconfig
31+
.env.*.local
32+
.env.local
33+
.env.local.php
34+
.env.test

.editorconfig

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
# Change these settings to your own preference
9+
indent_style = space
10+
indent_size = 4
11+
12+
# We recommend you to keep these unchanged
13+
end_of_line = lf
14+
charset = utf-8
15+
trim_trailing_whitespace = true
16+
insert_final_newline = true
17+
18+
[*.{js,html,ts,tsx}]
19+
indent_size = 4
20+
21+
[*.json]
22+
indent_size = 2
23+
24+
[*.md]
25+
trim_trailing_whitespace = false
26+
27+
[*.sh]
28+
indent_style = tab
29+
30+
[*.xml.dist]
31+
indent_style = space
32+
indent_size = 4
33+
34+
[*.{yaml,yml}]
35+
trim_trailing_whitespace = false
36+
37+
[.github/workflows/*.yml]
38+
indent_size = 2
39+
40+
[.gitmodules]
41+
indent_style = tab
42+
43+
[.php_cs.dist]
44+
indent_style = space
45+
indent_size = 4
46+
47+
[composer.json]
48+
indent_size = 4
49+
50+
[{compose,docker-compose}.*.{yaml,yml}]
51+
indent_size = 2
52+
53+
[*.*Dockerfile]
54+
indent_style = tab
55+
56+
[*.*Caddyfile]
57+
indent_style = tab

.env

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# In all environments, the following files are loaded if they exist,
2+
# the latter taking precedence over the former:
3+
#
4+
# * .env contains default values for the environment variables needed by the app
5+
# * .env.local uncommitted file with local overrides
6+
# * .env.$APP_ENV committed environment-specific defaults
7+
# * .env.$APP_ENV.local uncommitted environment-specific overrides
8+
#
9+
# Real environment variables win over .env files.
10+
#
11+
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
12+
# https://symfony.com/doc/current/configuration/secrets.html
13+
#
14+
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
15+
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
16+
17+
###> symfony/framework-bundle ###
18+
APP_ENV=dev
19+
APP_SECRET=7d1efdab15bb8c26e549c2a8bd3fe81b
20+
###< 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:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4"
28+
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
29+
30+
###< doctrine/doctrine-bundle ###
31+
32+
###> nelmio/cors-bundle ###
33+
CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$'
34+
###< nelmio/cors-bundle ###
35+
36+
WEB_PUSH_PUBLIC=!ChangeMe!
37+
WEB_PUSH_PRIVATE=!ChangeMe!
38+
39+
###> symfony/messenger ###
40+
# Choose one of the transports below
41+
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
42+
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
43+
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
44+
###< symfony/messenger ###
45+
46+
PHP_CS_FIXER_IGNORE_ENV=true # add this to .env.local
47+
48+
ELASTIC_PASSWORD=changeme
49+
KIBANA_PASSWORD=changeme

.env.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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
7+
APP_ENV=test
8+
9+
DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5433/app_test?serverVersion=16&charset=utf8" # todo: not used
10+
HALLO=WELT
11+
SYMFONY_DEPRECATIONS_HELPER=disabled

.gitattributes

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
* text=auto eol=lf
2+
3+
*.conf text eol=lf
4+
*.html text eol=lf
5+
*.ini text eol=lf
6+
*.js text eol=lf
7+
*.json text eol=lf
8+
*.md text eol=lf
9+
*.php text eol=lf
10+
*.sh text eol=lf
11+
*.yaml text eol=lf
12+
*.yml text eol=lf
13+
bin/console text eol=lf
14+
composer.lock text eol=lf merge=ours
15+
16+
*.ico binary
17+
*.png binary

.github/workflows/ci.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request: ~
8+
workflow_dispatch: ~
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
tests:
16+
name: Tests
17+
runs-on: ubuntu-latest
18+
steps:
19+
-
20+
name: Checkout
21+
uses: actions/checkout@v4
22+
-
23+
name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
-
26+
name: Create empty .env.local file
27+
run: touch .env.local
28+
-
29+
name: Build Docker images
30+
uses: docker/bake-action@v6
31+
with:
32+
pull: true
33+
load: true
34+
files: |
35+
compose.yaml
36+
compose.override.yaml
37+
set: |
38+
*.cache-from=type=gha,scope=${{github.ref}}
39+
*.cache-from=type=gha,scope=refs/heads/main
40+
*.cache-to=type=gha,scope=${{github.ref}},mode=max
41+
-
42+
name: Start services
43+
run: docker compose up --wait --no-build
44+
-
45+
name: Check HTTP reachability
46+
run: curl -v --fail-with-body http://localhost
47+
-
48+
name: Check HTTPS reachability
49+
if: false # Remove this line when the homepage will be configured, or change the path to check
50+
run: curl -vk --fail-with-body https://localhost
51+
# -
52+
# name: Check Mercure reachability
53+
# run: curl -vkI --fail-with-body https://localhost/.well-known/mercure?topic=test
54+
-
55+
name: Create test database
56+
#if: false # Remove this line if Doctrine ORM is installed
57+
run: docker compose exec -T php bin/console -e test doctrine:database:create
58+
-
59+
name: Run migrations
60+
#if: false # Remove this line if Doctrine Migrations is installed
61+
run: docker compose exec -T php bin/console -e test doctrine:migrations:migrate --no-interaction
62+
-
63+
name: Run PHPUnit
64+
#if: false # Remove this line if PHPUnit is installed
65+
run: docker compose exec -e XDEBUG_MODE=coverage -e SYMFONY_DEPRECATIONS_HELPER=disabled php php bin/phpunit -vvv --testdox --verbose --debug --coverage-clover clover.xml
66+
-
67+
name: Process and Upload Coverage to Gist
68+
if: github.ref == 'refs/heads/main'
69+
run: |
70+
# Install necessary tools
71+
sudo apt-get update && sudo apt-get install -y bc jq libxml2-utils
72+
73+
# Check if clover.xml exists
74+
if [ ! -f clover.xml ]; then
75+
echo "clover.xml not found, setting default values"
76+
COVERAGE=0
77+
else
78+
# Extract metrics using xmllint
79+
echo "Extracting coverage metrics using xmllint..."
80+
STATEMENTS=$(xmllint --xpath "string(//project/metrics/@statements)" clover.xml)
81+
COVERED_STATEMENTS=$(xmllint --xpath "string(//project/metrics/@coveredstatements)" clover.xml)
82+
83+
echo "Total statements: $STATEMENTS"
84+
echo "Covered statements: $COVERED_STATEMENTS"
85+
86+
if [ -n "$STATEMENTS" ] && [ -n "$COVERED_STATEMENTS" ] && [ "$STATEMENTS" -gt 0 ]; then
87+
COVERAGE=$(echo "scale=4; ($COVERED_STATEMENTS / $STATEMENTS) * 100" | bc)
88+
else
89+
COVERAGE=0
90+
fi
91+
fi
92+
93+
COVERAGE_ROUNDED=$(printf "%.1f" $COVERAGE)
94+
echo "Coverage: $COVERAGE_ROUNDED%"
95+
96+
# Determine color based on coverage percentage
97+
if (( $(echo "$COVERAGE >= 80" | bc -l) )); then
98+
COLOR="brightgreen"
99+
elif (( $(echo "$COVERAGE >= 70" | bc -l) )); then
100+
COLOR="green"
101+
elif (( $(echo "$COVERAGE >= 60" | bc -l) )); then
102+
COLOR="yellowgreen"
103+
elif (( $(echo "$COVERAGE >= 50" | bc -l) )); then
104+
COLOR="yellow"
105+
else
106+
COLOR="red"
107+
fi
108+
109+
# Create JSON payload for shields.io endpoint
110+
BADGE_JSON="{\"schemaVersion\": 1, \"label\": \"coverage\", \"message\": \"${COVERAGE_ROUNDED}%\", \"color\": \"$COLOR\"}"
111+
echo "$BADGE_JSON" > coverage.json
112+
113+
# Send as a string to the GitHub API
114+
curl -X PATCH \
115+
-H "Authorization: token ${{ secrets.GIST_TOKEN }}" \
116+
-H "Content-Type: application/json" \
117+
-d "{\"files\": {\"coverage.json\": {\"content\": $(echo "$BADGE_JSON" | jq -Rs .)}}}" \
118+
https://api.github.com/gists/${{ secrets.GIST_ID }}
119+
env:
120+
GIST_TOKEN: ${{ secrets.GIST_TOKEN }}
121+
GIST_ID: ${{ secrets.GIST_ID }}
122+
-
123+
name: Doctrine Schema Validator
124+
#if: false # Remove this line if Doctrine ORM is installed
125+
run: docker compose exec -T php bin/console -e test doctrine:schema:validate
126+
-
127+
name: PHPStan analysis
128+
run: docker compose exec -T php vendor/bin/phpstan analyse src --memory-limit=-1
129+
130+
lint:
131+
name: Docker Lint
132+
runs-on: ubuntu-latest
133+
steps:
134+
-
135+
name: Checkout
136+
uses: actions/checkout@v4
137+
-
138+
name: Lint Dockerfile
139+
uses: hadolint/hadolint-action@v3.1.0

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
###> symfony/framework-bundle ###
2+
/.env.local
3+
/.env.local.php
4+
/.env.*.local
5+
/config/secrets/prod/prod.decrypt.private.php
6+
/public/bundles/
7+
/var/
8+
/vendor/
9+
###< symfony/framework-bundle ###
10+
.idea
11+
12+
###> symfony/phpunit-bridge ###
13+
.phpunit.result.cache
14+
/phpunit.xml
15+
###< symfony/phpunit-bridge ###
16+
17+
###> phpunit/phpunit ###
18+
/phpunit.xml
19+
.phpunit.result.cache
20+
clover.xml
21+
###< phpunit/phpunit ###
22+
23+
###> symfony/asset-mapper ###
24+
/public/assets/
25+
/assets/vendor/
26+
###< symfony/asset-mapper ###
27+
/node_modules/
28+
29+
###> friendsofphp/php-cs-fixer ###
30+
/.php-cs-fixer.php
31+
/.php-cs-fixer.cache
32+
###< friendsofphp/php-cs-fixer ###
33+
34+
###> phpstan/phpstan ###
35+
#phpstan.neon
36+
###< phpstan/phpstan ###

.php-cs-fixer.dist.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
$finder = (new PhpCsFixer\Finder())
4+
->in(__DIR__)
5+
->exclude('var')
6+
;
7+
8+
return (new PhpCsFixer\Config())
9+
->setRules([
10+
'@Symfony' => true,
11+
'@PSR2' => true,
12+
'@PSR12' => true,
13+
'global_namespace_import' => [
14+
'import_classes' => true, // https://cs.symfony.com/doc/rules/import/global_namespace_import.html
15+
],
16+
])
17+
->setFinder($finder)
18+
;

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repos:
2+
- repo: https://github.com/gitleaks/gitleaks
3+
rev: v8.18.4
4+
hooks:
5+
- id: gitleaks

0 commit comments

Comments
 (0)