Skip to content
This repository was archived by the owner on Mar 7, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ matrix:
- TRAVIS_NODE_VERSION="7.5"
services:
- memcached
-
sudo: required
php: 7.2
env:
- APP_NAME_SUITE="application_without_frontend"
- TRAVIS_NODE_VERSION="7.5"
services:
- memcached
-
sudo: false
php: 7.2
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,23 @@ Install php dependencies using composer
$ composer install
```

Install project :
Install project
```bash
$ bin/console app:install
$ yarn install && yarn build (or "yarn dev" for development usage)
$ symfony server:start --no-tls
```

Remove frontend (optional)

When building a SPA with Angular/React/VueJs or a mobile app, you may just need the administration panel and/or the API.
This command basically leaves you only with the admin, protected routes and the API.
The public part https://monofony.mobizel.com/ here is removed and redirected to the administration panel.

```bash
$ bin/remove-frontend
```

Documentation
-------------

Expand Down
42 changes: 42 additions & 0 deletions bin/remove-frontend
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env php
<?php

use Symfony\Component\Filesystem\Filesystem;

require dirname(__DIR__).'/vendor/autoload.php';

$filesystem = new Filesystem();
$projectDir = dirname(__DIR__);

// Remove routes
$filesystem->remove($projectDir.'/config/routes/frontend');

// redirect homepage to admin dashboard
$data = <<<EOM
app_frontend_homepage:
path: /
defaults:
_controller: FrameworkBundle:Redirect:redirect
route: app_backend_dashboard

EOM;

$filesystem->dumpFile($projectDir.'/config/routes/frontend.yaml', $data);

// Remote templates
$filesystem->remove($projectDir.'/templates/frontend');

// Remove Behat features
$filesystem->remove($projectDir.'/features/account');

// Remove assets
$filesystem->remove($projectDir.'/assets/frontend');

$data = <<<EOM
var backendConfig = require('./assets/backend/webpack.config');

module.exports = [backendConfig];

EOM;

$filesystem->dumpFile($projectDir.'/webpack.config.js', $data);
7 changes: 7 additions & 0 deletions etc/travis/suites/application/script/validate-container
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../../bash/common.lib.sh"

print_header "Validating (DI Container)" "AppName"

run_command "bin/console lint:container"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"

run_command "bin/remove-frontend"
run_command "etc/travis/suites/application/before_install.sh"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"

run_command "etc/travis/suites/application/before_script.sh"
5 changes: 5 additions & 0 deletions etc/travis/suites/application_without_frontend/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"

run_command "etc/travis/suites/application/install.sh"
5 changes: 5 additions & 0 deletions etc/travis/suites/application_without_frontend/is_suitable.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"

run_command "etc/travis/suites/application/is_suitable.sh"
5 changes: 5 additions & 0 deletions etc/travis/suites/application_without_frontend/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../bash/common.lib.sh"

run_command "etc/travis/suites/application/script.sh"