Skip to content

Commit f189afe

Browse files
author
Flyers
committed
Separated concerns front and back with simulated multi domain environment
2 parents cb68d7b + c385d71 commit f189afe

File tree

100 files changed

+2419
-2814
lines changed

Some content is hidden

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

100 files changed

+2419
-2814
lines changed

.gitignore

+27-25
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
11
# Cache and logs (Symfony2)
2-
/app/cache/*
3-
/app/logs/*
4-
!app/cache/.gitkeep
5-
!app/logs/.gitkeep
2+
/back-end/app/cache/*
3+
/back-end/app/logs/*
4+
!/back-end/app/cache/.gitkeep
5+
!/back-end/app/logs/.gitkeep
66

7-
/app/check.php
7+
/back-end/app/check.php
88

99
# Cache and logs (Symfony3)
10-
/var/cache/*
11-
/var/logs/*
12-
!var/cache/.gitkeep
13-
!var/logs/.gitkeep
10+
/back-end/var/cache/*
11+
!/back-end/var/cache/.gitkeep
12+
/back-end/var/logs/*
13+
!/back-end/var/logs/.gitkeep
1414

1515
# Parameters
16-
/app/config/parameters.yml
17-
/app/config/parameters.ini
16+
/back-end/app/config/parameters.yml
17+
/back-end/app/config/parameters.ini
1818

1919
# Managed by Composer
20-
/app/bootstrap.php.cache
21-
/app/SymfonyRequirements.php
22-
/var/bootstrap.php.cache
23-
/bin/*
20+
/back-end/app/bootstrap.php.cache
21+
/back-end/app/SymfonyRequirements.php
22+
/back-end/var/bootstrap.php.cache
23+
/back-end/bin/*
2424
!bin/console
2525
!bin/symfony_requirements
26-
/vendor/
26+
/back-end/vendor/
2727

2828
# Assets and user uploads
29-
/web/bundles/
30-
/web/uploads/
29+
/back-end/web/bundles/
30+
/back-end/web/uploads/
3131

3232
# Assets managed by Bower
33-
/web/assets/vendor/
33+
/back-end/web/assets/vendor/
3434

3535
# PHPUnit
36-
/app/phpunit.xml
37-
/phpunit.xml
36+
/back-end/app/phpunit.xml
37+
/back-end/phpunit.
3838

39-
# Build data
40-
/build/
39+
# Dist
40+
/front-end/dist
4141

4242
# Composer PHAR
43-
/composer.phar
44-
/composer.lock
43+
*composer.phar
44+
*composer.lock
45+
46+
node_modules

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ php:
88

99
before_script:
1010
- phpenv config-rm xdebug.ini
11+
- cd back-end
1112
- composer self-update
1213
- composer install
1314

README.md

+13-9

app/Resources/views/base.html.twig

-13
This file was deleted.

back-end/Dockerfile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM php:5-fpm
2+
3+
ADD . /var/www
4+
WORKDIR /var/www
5+
6+
RUN usermod -u 1000 www-data
7+
RUN mkdir -p /var/www/app/cache
8+
RUN mkdir -p /var/www/app/logs
9+
RUN chmod -R 777 /var/www/app/cache
10+
RUN chmod -R 777 /var/www/app/logs
11+
12+
RUN apt-get update && apt-get install -y \
13+
libfreetype6-dev \
14+
libjpeg62-turbo-dev \
15+
libmcrypt-dev \
16+
libpng12-dev \
17+
&& docker-php-ext-install -j$(nproc) iconv mcrypt \
18+
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
19+
&& docker-php-ext-install -j$(nproc) gd pdo_mysql
20+
21+
EXPOSE 9000
22+
CMD ["php-fpm"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

back-end/app/config/parameters.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file is auto-generated during the composer install
2+
parameters:
3+
database_driver: pdo_mysql
4+
database_host: db
5+
database_port: null
6+
database_name: symfony
7+
database_user: root
8+
database_password: root
9+
mailer_transport: smtp
10+
mailer_host: 127.0.0.1
11+
mailer_user: null
12+
mailer_password: null
13+
locale: en
14+
secret: ThisTokenIsNotSoSecretChangeIt
File renamed without changes.
File renamed without changes.

app/config/security.yml renamed to back-end/app/config/security.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ security:
2121
wsse_secured:
2222
pattern: ^/api/.*
2323
stateless: true
24+
methods: [GET, POST, PUT]
2425
wsse:
2526
realm: "Secured with WSSE"
2627
profile: "UsernameToken"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
namespace AppBundle\Listener;
3+
4+
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
5+
6+
class CorsListener
7+
{
8+
public function onKernelResponse(FilterResponseEvent $event)
9+
{
10+
$responseHeaders = $event->getResponse()->headers;
11+
$responseHeaders->set('Access-Control-Allow-Headers', 'origin, content-type, accept, X-Requested-With, X-WSSE');
12+
$responseHeaders->set('Access-Control-Allow-Origin', '*');
13+
$responseHeaders->set('Access-Control-Allow-Methods', 'POST, GET, PUT, DELETE, PATCH, OPTIONS');
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
app.cors_listener:
3+
class: AppBundle\Listener\CorsListener
4+
tags:
5+
- { name: kernel.event_listener, event: kernel.response, method: onKernelResponse }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!doctype html>
2+
<html lang="en" ng-app="myApp">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>My AngularJS App</title>
6+
</head>
7+
<body>
8+
</body>
9+
</html>
File renamed without changes.

web/app.php renamed to back-end/web/app.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
date_default_timezone_set("UTC");
4+
35
use Symfony\Component\ClassLoader\ApcClassLoader;
46
use Symfony\Component\HttpFoundation\Request;
57

web/app_dev.php renamed to back-end/web/app_dev.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
date_default_timezone_set("UTC");
4+
35
use Symfony\Component\HttpFoundation\Request;
46

57
// If you don't want to setup permissions the proper way, just uncomment the following PHP line
File renamed without changes.
File renamed without changes.
File renamed without changes.

bin/doctrine

-1
This file was deleted.

bin/doctrine.php

-1
This file was deleted.

bin/karma/config/karma.conf.js

-39
This file was deleted.

bin/karma/config/protractor-conf.js

-19
This file was deleted.

bin/karma/scripts/e2e-test.bat

-12
This file was deleted.

bin/karma/scripts/e2e-test.sh

-18
This file was deleted.

bin/karma/scripts/test-all.sh

-32
This file was deleted.

bin/karma/scripts/test.bat

-11
This file was deleted.

bin/karma/scripts/test.sh

-9
This file was deleted.

0 commit comments

Comments
 (0)