-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michal Saloň
committed
Jul 3, 2024
0 parents
commit cd3a33c
Showing
148 changed files
with
12,190 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
return App\Bootstrap::boot() | ||
->createContainer() | ||
->getByType(Doctrine\ORM\EntityManagerInterface::class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.build/ | ||
.docker/ | ||
.docs/ | ||
.github/ | ||
tests/ | ||
.phpstorm.meta.php | ||
docker-compose.yml | ||
phpstan.neon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM nginx:alpine | ||
COPY ./ /var/www/html/ | ||
CMD ["nginx"] | ||
|
||
EXPOSE 80 443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
upstream php-upstream { | ||
server php:9000; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
user nginx; | ||
worker_processes 4; | ||
daemon off; | ||
|
||
error_log /var/log/nginx/error.log warn; | ||
pid /var/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
access_log /dev/stdout; | ||
error_log /dev/stderr; | ||
|
||
sendfile on; | ||
keepalive_timeout 65; | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
include /etc/nginx/sites-available/*.conf; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
server { | ||
|
||
listen 80 default_server; | ||
listen [::]:80 default_server ipv6only=on; | ||
|
||
server_name localhost; | ||
root /var/www/html/www/; | ||
index index.php; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.php$is_args$args; | ||
} | ||
|
||
location ~ \.php$ { | ||
try_files $uri /index.php =404; | ||
fastcgi_pass php-upstream; | ||
fastcgi_index index.php; | ||
fastcgi_buffers 16 16k; | ||
fastcgi_buffer_size 32k; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_read_timeout 600; | ||
include fastcgi_params; | ||
} | ||
|
||
location ~ /\.ht { | ||
deny all; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM thecodingmachine/php:8.0-v4-fpm | ||
|
||
COPY ./ /var/www/html/ | ||
|
||
WORKDIR /var/www/html/ | ||
|
||
CMD ["php-fpm"] | ||
|
||
EXPOSE 9000 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = tab | ||
indent_size = tab | ||
tab_width = 4 | ||
|
||
[{*.json, *.yaml, *.yml, *.md}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version = 1 | ||
|
||
[merge] | ||
automerge_label = "automerge" | ||
blacklist_title_regex = "^WIP.*" | ||
blacklist_labels = ["WIP"] | ||
method = "rebase" | ||
delete_branch_on_merge = true | ||
notify_on_conflict = true | ||
optimistic_updates = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: composer | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
labels: | ||
- "dependencies" | ||
- "automerge" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: "Codesniffer" | ||
|
||
on: | ||
pull_request: | ||
|
||
push: | ||
branches: ["*"] | ||
|
||
schedule: | ||
- cron: "0 8 * * 1" | ||
|
||
jobs: | ||
codesniffer: | ||
name: "Codesniffer" | ||
uses: contributte/.github/.github/workflows/codesniffer.yml@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: "Coverage" | ||
|
||
on: | ||
pull_request: | ||
|
||
push: | ||
branches: ["*"] | ||
|
||
schedule: | ||
- cron: "0 8 * * 1" | ||
|
||
jobs: | ||
coverage: | ||
name: "Phpunit" | ||
uses: contributte/.github/.github/workflows/phpunit-coverage.yml@v1 | ||
with: | ||
make: "init coverage" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: "Phpstan" | ||
|
||
on: | ||
pull_request: | ||
|
||
push: | ||
branches: ["*"] | ||
|
||
schedule: | ||
- cron: "0 8 * * 1" | ||
|
||
jobs: | ||
phpstan: | ||
name: "Phpstan" | ||
uses: contributte/.github/.github/workflows/phpstan.yml@v1 | ||
with: | ||
make: "init phpstan" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: "Phpunit" | ||
|
||
on: | ||
pull_request: | ||
|
||
push: | ||
branches: [ "*" ] | ||
|
||
schedule: | ||
- cron: "0 8 * * 1" | ||
|
||
jobs: | ||
test82: | ||
name: "Phpunit" | ||
uses: contributte/.github/.github/workflows/phpunit.yml@v1 | ||
with: | ||
php: "8.2" | ||
make: "init tests" | ||
|
||
test81: | ||
name: "Phpunit" | ||
uses: contributte/.github/.github/workflows/phpunit.yml@v1 | ||
with: | ||
php: "8.1" | ||
make: "init tests" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.idea | ||
|
||
# Nette | ||
/config/local.neon | ||
|
||
# Composer | ||
/vendor | ||
|
||
# NodeJS | ||
/node_modules | ||
|
||
# Assets | ||
/www/dist | ||
|
||
# Tests | ||
/tests/*.log | ||
/tests/tmp | ||
/tests/coverage.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace PHPSTORM_META { | ||
override(\App\Model\Database\EntityManagerDecorator::getRepository(0), map([ | ||
'\App\Domain\User\User' => \App\Domain\User\UserRepository::class, | ||
])); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2024 Zerops s.r.o. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
############################################################ | ||
# PROJECT ################################################## | ||
############################################################ | ||
.PHONY: project | ||
project: install setup | ||
|
||
.PHONY: init | ||
init: | ||
cp config/local.neon.example config/local.neon | ||
|
||
.PHONY: install | ||
install: | ||
composer install | ||
|
||
.PHONY: setup | ||
setup: | ||
mkdir -p var/tmp var/log | ||
chmod +0777 var/tmp var/log | ||
|
||
.PHONY: clean | ||
clean: | ||
find var/tmp -mindepth 1 ! -name '.gitignore' -type f,d -exec rm -rf {} + | ||
find var/log -mindepth 1 ! -name '.gitignore' -type f,d -exec rm -rf {} + | ||
|
||
############################################################ | ||
# DEVELOPMENT ############################################## | ||
############################################################ | ||
.PHONY: qa | ||
qa: cs phpstan | ||
|
||
.PHONY: cs | ||
cs: | ||
vendor/bin/codesniffer app tests | ||
|
||
.PHONY: csf | ||
csf: | ||
vendor/bin/codefixer app tests | ||
|
||
.PHONY: phpstan | ||
phpstan: | ||
vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=512M | ||
|
||
.PHONY: tests | ||
tests: | ||
vendor/bin/tester -s -p php --colors 1 -C tests | ||
|
||
.PHONY: coverage | ||
coverage: | ||
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.xml --coverage-src ./app tests | ||
|
||
.PHONY: dev | ||
dev: | ||
NETTE_DEBUG=1 NETTE_ENV=dev php -S 0.0.0.0:8000 -t www | ||
|
||
.PHONY: build | ||
build: | ||
NETTE_DEBUG=1 bin/console orm:schema-tool:drop --force --full-database | ||
NETTE_DEBUG=1 bin/console migrations:migrate --no-interaction | ||
NETTE_DEBUG=1 bin/console doctrine:fixtures:load --no-interaction --append | ||
|
||
############################################################ | ||
# DEPLOYMENT ############################################### | ||
############################################################ | ||
.PHONY: deploy | ||
deploy: | ||
$(MAKE) clean | ||
$(MAKE) project | ||
$(MAKE) build | ||
$(MAKE) clean | ||
|
||
############################################################ | ||
# DOCKER ################################################### | ||
############################################################ | ||
.PHONY: docker-postgres | ||
docker-postgres: | ||
docker run \ | ||
-it \ | ||
-p 5432:5432 \ | ||
-e POSTGRES_PASSWORD=contributte \ | ||
-e POSTGRES_USER=contributte \ | ||
dockette/postgres:12 | ||
|
||
.PHONY: docker-adminer | ||
docker-adminer: | ||
docker run \ | ||
-it \ | ||
-p 9999:80 \ | ||
dockette/adminer:dg |
Oops, something went wrong.