Skip to content

Commit 5e66d34

Browse files
author
david.martin
committed
first commit
0 parents  commit 5e66d34

File tree

105 files changed

+15799
-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.

105 files changed

+15799
-0
lines changed

.env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
APP_ENV=dev
2+
APP_SECRET=6ed38d84926762794a961a3df88e0261
3+
DATABASE_URL="mysql://user:mypassword@mysql_cont:3306/symfonyelk"
4+
CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$'
5+
ELASTIC_URL='http://elasticsearch:9200'
6+
7+
8+

.env.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# define your env variables for the test env here
2+
KERNEL_CLASS='App\Kernel'
3+
APP_SECRET='$ecretf0rt3st'
4+
SYMFONY_DEPRECATIONS_HELPER=999999
5+
PANTHER_APP_ENV=panther
6+
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
7+
DATABASE_URL="mysql://root:mypassword@mysql_cont:3306/symfonyelk-test"

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
###> symfony/framework-bundle ###
3+
/.env.local
4+
/.env.local.php
5+
/.env.*.local
6+
/config/secrets/prod/prod.decrypt.private.php
7+
/public/bundles/
8+
/var/
9+
/vendor/
10+
###< symfony/framework-bundle ###
11+
12+
###> symfony/phpunit-bridge ###
13+
.phpunit
14+
.phpunit.result.cache
15+
/phpunit.xml
16+
###< symfony/phpunit-bridge ###
17+
18+
### php storm
19+
.idea/
20+
21+

README extended.pdf

202 KB
Binary file not shown.

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Symfony with ELK and fileBeats Stack
2+
3+
**Prerequisites**: Make sure that docker and docker-compose are installed in your machine and available for your console
4+
5+
Download the repository code to a folder in your machine and setup all the needed docker containers running the command
6+
7+
docker-compose up --build
8+
9+
All containers should be up and running and now.
10+
11+
The folder "var" was automatically created because it's a shared volume with the fileBeats container.
12+
We need to take ownership of this folder so later our php container does not have problems writing on it.
13+
14+
Open a new console and type (change 'ourUser' with your own user).
15+
16+
sudo chown -R ourUser var
17+
18+
Open a bash in the recently created php container with
19+
20+
docker exec -it php_cont bash
21+
22+
Run composer install within this bash (composer was installed during the docker php container setup)
23+
24+
composer install
25+
26+
Update the database schema with
27+
28+
php bin/console d:s:u --force
29+
30+
Load the data fixtures with
31+
32+
php bin/console doctrine:fixtures:load
33+
34+
Create the database for the test environment and populate it with fixture data
35+
36+
php bin/console doctrine:database:create --env=test
37+
php bin/console d:s:u --force --env=test
38+
php bin/console doctrine:fixtures:load --env=test
39+
40+
You can launch the provided tests with (It will install php unit the first time)
41+
42+
php bin/phpunit
43+
44+
A postman collection is available in the root directory to test all api methods.
45+
46+
Also, after generating the fixture data and hitting some endpoints using postman you can check elastic logs through kibana and your web browser 'localhost:5602'.
47+
48+
Check the "observability/logs" section by clicking in the hamburguer icon, then click on the "stream live" button and start using the postman to see the log data grow in real time!
49+
50+
If you want a deeper explanation check the "README extended.pdf" file in the root folder.
51+
52+
53+
54+
55+
56+
57+
58+
59+
60+
61+
62+
63+
64+

0 commit comments

Comments
 (0)