Extensible Angular 14+ enterprise-grade project generator based on angular-cliwith best practices from the community. Includes PWA, Cordova & Electron support, coding guides and more!
See generated project examplehere.
-
A complete starter template:example app structure tailored for scalability, with examples and boilerplate code for every common thing needed in enterprise projects, such as unit tests, routing, authentication, HTTPS service extensions, i18n support with dynamic language change and automatic user language detection...
-
Improved tooling:SCSS & HTML linting, stricter TSLint rules, markdown-based local wiki server for documentation, automated localizable strings extraction, corporate proxy support,Cordovaintegration
-
Extensive base documentation:coding guidesfor TypeScript/SCSS/HTML, Angular onboarding guide, corporate proxy and other toolsconfiguration and usage...
-
Ready-to-use UI components:focus on your app, not on the stack!Choosebetween a Bootstrap 5,Ionicor Angular Materialbased UI with nicely looking, responsive starter templates
-
Mobile/desktop hybrid app support:choose between a web app, a mobile app (usingCordova), a desktop app (usingElectron) or all at the same time using the same code base
-
API proxy example setup:develop and debug faster using any remote server
-
Generator output customization:with the provided add-on support,start multiple projects even faster by plugging in additions that fit your needs, such as your enterprise theme, SSO authentication, services integrations...
And there's even more! SeeWhat's in the boxfor more details.
UsingngX-Rocket CLI
- Install required tools:
npm install -g generator-ngx-rocket
- Create your application:
ngx new
💡 Pro tip: the
ngx
CLI can do more that just bootstrapping new projects! You can use it to run your NPM scripts with fuzzy matching (tryngx ci
for example) or help you maintaining your project up-to-date. Take a look at thefull documentation!
The structure followsAngular style guide.
dist/ app production build
docs/ project docs and coding guides
cypress/ end-to-end tests
src/ project source code
|- app/ app components
| |- @shared/ shared module (common components, directives, pipes and services)
| |- app.component.* app root component (shell)
| |- app.module.ts app root module definition
| |- app-routing.module.ts app routes
| +-... additional modules and components
|- assets/ app assets (images, fonts, sounds...)
|- environments/ values for various build environments
|- theme/ app global scss variables and theme
|- translations/ translations files
|- index.html html entry point
|- main.scss global style entry point
|- main.ts app entry point
|- polyfills.ts polyfills needed by Angular
+- test.ts unit tests entry point
reports/ test and coverage reports
proxy.conf.js backend proxy configuration
Task automation is based onNPM scripts.
Task | Description |
---|---|
npm start |
Run development server onhttp://localhost:4200/ |
npm run serve:sw |
Run test server onhttp://localhost:4200/ with service worker enabled |
npm run build [-- --configuration=production] |
Lint code and build web app for production (withAOT) indist/ |
npm test |
Run unit tests viaKarmaorJestin watch mode |
npm run test:ci |
Lint code and run unit tests once for continuous integration |
npm run e2e |
Run e2e tests usingCypress |
npm run lint |
Lint code |
npm run translations:extract |
Extract strings from code and templates tosrc/app/translations/template.json |
npm run docs |
Display project documentation |
Additional tasks for Cordova-based projects:
Task | Description |
---|---|
npm run cordova:prepare |
Prepare for building mobile app (restore Cordova platforms and plugins) |
npm run cordova:run <ios/android> [--device] |
Run app on target platform device or simulator |
npm run cordova:build [-- --configuration=production] |
Build mobile app for production indist/ folder |
npm run cordova:clean |
Removeswww/ ,platforms/ andplugins/ folders |
Additional tasks for Electron-based projects:
Task | Description |
---|---|
npm run electron:build |
Build desktop app |
npm run electron:run |
Run app on electron |
npm run electron:package |
Package app for all supported platforms |
When building the application, you can specify the target configuration using the additional flag
--configuration <name>
(do not forget to prepend--
to pass arguments to npm scripts).
The default build configuration isproduction
.
Runnpm start
for a dev server. Navigate tohttp://localhost:4200/
.The app will automatically reload if you change
any of the source files.
You should not useng serve
directly, as it does not use the backend proxy configuration by default.
Runnpm run generate -- component <name>
to generate a new component. You can also use
npm run generate -- directive|pipe|service|class|module
.
If you have installedangular-cliglobally withnpm install -g @angular/cli
,
you can also use the commandng generate
directly.
The app template is based onHTML5,TypeScriptand Sass.The translation files use the commonJSONformat.
Development, build and quality processes are based onangular-cliand NPM scripts,which includes:
- Optimized build and bundling process withWebpack
- Development serverwith backend proxy and live reload
- Cross-browser CSS withautoprefixerand browserslist
- Asset revisioning forbetter cache management
- Unit tests usingJasmine,Karmaand headless Chrome
- End-to-end tests usingCypressorProtractor
- Static code analysis:TSLint,Codelyzer, StylelintandHTMLHint
- Local knowledgebase server usingHads
- Automatic code formatting withPrettier
- Deployment with the CLI usingng deploy
Progressive Web App (PWA)support provided by @angular/service-worker.
Native mobile application bundling is based onCordova. Ionic WKWebViewis used for iOS for better performance.
- Angular
- RxJS
- ngx-translate
- UI based on:
- Bootstrap
- Ionic:
- Angular Material
- Optional utility libraries:
- I18n guide
- Working behind a corporate proxy
- Updating dependencies and tools
- Using a backend proxy for development
- Browser routing
- Cordova
- Electron
--packageManager [npm|yarn]
:specify whether to useYarnor NPM as your package manager (default is NPM). You can also use the environment variableNGX_PACKAGE_MANAGER
to set this option globally.--automate <json_file>
:automate prompt answers using specified JSON file (see herefor examples).--addons <addon_name> [<addon_name>]...
:space-separated list of add-ons to use.--no-update
:do no update existing project (see alsoupdating generated projects).--no-analytics
:do not report anonymous usage analytics. You can also use the environment variableNGX_DISABLE_ANALYTICS
to set this option globally.--raw
:do not use any UI library for templates.--tools
:generate only the toolchain, without application template.--location-strategy [hash|path]
:location strategyto use in Angular router (default ispath
).--no-git
:do not initialize git repository.--no-strict
:disable TypeScript strict type checking options.--skip-quickstart
:disable quick start message after project generation.--no-prefix
:do not add@
prefix tocore
/shared
folders.--deploy <option>
:choose automatic deployment option. Usengx n --deploy
to see possible values.
When generating afullstackproject (with both client and server code), you can use the environment variables
NGX_CLIENT_PATH
andNGX_SERVER_PATH
to customize the paths for client and server code. Be aware though that some
add-ons may force specific paths that will preempt your changes.
As new features and newer libraries and tools are added to the generator, you may want to update your project at some point. Here is how we suggest you to do it:
- Make sure your working directory is clean (no pending / uncommited changes).
- Run
ngx update
using theCLIinside your project folder. - The generator will then run again using the same options you used initially, prompting you for each file change. From there the recommended approach is simply to overwrite everything.
- Finally, use your source control to see the diff for each file and merge the changes manually.
Note: you can use the
--tools
option to generate only the toolchain and not application templates, thus reducing the number of changes to merge.
You can customize the generator output to change or enhance it to better suit your needs using add-ons.
To create a new add-on, you can use theaddon
sub-generator of theCLI:
ngx new --addon
See theadd-on generator documentation for more information about add-on creation.
First time contributors are welcome in this project! 🎉
To get started, take a look at thecontributing guide. If you want to help and don't know what you can do, look forgood first contribution issues,or if you're a seasoned OSS contributor look forPR welcome tags.
Thanks for helping ❤️