Skip to content

Commit f0bae61

Browse files
committed
Initial commit
1 parent ead1bb4 commit f0bae61

File tree

98 files changed

+14414
-1907
lines changed

Some content is hidden

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

98 files changed

+14414
-1907
lines changed

Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@ FROM php:7.4-fpm-alpine
22

33
WORKDIR /var/www/html
44

5-
RUN apk update apk add --no-cache curl vim wget bash
5+
RUN apk update apk add --no-cache \
6+
curl \
7+
vim \
8+
wget \
9+
bash \
10+
libfreetype6-dev \
11+
libjpeg62-turbo-dev \
12+
libmcrypt-dev \
13+
libpng-dev
614

715
RUN set -ex \
816
&& apk --no-cache add \
@@ -12,4 +20,4 @@ RUN docker-php-ext-install pdo pdo_pgsql \
1220
&& apk --no-cache add pcre-dev ${PHPIZE_DEPS} \
1321
&& pecl install xdebug \
1422
&& docker-php-ext-enable xdebug \
15-
&& apk del pcre-dev ${PHPIZE_DEPS}
23+
&& apk del pcre-dev ${PHPIZE_DEPS}

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ services:
3030
environment:
3131
POSTGRES_USER: ${POSTGRES_USER}
3232
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
33-
POSTGRES_DB: ${POSTGRES_DATABASE}
33+
POSTGRES_DB: ${POSTGRES_DB}
3434
SERVICE_TAGS: dev
3535
SERVICE_NAME: postgres
3636
volumes:

src/.env.example

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
APP_NAME=Laravel
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_URL=http://localhost
6+
7+
LOG_CHANNEL=stack
8+
9+
DB_CONNECTION=mysql
10+
DB_HOST=127.0.0.1
11+
DB_PORT=3306
12+
DB_DATABASE=laravel
13+
DB_USERNAME=root
14+
DB_PASSWORD=
15+
16+
BROADCAST_DRIVER=log
17+
CACHE_DRIVER=file
18+
QUEUE_CONNECTION=sync
19+
SESSION_DRIVER=file
20+
SESSION_LIFETIME=120
21+
22+
REDIS_HOST=127.0.0.1
23+
REDIS_PASSWORD=null
24+
REDIS_PORT=6379
25+
26+
MAIL_MAILER=smtp
27+
MAIL_HOST=smtp.mailtrap.io
28+
MAIL_PORT=2525
29+
MAIL_USERNAME=null
30+
MAIL_PASSWORD=null
31+
MAIL_ENCRYPTION=null
32+
MAIL_FROM_ADDRESS=null
33+
MAIL_FROM_NAME="${APP_NAME}"
34+
35+
AWS_ACCESS_KEY_ID=
36+
AWS_SECRET_ACCESS_KEY=
37+
AWS_DEFAULT_REGION=us-east-1
38+
AWS_BUCKET=
39+
40+
PUSHER_APP_ID=
41+
PUSHER_APP_KEY=
42+
PUSHER_APP_SECRET=
43+
PUSHER_APP_CLUSTER=mt1
44+
45+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
46+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

src/.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto
2+
*.css linguist-vendored
3+
*.scss linguist-vendored
4+
*.js linguist-vendored
5+
CHANGELOG.md export-ignore

src/.gitignore

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
/node_modules
2+
/public/hot
3+
/public/storage
4+
/storage/*.key
15
/vendor
2-
/.idea
3-
Homestead.json
4-
Homestead.yaml
56
.env
7+
.env.backup
68
.phpunit.result.cache
9+
Homestead.json
10+
Homestead.yaml
11+
npm-debug.log
12+
yarn-error.log

src/.styleci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,12 @@ php:
22
preset: laravel
33
disabled:
44
- unused_use
5-
js: true
5+
finder:
6+
not-name:
7+
- index.php
8+
- server.php
9+
js:
10+
finder:
11+
not-name:
12+
- webpack.mix.js
613
css: true

src/README.md

Lines changed: 75 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,85 @@
1-
# Microservices
1+
<p align="center"><img src="https://res.cloudinary.com/dtfbvvkyp/image/upload/v1566331377/laravel-logolockup-cmyk-red.svg" width="400"></p>
2+
3+
<p align="center">
4+
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
5+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/d/total.svg" alt="Total Downloads"></a>
6+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/v/stable.svg" alt="Latest Stable Version"></a>
7+
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/license.svg" 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+
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 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.
29+
30+
## Laravel Sponsors
31+
32+
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).
33+
34+
### Premium Partners
35+
36+
- **[Vehikl](https://vehikl.com/)**
37+
- **[Tighten Co.](https://tighten.co)**
38+
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
39+
- **[64 Robots](https://64robots.com)**
40+
- **[Cubet Techno Labs](https://cubettech.com)**
41+
- **[Cyber-Duck](https://cyber-duck.co.uk)**
42+
- **[Many](https://www.many.co.uk)**
43+
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
44+
- **[DevSquad](https://devsquad.com)**
45+
46+
### Community Sponsors
47+
48+
<a href="https://op.gg"><img src="http://opgg-static.akamaized.net/icon/t.rectangle.png" width="150"></a>
49+
50+
- [UserInsights](https://userinsights.com)
51+
- [Fragrantica](https://www.fragrantica.com)
52+
- [SOFTonSOFA](https://softonsofa.com/)
53+
- [User10](https://user10.com)
54+
- [Soumettre.fr](https://soumettre.fr/)
55+
- [CodeBrisk](https://codebrisk.com)
56+
- [1Forge](https://1forge.com)
57+
- [TECPRESSO](https://tecpresso.co.jp/)
58+
- [Runtime Converter](http://runtimeconverter.com/)
59+
- [WebL'Agence](https://weblagence.com/)
60+
- [Invoice Ninja](https://www.invoiceninja.com)
61+
- [iMi digital](https://www.imi-digital.de/)
62+
- [Earthlink](https://www.earthlink.ro/)
63+
- [Steadfast Collective](https://steadfastcollective.com/)
64+
- [We Are The Robots Inc.](https://watr.mx/)
65+
- [Understand.io](https://www.understand.io/)
66+
- [Abdel Elrafa](https://abdelelrafa.com)
67+
- [Hyper Host](https://hyper.host)
68+
- [Appoly](https://www.appoly.co.uk)
69+
- [云软科技](http://www.yunruan.ltd/)
270

3-
## Project Steps
4-
5-
1. Created Dockerfile for php - this enables the install and enable of specific tools: vi, pdo, xdebug
6-
7-
Note: This would require changes for deployment as Postgres saves credentials based on OS anyone who accesses the container is able to make changes, this would require additional authentication along with the removal of `bash` from the used images to prevent unwarranted access to the container.
8-
9-
2. Created `docker-compose.yml` in this file the containers are set up (see README.md in root).
10-
11-
This is conducted to ensure the environment is reproducible. In this example I modified the LAMP stack I usually use to instead utilise postgres over MySQL, along with the addition of containers for additional technologies: RabbitMQ.
12-
13-
3. Created docker volume - this is a workaround, usually I would add a volume in the compose file linked to a directory within the root, this folder would be ignored by .gitignore, however, postgres does not allow for this, instead, the data is persisted in a volume and the database populated through a .sql file.
14-
15-
4. Created SQL for creation of database, and data population.
16-
17-
5. Created Models for the database tables
18-
19-
6. Create Controllers for each model.
20-
21-
Utilising object oriented programming each of these is done through a class, due to some issues, mentioned below, this is the further milestone in a 2 hour period.
22-
23-
## Occuring Issues
24-
25-
1. Postgres does not allow dir/data:db/data - workaround to use a docker volume instead.
26-
27-
2. Postgres security concern - this would have to be rectified in a deployment image to ensure only warranted access is permitted due to postgres policies.
28-
29-
3. RabbitMQ starts without enabled plugins - as a workaround a enabled file was created and added via the volume: `./rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins` to ensure the necessary plugins were enabled at startup.
30-
31-
## Next
32-
In continuation of this project I would first set up controllers for each model, furthermore I would first focus on developign the foreign service to send data to the microservice.
33-
34-
From here the microservice should then check the received payload type, this should then route the informaiton to the correct microservices only. Using RabbitMQ this service would be the producer, the other services would act as consumers picking up the information from RabbitMQ based on the provided ruleset.
35-
36-
More experience is required utilising RabbitMQ and Lumen before stepping to the next section. As such, I will continue working on these skills as I have not experienced these technologies before now.
37-
38-
# Lumen PHP Framework
39-
40-
[![Build Status](https://travis-ci.org/laravel/lumen-framework.svg)](https://travis-ci.org/laravel/lumen-framework)
41-
[![Total Downloads](https://poser.pugx.org/laravel/lumen-framework/d/total.svg)](https://packagist.org/packages/laravel/lumen-framework)
42-
[![Latest Stable Version](https://poser.pugx.org/laravel/lumen-framework/v/stable.svg)](https://packagist.org/packages/laravel/lumen-framework)
43-
[![License](https://poser.pugx.org/laravel/lumen-framework/license.svg)](https://packagist.org/packages/laravel/lumen-framework)
44-
45-
Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Lumen attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as routing, database abstraction, queueing, and caching.
46-
47-
## Official Documentation
71+
## Contributing
4872

49-
Documentation for the framework can be found on the [Lumen website](https://lumen.laravel.com/docs).
73+
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
5074

51-
## Contributing
75+
## Code of Conduct
5276

53-
Thank you for considering contributing to Lumen! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
77+
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).
5478

5579
## Security Vulnerabilities
5680

57-
If you discover a security vulnerability within Lumen, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed.
81+
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.
5882

5983
## License
6084

61-
The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
85+
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

src/app/Console/Commands/.gitkeep

Whitespace-only changes.

src/app/Console/Kernel.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace App\Console;
44

55
use Illuminate\Console\Scheduling\Schedule;
6-
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
6+
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
77

88
class Kernel extends ConsoleKernel
99
{
@@ -24,6 +24,18 @@ class Kernel extends ConsoleKernel
2424
*/
2525
protected function schedule(Schedule $schedule)
2626
{
27-
//
27+
// $schedule->command('inspire')->hourly();
28+
}
29+
30+
/**
31+
* Register the commands for the application.
32+
*
33+
* @return void
34+
*/
35+
protected function commands()
36+
{
37+
$this->load(__DIR__.'/Commands');
38+
39+
require base_path('routes/console.php');
2840
}
2941
}

src/app/Events/Event.php

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)