This project is built using Angular and Firebase.
Run ng serve
to start the Angular dev server. It will serve the app on localhost.
Alternatively you can run the dev server in a docker container, by setting the CONTAINER_RUNTIME
environment variable podman can be used instead of docker. The container can be started with make
. It will start a container with the files mounted into the /app
directory in the container and an anonymous volume for the node_modules
. Once the bash is attached to the container the node_modules
have to be installed manually. With npm start
the dev server will be started with all the necessary options.
Can be run locally using the firebase emulator suite with firebase emulators:start
. To make the Angular dev server use the emulator instead of the production database set the useEmulator
property to true
in the dev environment file.
Restarting the emulators will clear all the data from the firestore emulator. The current contents of the emulators can be exported with firebase emulators:export <export directory>
and imported with firebase emulators:start --import <import directory>
.
To enable functions in the emulator to access the production auth API admin credentials are needed. Follow setup in the official docs. Be very careful with the key here, this is a private key!
Running firebase deploy
in the root directory of the repo will automatically build and deploy the entire project. For this firebase-tools need to be installed globally and you have to be logged into your google account.
By running npm build:prod
in the hosting directory the Angular app will be built. This step also automatically puts the current version number into the environment file of the app. Because this step is not repeatable the environment file with the inserted version number should never be comitted. The build can also be done by running ng build
with the optional --prod
flag.
The functions are a standard TypeScript project built with tsc
or just with npm run build
in the functions
directory.
Unit tests of the Angular app can be run in two ways:
- with live reloading and the HTML report by running
ng test
- headless with
npm run test:ci
for running tests in ci
End to end test are not yet implemented but would be run with ng e2e
.
- generate new feature store:
ng generate feature state/articles/article -m pages/articles/articles.module.ts --group
- Angular
- Angular Material
- Firebase
- NgRx
- Hammer.js
- Tag bump tool