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
Ensure that you have the required environment configurations in place.
/src
/app
/core # Shared core modules and services
/modules # Feature-specific modules
/pages # Role-based pages (guest, user)
/assets # Static assets
/environments # Configuration files
All Angular components 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
Custom 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.
- 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
To run unit tests:
npm run test
If you wish to contribute, 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.