-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#1 - Setup Laravel project #5
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,21 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml,yaml}] | ||
indent_size = 2 | ||
|
||
[*.{js,ts,vue,css}] | ||
indent_size = 2 | ||
|
||
[docker-compose.yml] | ||
indent_size = 4 |
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 @@ | ||
APP_NAME=interns2024b | ||
APP_ENV=testing | ||
APP_KEY=base64:WVG2VcHt+a2uzCw7n1tVUBPyw2kof644d6EoYA/UUAg= | ||
APP_DEBUG=false | ||
APP_URL=http://interns2024b.blumilk.localhost | ||
|
||
LOG_CHANNEL=stack | ||
LOG_LEVEL=debug | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=array | ||
FILESYSTEM_DISK=local | ||
QUEUE_CONNECTION=sync | ||
SESSION_DRIVER=array | ||
SESSION_LIFETIME=120 | ||
MAIL_MAILER=array |
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,71 @@ | ||
APP_NAME=interns2024b | ||
VITE_APP_NAME=interns2024b | ||
APP_ENV=local | ||
APP_KEY=base64:sCsJw8z+d/4ymp0OvzSip2h4Vp2hZZhpV2uOxgTqP94= | ||
APP_DEBUG=true | ||
APP_URL=http://interns2024b.blumilk.localhost | ||
|
||
APP_LOCALE=en | ||
APP_FALLBACK_LOCALE=en | ||
APP_FAKER_LOCALE=en_US | ||
|
||
APP_MAINTENANCE_DRIVER=file | ||
APP_MAINTENANCE_STORE=database | ||
|
||
BCRYPT_ROUNDS=12 | ||
|
||
LOG_CHANNEL=stack | ||
LOG_DEPRECATIONS_CHANNEL=null | ||
LOG_LEVEL=debug | ||
|
||
DB_CONNECTION=pgsql | ||
DB_HOST=interns2024b-db-dev | ||
DB_PORT=5432 | ||
DB_DATABASE=interns2024b | ||
DB_USERNAME=interns2024b | ||
DB_PASSWORD=password | ||
DB_ROOT_PASSWORD=example | ||
|
||
SESSION_DRIVER=redis | ||
SESSION_LIFETIME=120 | ||
SESSION_ENCRYPT=false | ||
SESSION_PATH=/ | ||
SESSION_DOMAIN=null | ||
|
||
BROADCAST_CONNECTION=log | ||
FILESYSTEM_DISK=local | ||
QUEUE_CONNECTION=redis | ||
|
||
CACHE_STORE=redis | ||
CACHE_PREFIX= | ||
|
||
MEMCACHED_HOST=127.0.0.1 | ||
|
||
REDIS_CLIENT=phpredis | ||
REDIS_HOST=interns2024b-redis-dev | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
|
||
MAIL_MAILER=smtp | ||
MAIL_HOST=mailpit | ||
MAIL_PORT=1025 | ||
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
MAIL_FROM_ADDRESS="[email protected]" | ||
MAIL_FROM_NAME="${APP_NAME}" | ||
|
||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
AWS_DEFAULT_REGION=us-east-1 | ||
AWS_BUCKET= | ||
AWS_USE_PATH_STYLE_ENDPOINT=false | ||
|
||
# DOCKER | ||
DOCKER_APP_HOST_PORT=63851 | ||
DOCKER_DATABASE_HOST_PORT=63853 | ||
DOCKER_MAILPIT_DASHBOARD_HOST_PORT=63854 | ||
DOCKER_REDIS_HOST_PORT=63852 | ||
DOCKER_INSTALL_XDEBUG=true | ||
|
||
DOCKER_HOST_USER_ID=1000 |
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,11 @@ | ||
* text=auto eol=lf | ||
|
||
*.blade.php diff=html | ||
*.css diff=css | ||
*.html diff=html | ||
*.md diff=markdown | ||
*.php diff=php | ||
|
||
/.github export-ignore | ||
CHANGELOG.md export-ignore | ||
.styleci.yml export-ignore |
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 @@ | ||
@blumilksoftware/blumilk | ||
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,46 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: composer | ||
directory: "/" | ||
schedule: | ||
interval: monthly | ||
time: "06:30" | ||
timezone: "Europe/Warsaw" | ||
commit-message: | ||
prefix: "- (php) " | ||
target-branch: main | ||
open-pull-requests-limit: 1 | ||
|
||
- package-ecosystem: npm | ||
directory: "/" | ||
schedule: | ||
interval: monthly | ||
time: "06:30" | ||
timezone: "Europe/Warsaw" | ||
commit-message: | ||
prefix: "- (js) " | ||
target-branch: main | ||
open-pull-requests-limit: 1 | ||
|
||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: monthly | ||
time: "06:30" | ||
timezone: "Europe/Warsaw" | ||
commit-message: | ||
prefix: "- (github actions) " | ||
target-branch: main | ||
open-pull-requests-limit: 1 | ||
|
||
- package-ecosystem: docker | ||
directory: "/environment/dev/app" | ||
schedule: | ||
interval: monthly | ||
time: "06:30" | ||
timezone: "Europe/Warsaw" | ||
commit-message: | ||
prefix: "- (docker dev) " | ||
target-branch: main | ||
open-pull-requests-limit: 1 |
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,12 @@ | ||
name: Check PR Title | ||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
types: [opened, edited, synchronize, ready_for_review, reopened] | ||
|
||
jobs: | ||
check-pr-title: | ||
name: Check PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: blumilksoftware/[email protected] # https://github.com/blumilksoftware/action-pr-title |
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,40 @@ | ||
name: Test & lint JS codebase | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
paths: | ||
- '**.js' | ||
- '**.ts' | ||
- '**.vue' | ||
- 'package.json' | ||
- 'package.lock' | ||
|
||
jobs: | ||
test-and-lint-js: | ||
name: Test & lint JS codebase | ||
timeout-minutes: 10 | ||
if: github.event.pull_request.draft == false | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] # https://github.com/actions/checkout | ||
|
||
- name: Cache dependencies | ||
uses: actions/[email protected] # https://github.com/actions/cache | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-npm-dependencies-${{ hashFiles('package.lock') }} | ||
restore-keys: ${{ runner.os }}-npm-dependencies | ||
|
||
- name: Set up node | ||
uses: actions/[email protected] # https://github.com/actions/setup-node | ||
with: | ||
node-version: 21 | ||
|
||
- name: Instal npm dependencies | ||
run: npm clean-install | ||
|
||
- name: Run JS linter | ||
run: npm run lint |
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,63 @@ | ||
name: Test & lint PHP codebase | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
paths: | ||
- '**.php' | ||
- 'composer.json' | ||
- 'composer.lock' | ||
- 'phpunit.xml' | ||
- 'env.ci' | ||
|
||
jobs: | ||
test-and-lint-php: | ||
name: Test & lint PHP codebase | ||
timeout-minutes: 10 | ||
if: github.event.pull_request.draft == false | ||
runs-on: ubuntu-latest | ||
services: | ||
pgsql: | ||
image: postgres:16.2-alpine3.18 # https://hub.docker.com/_/postgres | ||
env: | ||
POSTGRES_DB: interns2024b | ||
POSTGRES_USER: interns2024b | ||
POSTGRES_PASSWORD: password | ||
# Set health checks to wait until postgres has started | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 3s | ||
--health-timeout 3s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
|
||
steps: | ||
- uses: actions/[email protected] # https://github.com/actions/checkout | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Cache dependencies | ||
uses: actions/[email protected] # https://github.com/actions/cache | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-composer-dependencies-${{ hashFiles('composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer-dependencies | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/[email protected] # https://github.com/shivammathur/setup-php | ||
with: | ||
php-version: 8.3 | ||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, intl | ||
coverage: none | ||
|
||
- name: Install Composer dependencies | ||
run: composer install --prefer-dist --no-interaction | ||
|
||
- name: Run PHP linter | ||
run: composer cs | ||
|
||
- name: Execute tests | ||
run: php artisan test --env=ci |
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,21 @@ | ||
/node_modules | ||
/public/hot | ||
/public/storage | ||
/public/js/ | ||
/public/css/ | ||
/public/mix-manifest.json | ||
/vendor | ||
.env | ||
.env.backup | ||
.phpunit.result.cache | ||
docker-compose.override.yml | ||
Homestead.json | ||
Homestead.yaml | ||
npm-debug.log | ||
yarn-error.log | ||
google-credentials.json | ||
.idea/ | ||
.vscode/ | ||
.composer | ||
/public/build/ | ||
supervisord.pid |
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,66 @@ | ||
export COMPOSE_DOCKER_CLI_BUILD = 1 | ||
export DOCKER_BUILDKIT = 1 | ||
|
||
include .env | ||
|
||
SHELL := /bin/bash | ||
|
||
DOCKER_COMPOSE_FILE = docker-compose.yaml | ||
DOCKER_COMPOSE_APP_CONTAINER = app | ||
DOCKER_COMPOSE_DATABASE_CONTAINER = database | ||
|
||
CURRENT_USER_ID = $(shell id --user) | ||
CURRENT_USER_GROUP_ID = $(shell id --group) | ||
CURRENT_DIR = $(shell pwd) | ||
|
||
DATABASE_USERNAME=interns2024b | ||
TEST_DATABASE_NAME=interns2024b-test | ||
|
||
init: check-env-file | ||
@make build \ | ||
&& make run \ | ||
&& docker compose --file ${DOCKER_COMPOSE_FILE} exec --user "${CURRENT_USER_ID}:${CURRENT_USER_GROUP_ID}" ${DOCKER_COMPOSE_APP_CONTAINER} bash "./environment/dev/scripts/init.sh" \ | ||
&& make create-test-db | ||
|
||
check-env-file: | ||
@if [ ! -f ".env" ]; then \ | ||
echo "Create .env file and adjust." ;\ | ||
exit 1;\ | ||
fi; \ | ||
|
||
build: | ||
@docker compose --file ${DOCKER_COMPOSE_FILE} build --pull | ||
|
||
run: | ||
@docker compose --file ${DOCKER_COMPOSE_FILE} up --detach | ||
|
||
stop: | ||
@docker compose --file ${DOCKER_COMPOSE_FILE} stop | ||
|
||
restart: stop run | ||
|
||
shell: | ||
@docker compose --file ${DOCKER_COMPOSE_FILE} exec --user "${CURRENT_USER_ID}:${CURRENT_USER_GROUP_ID}" ${DOCKER_COMPOSE_APP_CONTAINER} bash | ||
|
||
shell-root: | ||
@docker compose --file ${DOCKER_COMPOSE_FILE} exec ${DOCKER_COMPOSE_APP_CONTAINER} bash | ||
|
||
test: | ||
@docker compose --file ${DOCKER_COMPOSE_FILE} exec --user "${CURRENT_USER_ID}:${CURRENT_USER_GROUP_ID}" ${DOCKER_COMPOSE_APP_CONTAINER} composer test | ||
|
||
fix: | ||
@docker compose --file ${DOCKER_COMPOSE_FILE} exec --user "${CURRENT_USER_ID}:${CURRENT_USER_GROUP_ID}" ${DOCKER_COMPOSE_APP_CONTAINER} bash -c 'composer csf' | ||
|
||
analyse: | ||
@docker compose --file ${DOCKER_COMPOSE_FILE} exec --user "${CURRENT_USER_ID}:${CURRENT_USER_GROUP_ID}" ${DOCKER_COMPOSE_APP_CONTAINER} bash -c 'composer analyse' | ||
|
||
dev: | ||
@docker compose --file ${DOCKER_COMPOSE_FILE} exec --user "${CURRENT_USER_ID}:${CURRENT_USER_GROUP_ID}" ${DOCKER_COMPOSE_APP_CONTAINER} bash -c 'npm run dev' | ||
|
||
queue: | ||
@docker compose --file ${DOCKER_COMPOSE_FILE} exec --user "${CURRENT_USER_ID}:${CURRENT_USER_GROUP_ID}" ${DOCKER_COMPOSE_APP_CONTAINER} php artisan queue:work | ||
|
||
create-test-db: | ||
@docker compose --file ${DOCKER_COMPOSE_FILE} exec ${DOCKER_COMPOSE_DATABASE_CONTAINER} bash -c 'createdb --username=${DATABASE_USERNAME} ${TEST_DATABASE_NAME} &> /dev/null && echo "Created database for tests (${TEST_DATABASE_NAME})." || echo "Database for tests (${TEST_DATABASE_NAME}) exists."' | ||
|
||
.PHONY: init check-env-file build run stop restart shell shell-root test fix create-test-db queue analyse dev |
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 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Http\Controllers; | ||
|
||
abstract class Controller | ||
{ | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe better - instead of this, please add me and @kamilpiech97 as code owners