An Angular project with custom modifications to enhance structure, maintainability, and code consistency.
To get started with project, follow these steps:
npm install
npm start
The project includes two environment configurations:
environment.ts
(for local development)environment.prod.ts
(for production builds)
/src
/app
/core # Shared code between pages
/modules # Shared code between projects
/pages # Role-based pages (guest, user)
/assets # Static assets
/environments # Configuration files
All Angular components class should follow this structure:
- Readonly variables
- Public variables
- Constructor
- Public functions
- Private variables
- Private functions
- Private variables and functions should start with an underscore (
_
). - Services should be injected in the constructor like this:
public configService: ConfigService private _configService: ConfigService
- Each page has its own module for lazy loading.
- All components required by a page should be built in that module without standalone components.
- Preferably, use
ngFor
with a component andtrackBy
function. - The
modules
folder should include well-documented code containing:- Interfaces
- Services
- Pages
- Components
- Selectors
- The
core
folder contains shared code loaded across all pages. - The
pages
folder contains role-based pages:- Guest (default role)
- User
Critical waw
commands for generating project structures:
waw add MODULENAME
- Creates a new module with:- Interface
- Service
- Page
- Selector
- Form component
- Config
waw page ROLE PAGENAME
- Creates a page under a specific role.waw service SERVICENAME
- Creates a service in thecore
folder.
For the full list of waw
CLI commands, visit the waw Angular CLI repository.
- Do not use any interface decorators.
- Avoid writing code twice (follow DRY principles).
To create a new module:
waw add user
This generates a user
module with all necessary components.
To create a new page for a user role:
waw page user dashboard
To create a new service:
waw service user
The project uses Jest for unit testing.
To run tests:
npm run test
For live testing while developing:
npm run test:watch
This project was forked from the ngx-platform repository. If you want to improve the code base, please submit a pull request to the base repository.
If you wish to contribute to this specific instance, follow these steps:
- Fork the repository.
- Create a new branch for your feature.
- Follow the coding guidelines outlined in this document.
- Submit a pull request for review.