Yii2 REST API + Angular 12 Boilerplate (Frontend/Backend)
The Yii2 REST API + Angular 12 Boilerplate is a project template that combines the Yii2 PHP framework for the backend REST API and the Angular 12 framework for the frontend. The backend uses Yii2 RBAC (Role-Based Access Control), JWT (JSON Web Token) for authentication, and Memcached for caching. The frontend includes a Staff/Administrator dashboard for managing staff, users, and settings. The project provides basic unit and functional tests using Codeception for the backend and Karma+Jasmine for the frontend.
To install the Yii2 REST API + Angular 12 Boilerplate, follow these steps:
Clone the repository:
git clone [repository-url]
Install backend dependencies:
cd backend
composer install
Rename the .env.example file to .env and configure the necessary environment variables.
Configure the backend database connection in the common/config/main-local.php file.
Apply database migrations:
php yii migrate
Start the backend server:
php yii serve
Install frontend dependencies:
cd frontend
npm install
Configure the frontend API endpoint in the src/environments/environment.ts file.
Start the frontend development server:
ng serve
Open the application in your browser at http://localhost:4200.
The Yii2 REST API + Angular 12 Boilerplate is a project template that combines the Yii2 PHP framework for the backend and the Angular 12 framework for the frontend. It provides a complete solution for building a web application with a RESTful API and a user-friendly interface. The project includes features such as JWT authentication, RBAC, staff and user management, and settings management. It also includes basic unit and functional tests for both the backend and frontend. With this boilerplate, developers can quickly start building their web applications with a solid foundation.