Skip to content

Commit 63b642a

Browse files
authored
v0.1.0 (#2)
* chore(laravel): initialize Laravel backend * chore(laravel): setup Laravel Sail * chore(github): setup Dependabot * chore(laravel): setup Phpstan * chore(laravel): setup Husky * chore(laravel): setup Laravel Pint * chore(github): setup Laravel CI
1 parent baae038 commit 63b642a

63 files changed

Lines changed: 13930 additions & 14 deletions

Some content is hidden

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

.github/dependabot.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: 2
2+
updates:
3+
# === PHP / Laravel Backend ===
4+
- package-ecosystem: "composer"
5+
directories:
6+
- "/server-laravel-backend"
7+
schedule:
8+
interval: "weekly"
9+
open-pull-requests-limit: 10
10+
rebase-strategy: "auto"
11+
allow:
12+
- dependency-type: "all"
13+
labels:
14+
- "dependencies"
15+
- "composer"
16+
commit-message:
17+
prefix: "[composer]"
18+
include: "scope"
19+
20+
- package-ecosystem: "npm"
21+
directories:
22+
- "/server-laravel-backend"
23+
schedule:
24+
interval: "weekly"
25+
labels:
26+
- "dependencies"
27+
- "npm"
28+
commit-message:
29+
prefix: "[npm]"
30+
include: "scope"

.github/workflows/laravel.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Laravel CI
2+
3+
on:
4+
push:
5+
branches: [ "main", "develop" ]
6+
pull_request:
7+
branches: [ "develop" ]
8+
9+
jobs:
10+
laravel-tests:
11+
runs-on: ubuntu-latest
12+
13+
services:
14+
mysql:
15+
image: mysql:8.0
16+
env:
17+
MYSQL_ROOT_PASSWORD: root
18+
MYSQL_DATABASE: laravel
19+
MYSQL_USER: sail
20+
MYSQL_PASSWORD: password
21+
ports:
22+
- 3306:3306
23+
options: >-
24+
--health-cmd="mysqladmin ping -uroot -proot"
25+
--health-interval=5s
26+
--health-timeout=5s
27+
--health-retries=10
28+
29+
redis:
30+
image: redis:alpine
31+
ports:
32+
- 6379:6379
33+
34+
mailpit:
35+
image: axllent/mailpit:latest
36+
ports:
37+
- 1025:1025
38+
- 8025:8025
39+
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Set up Docker Buildx
44+
uses: docker/setup-buildx-action@v3
45+
46+
- name: Wait for MySQL
47+
run: |
48+
until mysqladmin ping -h 127.0.0.1 -uroot -proot; do
49+
echo "Waiting for MySQL..."
50+
sleep 2
51+
done
52+
53+
- name: Set up PHP
54+
uses: shivammathur/setup-php@v2
55+
with:
56+
php-version: '8.3'
57+
extensions: mbstring, bcmath, pcntl, curl, redis, pdo_mysql
58+
ini-values: post_max_size=256M, memory_limit=512M
59+
coverage: none
60+
61+
- name: Copy .env
62+
working-directory: server-laravel-backend
63+
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
64+
65+
- name: Install Composer dependencies
66+
working-directory: server-laravel-backend
67+
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
68+
69+
- name: Generate APP_KEY
70+
working-directory: server-laravel-backend
71+
run: php artisan key:generate
72+
73+
- name: Set Permissions
74+
working-directory: server-laravel-backend
75+
run: chmod -R 777 storage bootstrap/cache
76+
77+
- name: Run Migrations
78+
working-directory: server-laravel-backend
79+
env:
80+
DB_CONNECTION: mysql
81+
DB_HOST: 127.0.0.1
82+
DB_PORT: 3306
83+
DB_DATABASE: laravel
84+
DB_USERNAME: sail
85+
DB_PASSWORD: password
86+
run: php artisan migrate --force
87+
88+
- name: Install NodeJS
89+
uses: actions/setup-node@v3
90+
with:
91+
node-version: '22'
92+
93+
- name: Clean NPM cache
94+
working-directory: server-laravel-backend
95+
run: npm cache clean --force
96+
97+
- name: Install NPM dependencies
98+
working-directory: server-laravel-backend
99+
run: npm ci
100+
101+
- name: Build assets (Vite)
102+
working-directory: server-laravel-backend
103+
run: npm run build
104+
105+
- name: Clear Config Cache
106+
working-directory: server-laravel-backend
107+
run: php artisan config:clear
108+
109+
- name: Run Laravel Pint
110+
working-directory: server-laravel-backend
111+
run: vendor/bin/pint --test
112+
113+
- name: Run Larastan
114+
working-directory: server-laravel-backend
115+
run: vendor/bin/phpstan analyse
116+
117+
- name: Run Tests
118+
working-directory: server-laravel-backend
119+
env:
120+
DB_CONNECTION: mysql
121+
DB_HOST: 127.0.0.1
122+
DB_PORT: 3306
123+
DB_DATABASE: laravel
124+
DB_USERNAME: sail
125+
DB_PASSWORD: password
126+
run: php artisan test
Lines changed: 18 additions & 0 deletions
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+
[compose.yaml]
18+
indent_size = 4
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
APP_NAME=Laravel
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_URL=http://localhost
6+
7+
APP_LOCALE=en
8+
APP_FALLBACK_LOCALE=en
9+
APP_FAKER_LOCALE=en_US
10+
11+
APP_MAINTENANCE_DRIVER=file
12+
# APP_MAINTENANCE_STORE=database
13+
14+
PHP_CLI_SERVER_WORKERS=4
15+
16+
BCRYPT_ROUNDS=12
17+
18+
LOG_CHANNEL=stack
19+
LOG_STACK=single
20+
LOG_DEPRECATIONS_CHANNEL=null
21+
LOG_LEVEL=debug
22+
23+
DB_CONNECTION=sqlite
24+
# DB_HOST=127.0.0.1
25+
# DB_PORT=3306
26+
# DB_DATABASE=laravel
27+
# DB_USERNAME=root
28+
# DB_PASSWORD=
29+
30+
SESSION_DRIVER=database
31+
SESSION_LIFETIME=120
32+
SESSION_ENCRYPT=false
33+
SESSION_PATH=/
34+
SESSION_DOMAIN=null
35+
36+
BROADCAST_CONNECTION=log
37+
FILESYSTEM_DISK=local
38+
QUEUE_CONNECTION=database
39+
40+
CACHE_STORE=database
41+
# CACHE_PREFIX=
42+
43+
MEMCACHED_HOST=127.0.0.1
44+
45+
REDIS_CLIENT=phpredis
46+
REDIS_HOST=127.0.0.1
47+
REDIS_PASSWORD=null
48+
REDIS_PORT=6379
49+
50+
MAIL_MAILER=log
51+
MAIL_SCHEME=null
52+
MAIL_HOST=127.0.0.1
53+
MAIL_PORT=2525
54+
MAIL_USERNAME=null
55+
MAIL_PASSWORD=null
56+
MAIL_FROM_ADDRESS="hello@example.com"
57+
MAIL_FROM_NAME="${APP_NAME}"
58+
59+
AWS_ACCESS_KEY_ID=
60+
AWS_SECRET_ACCESS_KEY=
61+
AWS_DEFAULT_REGION=us-east-1
62+
AWS_BUCKET=
63+
AWS_USE_PATH_STYLE_ENDPOINT=false
64+
65+
VITE_APP_NAME="${APP_NAME}"
Lines changed: 11 additions & 0 deletions
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
Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,30 @@
1-
/vendor/
1+
*.log
2+
.DS_Store
3+
.env
4+
.env.backup
5+
.env.production
6+
.phpactor.json
7+
.phpunit.result.cache
8+
/.fleet
9+
/.idea
10+
/.nova
11+
/.phpunit.cache
12+
/.vscode
13+
/.zed
14+
/.vagrant
15+
auth.json
216
node_modules/
317
npm-debug.log
418
yarn-error.log
19+
/public/build
20+
/public/hot
21+
/public/storage
22+
/storage/*.key
23+
/storage/pail
24+
/vendor
25+
Homestead.json
26+
Homestead.yaml
27+
Thumbs.db
528

629
# Laravel 4 specific
730
bootstrap/compiled.php
@@ -15,16 +38,5 @@ public/hot
1538
public_html/storage
1639
public_html/hot
1740

18-
storage/*.key
19-
.env
20-
Homestead.yaml
21-
Homestead.json
22-
/.vagrant
23-
.phpunit.result.cache
24-
25-
/public/build
26-
/storage/pail
27-
.env.backup
28-
.env.production
29-
.phpactor.json
30-
auth.json
41+
# Phpstan Baseline
42+
phpstan-baseline.neon
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
wsl
3+
cd server-laravel-backend || exit 1
4+
5+
./vendor/bin/phpstan analyse --memory-limit=2G
6+
7+
# Format staged PHP files using Laravel Pint
8+
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E "\.php$" || true)
9+
10+
if [ -n "$STAGED_FILES" ]; then
11+
for FILE in $STAGED_FILES; do
12+
./vendor/bin/pint "$FILE" > /dev/null 2>&1
13+
git add "$FILE"
14+
done
15+
fi

server-laravel-backend/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
2+
3+
<p align="center">
4+
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
5+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
6+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
7+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
8+
</p>
9+
10+
## About Laravel
11+
12+
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
13+
14+
- [Simple, fast routing engine](https://laravel.com/docs/routing).
15+
- [Powerful dependency injection container](https://laravel.com/docs/container).
16+
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
17+
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
18+
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
19+
- [Robust background job processing](https://laravel.com/docs/queues).
20+
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
21+
22+
Laravel is accessible, powerful, and provides tools required for large, robust applications.
23+
24+
## Learning Laravel
25+
26+
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
27+
28+
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
29+
30+
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
31+
32+
## Laravel Sponsors
33+
34+
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
35+
36+
### Premium Partners
37+
38+
- **[Vehikl](https://vehikl.com)**
39+
- **[Tighten Co.](https://tighten.co)**
40+
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
41+
- **[64 Robots](https://64robots.com)**
42+
- **[Curotec](https://www.curotec.com/services/technologies/laravel)**
43+
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
44+
- **[Redberry](https://redberry.international/laravel-development)**
45+
- **[Active Logic](https://activelogic.com)**
46+
47+
## Contributing
48+
49+
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
50+
51+
## Code of Conduct
52+
53+
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
54+
55+
## Security Vulnerabilities
56+
57+
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
58+
59+
## License
60+
61+
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
declare(strict_types = 1);
4+
namespace App\Http\Controllers;
5+
6+
abstract class Controller {}

0 commit comments

Comments
 (0)