chrisleekr / yii2-angular-boilerplate

Yii2 REST API + Angular 12 Boilerplate (Frontend/Backend)
https://yam-boilerplate.chrislee.kr/
MIT License
224 stars 101 forks source link
angular-universal angular10 backend boilerplate bootstrap4 dashboard frontend jwt karma-jasmine momentjs protractor-e2e-test registration rest-api server-side-rendering staff-management sweetalert yii2 yii2-rbac

Yii2 REST API + Angular 12 Boilerplate

Build

This is a boilerplate project for future use. The project consists of REST API developed by Yii2 and backend/frontend developed by Angular 12 with Bootstrap 4.

The project involves:

Demo

Service Endpoint
Frontend https://yam-boilerplate.chrislee.kr/frontend
Backend https://yam-boilerplate.chrislee.kr/backend
API https://yam-boilerplate.chrislee.kr/api

Demo

Architecture Diagram

Architecture Diagram

Features

How to start

Currently, the project is not ready for production use. Following steps are suitable for configuring development environment.

To run the application, you will need docker and docker-compose installed.

Open the console and execute following commands.

$ git clone https://github.com/chrisleekr/yii2-angular-boilerplate.git
$ cd yii2-angular-boilerplate
$ docker-compose up -d

With docker-compose, following containers will be configured. Please make sure port 80, 443 are available.

  1. MySQL database will be configured by API migration.
  2. Memcached will be configured.
  3. REST API - Yii 2
    • Database migration will be executed which are located in /api/migrations.
    • PHP-FPM and nginx will be running.
  4. Backend - Angular
    • By default, development mode will be running with nginx.
  5. Frontend - Angular
    • By default, development mode will be running with nginx.

Once all containers are finished compiling, then open the browser.

Files & Folders structures

Setup for production

To run production mode, update docker-compose.yml by changing target: build-stage to target: production-stage for backend and frontend.

Troubleshooting

I changed backend/frontend code, but I cannot see changes in the browser.

As mentioned earlier, you have to open Developer Tool to prevent cache if you are using Chrome. Or clear browser cache and reload again.

TODO