Example app with Angular 8 + Angular CLI + Angular Universal + i18n + Firebase
:clap::clap::tada::tada::tada::tada::clap::clap:
Base project made with much :heart:. Contains CRUD, patterns, generated library, and much more!
LIVE DEMOโ
โ
Report bugโ
ยท
Request featureโ
This project is copied from angular8โ and all credits for the content will go to the ones that deserved them :-)
This project will be used to develop and test CICD pipelines for OpenShift, Kubernetes, AWS, and other cloud platforms.
The first section of the docker-compose.yml describes the development configuration. It runs node. The application should be developed from within the container to avoid any external dependencies.
docker-compose up
docker exec -ti nodejs-angular-heroes bash
cd /app
npm install
npm test
npm start
export CHROME_BIN=/app/node_modules/node_modules/chromium
The first section of the docker-compose.yml describes how the CICD pipeline would build and test the application and make it ready for production. The application will eventually run on bare nginx only.
Files changed from the original project:
--host 0.0.0.0 --port 4200 to start to be able to expose portThis project is using version 8 of angular but Ivy is not enabled. I'm trying to do it, but some errors appear during this process. I would accept any pull request about this because no one till now knows what to do...
This project is deployed in firebase using Angular Universal and the official i18n. You can navigate through every language and reload (and share) every page in the application without losing context. This is very useful for SEO purposes and you almost have a ready for production app. If you want to translate the messages you can use this awesome tool, Tiny Translatorโ or follow this tutorialโ .
I've created a medium post where you can find a tutorial to apply this concepts to your own project. Check it hereโ , and let me know what do you think.
This repo is using Firebase. We use Cloud Firestore and Cloud Storage to handle CRUD operations over the heroes and to store their images. Also Hosting and Functions to deploy the app with Universal.
We use Travis CI to run this tasks in order:
WARNING
Verify that you are running node 10.16.0 by running node -v in a terminal/console window. Older versions produce errors, but newer versions are fine.
npm i
npm start
| Tasks | Description |
|---|---|
| npm start | Start the app in development mode with the english language only |
| npm start:es | Start the app in development mode with the spanish language only |
| start:ssr | Start the server like SSR |
| extract-i18n | Extract all messages from templates and ts files and update the language files with new translations |
| npm run lint | Run the linter (tslint) |
| npm run test | Run all unit tests with karma and jasmine |
| npm run test:app:watch | Run app unit tests and wait for changes |
| npm run test:library:watch | Run library unit tests and wait for changes |
| npm run e2e | Run end to end tests with protractor |
| npm run build:prod:en | Build the app for production with english translations |
| npm run build:prod:es | Build the app for production with spanish translations |
| npm run build:server:prod | Build the server version for production |
| npm run compile:server | Compiles the server with webpack |
| npm run build:ssr | Complete task with all the build subtasks for SSR |
| npm run build:library | Build the library |
| npm run serve:ssr | Start the node server for angular universal |
| npm run validate:server | Script that validate if server generated previously starts without error |
| npm run bundle-report | Build and run webpack-bundle-analyzer over stats json |
| npm run release:minor | Create a new minor release using standard-version |
| npm run release:major | Create a new major release using standard-version |
| npm run ci | Execute linter, tests and production builds |
| npm run deploy | Build the app and deploy it to firebase hosting |
Have a bug or a feature request? Please first read the issue guidelinesโ and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issueโ .
Please read through our contributing guidelinesโ . Included are directions for opening issues, coding standards, and notes on development.
Moreover, all HTML and CSS should conform to the Code Guideโ , maintained by Ismael Ramosโ .
Editor preferences are available in the editor configโ for easy use in common text editors. Read more and download plugins at https://editorconfig.org/โ .
Ismael Ramos
Thanks to all contributors and their support.
If you have an idea or you want to do something, tell me or just do it! I'm always happy to hear your feedback!
Code and documentation copyright 2018 the authors. Code released under the MIT Licenseโ .
Enjoy :metal:
Content type
Image
Digest
Size
37.2 MB
Last updated
over 5 years ago
docker pull jmaclean/nodejs-angular-heroes