- Node.js 18v >= always use NVM locally
- Firebase (Auth, Firestore, Analytics)
$ git clone https://github.com/michaeljwright/agile-lead-platform.git $ cd agile-lead-platform- Copy
.env-exampleand rename to.env-local - Go to https://firebase.google.com and create a project for a webapp. Then add the details to the
.env-localfile. - Create a Firebase firestore db and set rules to those within
firestore-rules.txt - Remember to change the
SITE_URLin.env-localif you are using a different server or port. - If you're deploying to a live environment, its worth setting
ANONYMOUS_SIGNIN_ENABLEDin your env to blank (not false).
$ npm install # or $ yarn # Run in Development $ npm run dev # or $ yarn dev # Run in Production $ npm run build $ npm run start #or $ yarn build $ yarn startA lot of work needs doing on the test coverage. We are working on it!
To run the unit tests, simply run npm test
To run the E2E tests, you need to jump through a few hoops due to Firebase auth etc.
- Generate and download a service account as described in https://firebase.google.com/docs/admin/setup#initialize_the_sdk_in_non-google_environments
- Create the file
./serviceAccount.jsonin your project root and add the contents of the downloaded json file from above. - Create the file
./cypress.env.jsonin your project root and add the following below.
{ "TEST_UID": "<YOUR API KEY>", "FIREBASE_PROJECT_ID": "<YOUR API KEY>", "FIREBASE_API_KEY": "<YOUR API KEY>" }- Run the tests with cypress using
npx cypress openand then selecting the specific tests you want to run.