- npm >= 8.1.2
- node >= 16.13.1
Install the dependencies
npm install
As a second step the dev environment must be set. To do the process a bit easier, you can run the command
npm start init
Please update the firebase and the microsoft parameters.
export const environment = {
production: false,
versionNumber: 'v2.0.0',
prefix: 'T-',
// Firebase Config
firebase: {
apiKey: '',
authDomain: '',
databaseURL: '',
projectId: '',
storageBucket: '',
messagingSenderId: '',
appId: '',
measurementId: '',
},
globals: {
team1: 0,
team2: 1,
round1: 0,
round2: 1,
round3: 2,
},
// MS Auth
ms: {
tenant: '',
},
};
npm run start
Instead of using your Firebase backend, you can use Emulators that run locally.
To install the Emulator Suite, run this command
firebase init emulators
and choose the Emulators you need.
If you want to use different ports, you can rerun firebase init emulators
or edit the
firebase.json
file. To change the paths to the Security Rules, you can also edit the
firebase.json
file.
Without configuration, the emulators will use the default ports and run with open data security.
In the file app.module.ts
you have to set the ports for the connections to the ports of the Emulator.
You also have to add the useEmulators
property and set it to true
in environment.ts
.
You can set the prefix
property to an empty string when using the emulator for Firestore,
because it won't affect the data in production.
export const environment = {
useEmulators: true,
production: false,
versionNumber: 'v2.0.0',
prefix: '',
// Firebase Config
firebase: {
apiKey: '',
authDomain: '',
databaseURL: '',
projectId: '',
storageBucket: '',
messagingSenderId: '',
appId: '',
measurementId: '',
},
globals: {
team1: 0,
team2: 1,
round1: 0,
round2: 1,
round3: 2,
},
// MS Auth
ms: {
tenant: '',
},
};
If you use the Emulator for the database, you must set the databaseURL
to URL of the Emulator,
which you can retrieve from the terminal while the emulator is running.
To start the Emulators, run this command.
firebase emulators:start
To import data into the emulator that you have previously exported, you can run this command.
firebase emulators:start --import <path-to-directory>
To import production data to the Local Emulator you have to export the data first. Follow these instructions to export your data:
-
Login to Firebase and Google Cloud:
firebase login gcloud auth login
-
List your projects and connect to the project you want to export:
firebase projects:list firebase use your-project-name gcloud projects list gcloud config set project your-project-name
-
Export the production data to a Google Cloud Storage bucket, providing a name for the folder:
gcloud firestore export gs://your-project-name.appspot.com/your-choosen-folder-name
-
Copy this folder to your local machine:
gsutil -m cp -r gs://your-project-name.appspot.com/your-choosen-folder-name .
Now you run the Emulator with the exported production data using the command mentioned above.
For more information, see this guide.
With prettier, eslint and husky we set up the linting process. To check linting manuel, you can use this command
npm run p:check
npm run p:write
👤 evia solution GmbH
- Website: https://www.evia.de/
- Github: @evia Academy
- LinkedIn: @evia Gruppe
Copyright © 2023 evia innovation GmbH.
This project is MIT licensed.