Yii2 Angular Boilerplate screenshot

Yii2 Angular Boilerplate

Author Avatar Theme by Chrisleekr
Updated: 2 Jul 2021
228 Stars

Yii2 REST API + Angular 12 Boilerplate (Frontend/Backend)

Categories

Overview

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.

Features

  • API developed using Yii2 framework
  • Backend and frontend developed using Angular 12 and Bootstrap 4
  • JWT (JSON Web Token) for authentication
  • Memcached for caching
  • Staff/Administrator dashboard for managing staff, users, and settings
  • Basic unit tests using Codeception (backend) and Karma+Jasmine (frontend)
  • Moment.js for date and time manipulation
  • Sweet Alert for displaying alerts
  • Underscore.js for data manipulation

Installation

To install the Yii2 REST API + Angular 12 Boilerplate, follow these steps:

  1. Clone the repository:

    git clone [repository-url]
    
  2. Install backend dependencies:

    cd backend
    composer install
    
  3. Rename the .env.example file to .env and configure the necessary environment variables.

  4. Configure the backend database connection in the common/config/main-local.php file.

  5. Apply database migrations:

    php yii migrate
    
  6. Start the backend server:

    php yii serve
    
  7. Install frontend dependencies:

    cd frontend
    npm install
    
  8. Configure the frontend API endpoint in the src/environments/environment.ts file.

  9. Start the frontend development server:

    ng serve
    
  10. Open the application in your browser at http://localhost:4200.

Summary

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.