Skip to content

Commit

Permalink
Split backend and frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
dignityinside committed Jan 28, 2021
1 parent 6ed1187 commit 58677ed
Show file tree
Hide file tree
Showing 54 changed files with 5 additions and 12,344 deletions.
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ phpunit.phar
/.vagrant

# ignore generated files
/frontend/web/index.php
/frontend/web/index-test.php
/frontend/web/robots.txt
/backend/web/index.php
/backend/web/index-test.php
/backend/web/robots.txt

# laravel mix
/node_modules
/frontend/web/mix-manifest.json
20 changes: 4 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Open Source Bookmark Manager

Backend/API for [Bookmarks-Frontend](https://github.com/dignityinside/bookmarks-frontend).

## Local installation

#### Install Docker (Ubuntu-Linux)
Expand Down Expand Up @@ -33,15 +35,13 @@ su - <username>
#### Add new hosts to your `hosts` File:

```
127.0.0.1 bookmarks.local
127.0.0.1 admin.bookmarks.local
127.0.0.1 api.bookmarks.local
```

#### Development links

```
Frontend: http://bookmarks.local:8025
Backend: http://admin.bookmarks.local:8025
API enpoint: http://api.bookmarks.local:8025
API docs: http://api.bookmarks.local:8025/v1/docs
Expand All @@ -53,18 +53,6 @@ API docs: http://api.bookmarks.local:8025/v1/docs
composer install
```

#### Install all dependencies via NPM

```
npm install
```

#### Build CSS/JavaScript

- `npm run dev` - for development
- `npm run prod` - for production (minified)
- `npm run watch` - for active development

#### Initialize Environment

```
Expand Down Expand Up @@ -98,9 +86,9 @@ php yii_test migrate

# Run all tests
vendor/bin/codecept run
vendor/bin/codecept run -- -c <app_name:api|frontend|backend> <type:api|unit|acceptance|functional> <className>::<methodName>
vendor/bin/codecept run -- -c <app_name:api|backend> <type:api|unit|acceptance|functional> <className>::<methodName>

# Run specific evnviroment tests (also possible: backend, frontend, common)
# Run specific evnviroment tests (also possible: backend, common)
vendor/bin/codecept run -- -c api

# Run all tests within one test class
Expand Down
1 change: 0 additions & 1 deletion codeception.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# global codeception file to run tests from all apps
include:
- common
- frontend
- backend
- api
paths:
Expand Down
1 change: 0 additions & 1 deletion common/config/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
Yii::setAlias('@common', dirname(__DIR__));
Yii::setAlias('@frontend', dirname(dirname(__DIR__)) . '/frontend');
Yii::setAlias('@backend', dirname(dirname(__DIR__)) . '/backend');
Yii::setAlias('@api', dirname(dirname(__DIR__)) . '/api');
Yii::setAlias('@console', dirname(dirname(__DIR__)) . '/console');
39 changes: 0 additions & 39 deletions docker/nginx/conf.d/site.conf
Original file line number Diff line number Diff line change
@@ -1,42 +1,3 @@
server {
server_name bookmarks.local www.bookmarks.local default;
charset utf-8;
client_max_body_size 128M;

listen 80;
root /var/www/frontend/web;
index index.php;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location / {
try_files $uri $uri/ /index.php$is_args$args;
}

# uncomment to avoid processing of calls to non-existing static files by Yii
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;
}
#error_page 404 /404.html;

# deny accessing php files for the /assets directory
location ~ ^/assets/.*\.php$ {
deny all;
}

location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php:9000;
try_files $uri =404;
}

location ~* /\. {
deny all;
}
}

server {
server_name admin.bookmarks.local;
charset utf-8;
Expand Down
2 changes: 1 addition & 1 deletion environments/dev/console/config/main-local.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'components' => [
// fix console create url
'urlManager' => [
'baseUrl' => 'http://bookmarks.local:8025',
'baseUrl' => 'http://admin.bookmarks.local:8025',
],
],
];
2 changes: 0 additions & 2 deletions environments/dev/frontend/web/index-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
require __DIR__ . '/../../common/config/bootstrap.php';
require __DIR__ . '/../config/bootstrap.php';


$config = yii\helpers\ArrayHelper::merge(
require __DIR__ . '/../../common/config/main.php',
Expand Down
1 change: 0 additions & 1 deletion environments/dev/frontend/web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
require __DIR__ . '/../../common/config/bootstrap.php';
require __DIR__ . '/../config/bootstrap.php';

$config = yii\helpers\ArrayHelper::merge(
require __DIR__ . '/../../common/config/main.php',
Expand Down
6 changes: 0 additions & 6 deletions environments/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
'backend/runtime',
'backend/web/assets',
'console/runtime',
'frontend/runtime',
'frontend/web/assets',
'api/runtime',
'api/web/assets',
],
Expand All @@ -47,7 +45,6 @@
'setCookieValidationKey' => [
'backend/config/main-local.php',
'common/config/codeception-local.php',
'frontend/config/main-local.php',
'api/config/main-local.php',
],
],
Expand All @@ -57,8 +54,6 @@
'backend/runtime',
'backend/web/assets',
'console/runtime',
'frontend/runtime',
'frontend/web/assets',
'api/runtime',
'api/web/assets',
],
Expand All @@ -67,7 +62,6 @@
],
'setCookieValidationKey' => [
'backend/config/main-local.php',
'frontend/config/main-local.php',
'api/config/main-local.php',
],
],
Expand Down
22 changes: 0 additions & 22 deletions frontend/assets/AppAsset.php

This file was deleted.

2 changes: 0 additions & 2 deletions frontend/config/.gitignore

This file was deleted.

67 changes: 0 additions & 67 deletions frontend/config/main.php

This file was deleted.

9 changes: 0 additions & 9 deletions frontend/config/params.php

This file was deleted.

33 changes: 0 additions & 33 deletions frontend/controllers/SiteController.php

This file was deleted.

55 changes: 0 additions & 55 deletions frontend/resources/js/app.js

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/resources/js/bus.js

This file was deleted.

Loading

0 comments on commit 58677ed

Please sign in to comment.