-
Notifications
You must be signed in to change notification settings - Fork 0
Home
- Overview
- Getting Started
- Configuration
- Running the Development Server
- Project Structure
- Code Scaffolding
- Build
- Running Unit Tests
- Running End-to-End Tests
- Environment Setup
- Branching Strategy
- Contribution Guidelines
The Nufacturing Angular App is the frontend component of the Nufacturing application. It is built using Angular and follows best practices for frontend development, including a multi-environment setup and continuous integration processes.
- Node.js (v14.x or higher)
- npm (v6.x or higher)
- Angular CLI (v16.x or higher)
Clone the repository:
git clone https://github.com/yourusername/nufacturing-angular.git
cd nufacturing-angularInstall dependencies:
npm installThe Angular app uses environment files for configuration. Modify the environment.ts and environment.prod.ts files in the src/environments directory to set up your local and production configurations.
Run the following command to start the development server:
ng serveNavigate to http://localhost:4200/. The application will automatically reload if you change any of the source files.
The project follows a modular structure with separate folders for components, pages, services, and environments.
nufacturing-angular/
├── .vscode/
│ ├── extensions.json
│ ├── launch.json
│ └── tasks.json
├── src/
│ ├── app/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── services/
│ │ ├── app-routing.module.ts
│ │ ├── app.component.html
│ │ ├── app.component.scss
│ │ ├── app.component.spec.ts
│ │ └── app.module.ts
│ ├── assets/
│ ├── environments/
│ │ ├── environment.prod.ts
│ │ └── environment.ts
│ ├── styles.scss
│ ├── index.html
│ └── main.ts
├── angular.json
├── package.json
├── README.md
└── tsconfig.json
Run the following command to generate a new component, directive, pipe, service, class, guard, interface, enum, or module:
ng generate component component-nameYou can also use the following variations:
ng generate directive|pipe|service|class|guard|interface|enum|moduleRun the following command to build the project. The build artifacts will be stored in the dist/ directory.
ng buildRun the following command to execute the unit tests via Karma:
ng testRun the following command to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
ng e2eThe Nufacturing Angular App employs a multi-environment setup to facilitate streamlined development, testing, and deployment. The environments include Local, Development, Testing, Staging, and Production.
- Purpose: Provides an isolated space for developers to work on new features and fixes.
-
Setup:
- Local MongoDB
- Local Node.js API
- Local Angular App
- Branching Strategy: Developers create branches from each epic with the epic key ID in the branch name, ensuring organized and traceable changes.
- Purpose: Integrates all individual feature branches to test their interaction.
-
Setup:
- Development MongoDB
- Development API
- Purpose: Runs a full suite of automated tests to catch bugs before code reaches staging or production.
-
Setup:
- Testing MongoDB
- Testing API
- Purpose: Simulates the production environment for final validation before deployment.
-
Setup:
- Staging MongoDB
- Staging API
- Purpose: The live environment where the application is available to end-users.
-
Setup:
- Production MongoDB
- Production API
- Feature Branches: For new features or enhancements.
- Hotfix Branches: For urgent fixes.
- Staging Branch: For pre-production testing.
- Production Branch: For production deployment.
- Enforce Branch Naming Policies: Use Git hooks and GitHub Actions.
- Commit Message Pattern: Follow conventional commit standards.
- Pull Requests: Require pull requests for merging into development, staging, and production branches.
- Fork the repository.
- Create a new feature branch (
git checkout -b feature/NFG-<issue-number>-<short-description>). - Commit your changes with descriptive messages.
- Push your branch (
git push origin feature/NFG-<issue-number>-<short-description>). - Create a pull request.