Skip to content

Commit 4f4c5d2

Browse files
kamilpiech97mtraczkrzysztofrewak
authored
#1 - project skeleton (#15)
* #1 - project skeleton * #1 - gitignore update * #1 - fix * #1 - delete .composer dir * #1 - wip * #1 - added readme * #1 - readme fixes * Update composer.json Co-authored-by: Marcin Tracz <marcin.tracz@blumilk.pl> * Update .env.example Co-authored-by: Marcin Tracz <marcin.tracz@blumilk.pl> * #1 - cr fixes * #1 - changed readme name * Apply suggestions from code review Co-authored-by: Marcin Tracz <marcin.tracz@blumilk.pl> * Update environment/dev/app/Dockerfile Co-authored-by: Marcin Tracz <marcin.tracz@blumilk.pl> * #1 - cr fixes * Update resources/views/app.blade.php Co-authored-by: Krzysztof Rewak <krzysztof.rewak@blumilk.pl> * Update app/Http/Middleware/EncryptCookies.php Co-authored-by: Krzysztof Rewak <krzysztof.rewak@blumilk.pl> * #1 - cr fixes * #1 - small fixes * #1 - csf * #1 - composer fix * #1 - readme update --------- Co-authored-by: Marcin Tracz <marcin.tracz@blumilk.pl> Co-authored-by: Krzysztof Rewak <krzysztof.rewak@blumilk.pl>
1 parent 3cebbb1 commit 4f4c5d2

File tree

94 files changed

+14809
-0
lines changed

Some content is hidden

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

94 files changed

+14809
-0
lines changed

.editorconfig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2
16+
17+
[docker-compose.yml]
18+
indent_size = 4

.env.ci

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
APP_NAME=escooters
2+
APP_ENV=testing
3+
APP_KEY=base64:WVG2VcHt+a2uzCw7n1tVUBPyw2kof644d6EoYA/UUAg=
4+
APP_DEBUG=false
5+
APP_URL=http://escooters.blumilk.localhost
6+
7+
LOG_CHANNEL=stack
8+
LOG_LEVEL=debug
9+
10+
BROADCAST_DRIVER=log
11+
CACHE_DRIVER=array
12+
FILESYSTEM_DISK=local
13+
QUEUE_CONNECTION=sync
14+
SESSION_DRIVER=array
15+
SESSION_LIFETIME=120
16+
MAIL_MAILER=array

.env.example

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
APP_NAME=Escooters
2+
APP_ENV=local
3+
APP_KEY=base64:sCsJw8z+d/4ymp0OvzSip2h4Vp2hZZhpV2uOxgTqP94=
4+
APP_DEBUG=true
5+
APP_URL=http://escooters.blumilk.localhost
6+
7+
LOG_CHANNEL=stack
8+
LOG_DEPRECATIONS_CHANNEL=null
9+
LOG_LEVEL=debug
10+
11+
DB_CONNECTION=pgsql
12+
DB_HOST=escooters-db-dev
13+
DB_PORT=5432
14+
DB_DATABASE=escooters
15+
DB_USERNAME=escooters
16+
DB_PASSWORD=password
17+
DB_ROOT_PASSWORD=example
18+
19+
BROADCAST_DRIVER=log
20+
CACHE_DRIVER=redis
21+
FILESYSTEM_DISK=local
22+
QUEUE_CONNECTION=redis
23+
SESSION_DRIVER=redis
24+
SESSION_LIFETIME=120
25+
26+
REDIS_HOST=escooters-redis-dev
27+
REDIS_PASSWORD=null
28+
REDIS_PORT=6379
29+
30+
MAIL_MAILER=smtp
31+
MAIL_HOST=mailpit
32+
MAIL_PORT=1025
33+
MAIL_USERNAME=null
34+
MAIL_PASSWORD=null
35+
MAIL_ENCRYPTION=null
36+
MAIL_FROM_ADDRESS="hello@example.com"
37+
MAIL_FROM_NAME="${APP_NAME}"
38+
39+
# DOCKER
40+
DOCKER_APP_HOST_PORT=3851
41+
DOCKER_INSTALL_XDEBUG=true
42+
DOCKER_DATABASE_HOST_PORT=3853
43+
DOCKER_MAILPIT_DASHBOARD_HOST_PORT=3856
44+
DOCKER_REDIS_HOST_PORT=3852
45+
46+
DOCKER_HOST_USER_ID=1000

.eslintrc.js

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
module.exports = {
2+
env: {
3+
node: true,
4+
'vue/setup-compiler-macros': true,
5+
},
6+
extends: [
7+
'plugin:vue/base',
8+
'eslint:recommended',
9+
'plugin:vue/vue3-recommended',
10+
'plugin:tailwindcss/recommended',
11+
],
12+
rules: {
13+
semi: ['error', 'never'],
14+
quotes: ['error', 'single'],
15+
indent: ['error', 2],
16+
'block-spacing': ['error', 'always'],
17+
'keyword-spacing': ['error'],
18+
'padding-line-between-statements': [ 'error', {
19+
blankLine: 'always', prev: '*', next: ['return', 'block-like'],
20+
}],
21+
'space-before-blocks': ['error', 'always'],
22+
'eol-last': ['error', 'always'],
23+
'vue/multi-word-component-names': 0,
24+
'vue/first-attribute-linebreak': 0,
25+
'vue/max-attributes-per-line': 0,
26+
'vue/html-indent': ['error', 2],
27+
'comma-dangle': ['error', 'always-multiline'],
28+
'comma-spacing': ['error'],
29+
'key-spacing': ['error'],
30+
'object-curly-spacing': ['error', 'always'],
31+
'tailwindcss/no-custom-classname': 0,
32+
'vue/require-default-prop': 0,
33+
'vue/padding-line-between-blocks': ['error', 'always'],
34+
'vue/component-tags-order': ['error', {
35+
'order': ['script', 'template', 'style'],
36+
}],
37+
},
38+
}

.gitattributes

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* text=auto eol=lf
2+
3+
*.blade.php diff=html
4+
*.css diff=css
5+
*.html diff=html
6+
*.md diff=markdown
7+
*.php diff=php
8+
9+
/.github export-ignore
10+
CHANGELOG.md export-ignore
11+
.styleci.yml export-ignore

.github/dependabot.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: composer
5+
directory: "/"
6+
schedule:
7+
interval: monthly
8+
time: "06:30"
9+
timezone: "Europe/Warsaw"
10+
commit-message:
11+
prefix: "- (php) "
12+
target-branch: main
13+
open-pull-requests-limit: 1
14+
15+
- package-ecosystem: npm
16+
directory: "/"
17+
schedule:
18+
interval: monthly
19+
time: "06:30"
20+
timezone: "Europe/Warsaw"
21+
commit-message:
22+
prefix: "- (js) "
23+
target-branch: main
24+
open-pull-requests-limit: 1
25+
26+
- package-ecosystem: github-actions
27+
directory: "/"
28+
schedule:
29+
interval: monthly
30+
time: "06:30"
31+
timezone: "Europe/Warsaw"
32+
commit-message:
33+
prefix: "- (github actions) "
34+
target-branch: main
35+
open-pull-requests-limit: 1
36+
37+
- package-ecosystem: docker
38+
directory: "/environment/dev/app"
39+
schedule:
40+
interval: monthly
41+
time: "06:30"
42+
timezone: "Europe/Warsaw"
43+
commit-message:
44+
prefix: "- (docker dev) "
45+
target-branch: main
46+
open-pull-requests-limit: 1

.github/worklflows/check-pr-title.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Check PR Title
2+
on:
3+
pull_request:
4+
branches: [ "main" ]
5+
types: [opened, edited, synchronize, ready_for_review, reopened]
6+
7+
jobs:
8+
check-pr-title:
9+
name: Check PR title
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: blumilksoftware/action-pr-title@v1.2.0
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test & lint JS codebase
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
types: [opened, synchronize, reopened, ready_for_review]
7+
paths:
8+
- '**.js'
9+
- '**.vue'
10+
- 'package.json'
11+
- 'package.lock'
12+
13+
jobs:
14+
test-and-lint-js:
15+
name: Test & lint JS codebase
16+
timeout-minutes: 10
17+
if: github.event.pull_request.draft == false
18+
runs-on: ubuntu-22.04
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- name: Cache dependencies
24+
uses: actions/cache@v2
25+
with:
26+
path: node_modules
27+
key: ${{ runner.os }}-npm-dependencies-${{ hashFiles('package.lock') }}
28+
restore-keys: ${{ runner.os }}-npm-dependencies
29+
30+
- name: Set up node
31+
uses: actions/setup-node@v3
32+
with:
33+
node-version: 20
34+
35+
- name: Instal npm dependencies
36+
run: npm clean-install
37+
38+
- name: Run JS linter
39+
run: npm run lint
+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Test & lint PHP codebase
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
types: [opened, synchronize, reopened, ready_for_review]
7+
paths:
8+
- '**.php'
9+
- 'composer.json'
10+
- 'composer.lock'
11+
- 'phpunit.xml'
12+
- 'env.ci'
13+
14+
jobs:
15+
test-and-lint-php:
16+
name: Test & lint PHP codebase
17+
timeout-minutes: 10
18+
if: github.event.pull_request.draft == false
19+
runs-on: ubuntu-22.04
20+
services:
21+
pgsql:
22+
image: postgres:15.2-alpine3.17
23+
env:
24+
POSTGRES_DB: escooters
25+
POSTGRES_USER: escooters
26+
POSTGRES_PASSWORD: password
27+
# Set health checks to wait until postgres has started
28+
options: >-
29+
--health-cmd pg_isready
30+
--health-interval 3s
31+
--health-timeout 3s
32+
--health-retries 5
33+
ports:
34+
- 5432:5432
35+
36+
steps:
37+
- uses: actions/checkout@v3
38+
39+
- name: Validate composer.json and composer.lock
40+
run: composer validate
41+
42+
- name: Cache dependencies
43+
uses: actions/cache@v3
44+
with:
45+
path: vendor
46+
key: ${{ runner.os }}-composer-dependencies-${{ hashFiles('composer.lock') }}
47+
restore-keys: ${{ runner.os }}-composer-dependencies
48+
49+
- name: Setup PHP
50+
uses: shivammathur/setup-php@v2
51+
with:
52+
php-version: 8.2
53+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, intl
54+
coverage: none
55+
56+
- name: Install Composer dependencies
57+
run: composer install --prefer-dist --no-interaction --no-suggest
58+
59+
- name: Run PHP linter
60+
run: composer cs
61+
62+
- name: Execute tests
63+
run: php artisan test --env=ci

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/node_modules
2+
/public/hot
3+
/public/storage
4+
/public/js/
5+
/public/css/
6+
/public/mix-manifest.json
7+
/vendor
8+
.env
9+
.env.backup
10+
.phpunit.result.cache
11+
docker-compose.override.yml
12+
Homestead.json
13+
Homestead.yaml
14+
npm-debug.log
15+
yarn-error.log
16+
google-credentials.json
17+
.idea/
18+
.vscode/
19+
.composer
20+
/public/build/
21+
.appversion
22+
supervisord.pid

Makefile

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
export COMPOSE_DOCKER_CLI_BUILD = 1
2+
export DOCKER_BUILDKIT = 1
3+
4+
include .env
5+
6+
SHELL := /bin/bash
7+
8+
DOCKER_COMPOSE_FILE = docker-compose.yaml
9+
DOCKER_COMPOSE_APP_CONTAINER = app
10+
DOCKER_COMPOSE_DATABASE_CONTAINER = database
11+
12+
CURRENT_USER_ID = $(shell id --user)
13+
CURRENT_USER_GROUP_ID = $(shell id --group)
14+
CURRENT_DIR = $(shell pwd)
15+
16+
TEST_DATABASE_NAME=escooters-test
17+
18+
init: check-env-file
19+
@make build \
20+
&& make run \
21+
&& 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" \
22+
&& make create-test-db
23+
24+
check-env-file:
25+
@if [ ! -f ".env" ]; then \
26+
echo "Create .env file and adjust." ;\
27+
exit 1;\
28+
fi; \
29+
30+
build:
31+
@docker compose --file ${DOCKER_COMPOSE_FILE} build --pull
32+
33+
run:
34+
@docker compose --file ${DOCKER_COMPOSE_FILE} up --detach
35+
36+
stop:
37+
@docker compose --file ${DOCKER_COMPOSE_FILE} stop
38+
39+
restart: stop run
40+
41+
shell:
42+
@docker compose --file ${DOCKER_COMPOSE_FILE} exec --user "${CURRENT_USER_ID}:${CURRENT_USER_GROUP_ID}" ${DOCKER_COMPOSE_APP_CONTAINER} bash
43+
44+
shell-root:
45+
@docker compose --file ${DOCKER_COMPOSE_FILE} exec ${DOCKER_COMPOSE_APP_CONTAINER} bash
46+
47+
test:
48+
@docker compose --file ${DOCKER_COMPOSE_FILE} exec --user "${CURRENT_USER_ID}:${CURRENT_USER_GROUP_ID}" ${DOCKER_COMPOSE_APP_CONTAINER} composer test
49+
50+
fix:
51+
@docker compose --file ${DOCKER_COMPOSE_FILE} exec --user "${CURRENT_USER_ID}:${CURRENT_USER_GROUP_ID}" ${DOCKER_COMPOSE_APP_CONTAINER} bash -c 'composer csf'
52+
53+
queue:
54+
@docker compose --file ${DOCKER_COMPOSE_FILE} exec --user "${CURRENT_USER_ID}:${CURRENT_USER_GROUP_ID}" ${DOCKER_COMPOSE_APP_CONTAINER} php artisan queue:work
55+
56+
create-test-db:
57+
@docker compose --file ${DOCKER_COMPOSE_FILE} exec ${DOCKER_COMPOSE_DATABASE_CONTAINER} bash -c 'createdb --username=dev ${TEST_DATABASE_NAME} &> /dev/null && echo "Created database for tests (${TEST_DATABASE_NAME})." || echo "Database for tests (${TEST_DATABASE_NAME}) exists."'
58+
59+
.PHONY: init check-env-file build run stop restart shell shell-root test fix create-test-db queue

0 commit comments

Comments
 (0)