Skip to content

πŸ…°οΈ This is a template project based on the Angular 16 framework, structured as Standalone.

Notifications You must be signed in to change notification settings

Yihsuan1004/angular-boilerplate-standalone

Repository files navigation

angular-boilerplate-standalone

I、Project Description

This is a template project based on the Angular 16 framework, structured as Standalone ; in conjunction withGoogle's gts, it provides a unified standard and check for the project's code and formatting.

Code Style: Google

Features

  1. Commitizen and Prettier: Utilizes tools for code and commit message formatting.
  2. Uses Google Code Style
  3. Commitlint and ESlint: During commit, syntax checks and enforced formatting are performed to ensure consistency in each submission.
  4. Complemented with the use of VScode Extension for automatic formatting and Linting upon file saving.

II、Project Environment and Packages

Environment Setup

tools version
Node.js ^16.14.0 or ^18.10.0
git LTS
Angular cli ^16.1.0

VScode Extension Installation

image-1
Search for @recommended within EXTENSIONS (as shown in the image above), and you will see the Extensions recommended for installation. Please install all of them.

III、Project Startup

Enter the following command to install the packages:

npm install

After the packages are installed, enter the following command to start the project:

ng serve

IV、Project Commit

Enter the following command to invoke the Commitizen tool to assist in writing commit messages:

npm run commit

V、Commands

  • ng serve - Start the development server.
  • ng build - Generate the build package.
  • ng test - Run unit tests.
  • npm run lint - Execute code checks.
  • npm run commit- Use Commitizen to submit changes.

VI、 Project Folder Structure


- πŸ“‚ angular-boilerplate-standalone
  - πŸ“‚ .angular
  - πŸ“‚ .vscode (VSCode Settings)
  - πŸ“‚ .husky (Husky Configuration)
  - πŸ“‚ e2e
  - πŸ“‚ node_modules (Dependencies)
  - πŸ“‚ src
      - πŸ“‚ app
          - πŸ“‚ core (Shared Utility Modules)
               - πŸ“‚ enums (Enumeration Declarations)
                   - πŸ“„ common.enum.ts
               - πŸ“‚ guards (Route Guards)
               - πŸ“‚ utils (Helper Tools)
                   - πŸ“„ common-utils.ts
               - πŸ“‚ consts (Constant Declarations)
                   - πŸ“„ common.consts.ts
               - πŸ“‚ models (Common Data Models)
                   - πŸ“„ a.model.ts
                   - πŸ“„ b.model.ts
               - πŸ“‚ services (Common Services: e.g., Storage)
               - πŸ“‚ validators (Validators)
               - πŸ“‚ interceptors
          - πŸ“‚ features (Feature Modules)
               - πŸ“‚ feature-a
                    - πŸ“„ feature-a.component.html
                    - πŸ“„ feature-a.component.scss
                    - πŸ“„ feature-a.component.ts
                    - πŸ“„ feature-a.component.spec.ts
                    - πŸ“‚ models (Data Models used by the feature)
          - πŸ“‚ shared (Shared Components)
               - πŸ“‚ components (Common Components, e.g., dialog, toast)
               - πŸ“‚ pipes
               - πŸ“‚ directives
               - πŸ“‚ layout (Layout Components, e.g., header, navbar)
          - πŸ“„ app.component.html
          - πŸ“„ app.component.scss
          - πŸ“„ app.component.ts
          - πŸ“„ app.module.ts
          - πŸ“„ app.routing-module.ts
     - πŸ“‚ assets (Static Resources)
         - πŸ“‚ images (Images)
         - πŸ“‚ data (Mock API Data)
         - πŸ“‚ scripts (External JS)
         - πŸ“‚ icons πŸ”Έ
     - πŸ“‚ styles (Style Files)
          - πŸ“„ _custom.scss πŸ”Έ (Styles for External Packages)
          - πŸ“„ styles.scss
     - πŸ“‚ environments (Environment Variables)
          - πŸ“„ environment.ts
          - πŸ“„ environment.prod.ts
     - πŸ“„ index.html
     - πŸ“„ main.ts
     - πŸ“„ polyfills.ts
  - πŸ“„ .eslintrc.json
  - πŸ“„ .eslintignore.json
  - πŸ“„ .lintstagedrc.json
  - πŸ“„ .gitignore
  - πŸ“„ .commitlint.config.js
  - πŸ“„ angular.json
  - πŸ“„ package.json
  - πŸ“„ tsconfig.json
  - πŸ“„ README.md