-
Notifications
You must be signed in to change notification settings - Fork 8
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
0 parents
commit 1faec11
Showing
187 changed files
with
19,456 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,13 @@ | ||
/frontend/node_modules | ||
/api/storage/*.key | ||
/api/vendor | ||
.env | ||
.env.backup | ||
.phpunit.result.cache | ||
Homestead.json | ||
Homestead.yaml | ||
npm-debug.log | ||
yarn-error.log | ||
/.idea | ||
/.vscode | ||
docker-compose-prod.yml |
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,84 @@ | ||
#Vue App | ||
FROM node:erbium as vuejs | ||
RUN mkdir -p /opt/app | ||
COPY frontend/ /opt/app | ||
RUN rm -rf /opt/app/node_modules | ||
WORKDIR /opt/app | ||
RUN npm install && npm run build | ||
|
||
#Server Dependencies | ||
FROM composer:latest as vendor | ||
WORKDIR /app | ||
COPY api/composer.json composer.json | ||
COPY api/composer.lock composer.lock | ||
RUN composer install \ | ||
--ignore-platform-reqs \ | ||
--no-interaction \ | ||
--no-plugins \ | ||
--no-scripts \ | ||
--prefer-dist | ||
|
||
#Image | ||
FROM phpswoole/swoole:5.0-php8.1-alpine as base | ||
LABEL authors="David Smith <[email protected]>" | ||
|
||
#RUN apt-get update && apt-get install -y \ | ||
# git \ | ||
# libzip-dev \ | ||
# nginx \ | ||
# supervisor | ||
|
||
RUN docker-php-ext-install bcmath && \ | ||
docker-php-ext-install sockets | ||
# docker-php-ext-install opcache | ||
|
||
|
||
#RUN { \ | ||
# echo 'opcache.memory_consumption=128'; \ | ||
# echo 'opcache.interned_strings_buffer=8'; \ | ||
# echo 'opcache.max_accelerated_files=4000'; \ | ||
# echo 'opcache.revalidate_freq=2'; \ | ||
# echo 'opcache.fast_shutdown=1'; \ | ||
# echo 'opcache.enable_cli=1'; \ | ||
# } > /etc/php8/conf.d/php-opocache-cfg.ini | ||
|
||
|
||
|
||
# Install nginx | ||
#COPY build/install-nginx.sh / | ||
#RUN bash /install-nginx.sh | ||
#COPY nginx.conf /etc/nginx/sites-enabled/default.conf | ||
|
||
# Install Supervisord | ||
#RUN apt-get update && apt-get install -y supervisor \ | ||
#&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Custom Supervisord config | ||
#COPY build/supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
|
||
# Copy stop-supervisor.sh to kill the supervisor and substasks on app failure | ||
#COPY build/stop-supervisor.sh /etc/supervisor/stop-supervisor.sh | ||
#RUN chmod +x /etc/supervisor/stop-supervisor.sh | ||
|
||
# Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app | ||
#COPY build/start.sh /start.sh | ||
#RUN chmod +x /start.sh | ||
|
||
# Copy the entrypoint that will generate Nginx additional configs | ||
#COPY build/entrypoint.sh /entrypoint.sh | ||
#RUN chmod +x /entrypoint.sh | ||
|
||
COPY --chown=www-data:www-data api /opt/app | ||
COPY --chown=www-data:www-data --from=vendor /app/vendor/ /opt/app/vendor | ||
COPY --chown=www-data:www-data --from=vuejs /opt/app/dist/ /opt/app/public | ||
RUN rm /opt/app/.env | ||
RUN rm -rf /opt/app/storage/* | ||
RUN chown -R www-data:www-data /opt/app/storage | ||
|
||
WORKDIR /opt/app | ||
|
||
EXPOSE 8000 | ||
|
||
VOLUME ["/opt/app/storage"] | ||
|
||
ENTRYPOINT ["docker/start.sh"] |
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 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml,yaml}] | ||
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,58 @@ | ||
APP_NAME=Laravel | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_DEBUG=true | ||
APP_URL=http://localhost | ||
|
||
LOG_CHANNEL=stack | ||
LOG_DEPRECATIONS_CHANNEL=null | ||
LOG_LEVEL=debug | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=api | ||
DB_USERNAME=root | ||
DB_PASSWORD= | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
FILESYSTEM_DISK=local | ||
QUEUE_CONNECTION=sync | ||
SESSION_DRIVER=file | ||
SESSION_LIFETIME=120 | ||
|
||
MEMCACHED_HOST=127.0.0.1 | ||
|
||
REDIS_HOST=127.0.0.1 | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
|
||
MAIL_MAILER=smtp | ||
MAIL_HOST=mailhog | ||
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 | ||
|
||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= | ||
PUSHER_HOST= | ||
PUSHER_PORT=443 | ||
PUSHER_SCHEME=https | ||
PUSHER_APP_CLUSTER=mt1 | ||
|
||
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | ||
VITE_PUSHER_HOST="${PUSHER_HOST}" | ||
VITE_PUSHER_PORT="${PUSHER_PORT}" | ||
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" | ||
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" |
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 | ||
|
||
*.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,16 @@ | ||
/node_modules | ||
/public/build | ||
/public/hot | ||
/public/storage | ||
/storage/*.key | ||
/vendor | ||
.env | ||
.env.backup | ||
.phpunit.result.cache | ||
Homestead.json | ||
Homestead.yaml | ||
auth.json | ||
npm-debug.log | ||
yarn-error.log | ||
/.idea | ||
/.vscode |
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,36 @@ | ||
FROM phpswoole/swoole:5.0-php8.1-alpine | ||
|
||
## Set to keep file permissions same as host for mounted volume | ||
#RUN useradd -m -u 1000 user | ||
|
||
#RUN apt-get update && apt-get install -y \ | ||
# default-mysql-client \ | ||
# git \ | ||
# libzip-dev \ | ||
|
||
RUN apk add --no-cache \ | ||
nodejs \ | ||
npm | ||
|
||
RUN docker-php-ext-install bcmath && \ | ||
docker-php-ext-install sockets | ||
|
||
# Install Composer | ||
#RUN apt-get install -y curl && \ | ||
# curl -sS https://getcomposer.org/installer | php && \ | ||
# mv composer.phar /usr/local/bin/composer && \ | ||
# composer self-update && \ | ||
# apt-get remove --purge curl -y && \ | ||
# apt-get clean | ||
|
||
# Configure PHP | ||
#RUN echo "php_admin_flag[log_errors] = On">>/usr/local/etc/php-fpm.conf | ||
#COPY ./docker/php/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini | ||
|
||
# Install Xdebug | ||
#RUN pecl install xdebug && \ | ||
# docker-php-ext-enable xdebug | ||
|
||
WORKDIR /var/www | ||
|
||
CMD ["php", "artisan", "octane:start", "--watch", "--poll", "--host=0.0.0.0"] |
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,64 @@ | ||
<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"></a></p> | ||
|
||
<p align="center"> | ||
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a> | ||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a> | ||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a> | ||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a> | ||
</p> | ||
|
||
## About Laravel | ||
|
||
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: | ||
|
||
- [Simple, fast routing engine](https://laravel.com/docs/routing). | ||
- [Powerful dependency injection container](https://laravel.com/docs/container). | ||
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. | ||
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). | ||
- Database agnostic [schema migrations](https://laravel.com/docs/migrations). | ||
- [Robust background job processing](https://laravel.com/docs/queues). | ||
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). | ||
|
||
Laravel is accessible, powerful, and provides tools required for large, robust applications. | ||
|
||
## Learning Laravel | ||
|
||
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. | ||
|
||
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 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. | ||
|
||
## Laravel Sponsors | ||
|
||
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 [Patreon page](https://patreon.com/taylorotwell). | ||
|
||
### Premium Partners | ||
|
||
- **[Vehikl](https://vehikl.com/)** | ||
- **[Tighten Co.](https://tighten.co)** | ||
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** | ||
- **[64 Robots](https://64robots.com)** | ||
- **[Cubet Techno Labs](https://cubettech.com)** | ||
- **[Cyber-Duck](https://cyber-duck.co.uk)** | ||
- **[Many](https://www.many.co.uk)** | ||
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)** | ||
- **[DevSquad](https://devsquad.com)** | ||
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)** | ||
- **[OP.GG](https://op.gg)** | ||
- **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)** | ||
- **[Lendio](https://lendio.com)** | ||
|
||
## Contributing | ||
|
||
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). | ||
|
||
## Code of Conduct | ||
|
||
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). | ||
|
||
## Security Vulnerabilities | ||
|
||
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [[email protected]](mailto:[email protected]). All security vulnerabilities will be promptly addressed. | ||
|
||
## License | ||
|
||
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). |
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,56 @@ | ||
<?php | ||
|
||
namespace App\Console\Commands; | ||
|
||
use App\Models\User; | ||
use App\Support\Enums\Role; | ||
use Illuminate\Console\Command; | ||
use Illuminate\Support\Facades\Validator; | ||
use Illuminate\Validation\Rules\Enum; | ||
use Illuminate\Validation\ValidationException; | ||
|
||
class CreateUser extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'create:user {email} {role=user : Role of the user (user|admin)}'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Create a new user'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return int | ||
* @throws ValidationException | ||
*/ | ||
public function handle(): int | ||
{ | ||
$validator = Validator::make($this->arguments(), [ | ||
'email' => ['email'], | ||
'role' => [new Enum(Role::class)] | ||
]); | ||
|
||
if ($validator->errors()->count()) { | ||
foreach ($validator->errors()->messages() as $errors) { | ||
foreach ($errors as $error) { | ||
$this->error($error); | ||
} | ||
} | ||
return 0; | ||
} | ||
|
||
User::create($validator->validated()); | ||
|
||
$this->info('User created'); | ||
|
||
return 0; | ||
} | ||
} |
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,31 @@ | ||
<?php | ||
|
||
namespace App\Console; | ||
|
||
use Illuminate\Console\Scheduling\Schedule; | ||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | ||
|
||
class Kernel extends ConsoleKernel | ||
{ | ||
/** | ||
* Define the application's command schedule. | ||
* | ||
* @param Schedule $schedule | ||
* @return void | ||
*/ | ||
protected function schedule(Schedule $schedule): void | ||
{ | ||
} | ||
|
||
/** | ||
* Register the commands for the application. | ||
* | ||
* @return void | ||
*/ | ||
protected function commands(): void | ||
{ | ||
$this->load(__DIR__.'/Commands'); | ||
|
||
require base_path('routes/console.php'); | ||
} | ||
} |
Oops, something went wrong.