This repository was archived by the owner on Mar 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Setup & Run Instructions
Dylan Barkowsky edited this page Jul 17, 2023
·
5 revisions
Create a .env file in the root of the project. Populate it with values for each key specified in .env.template.
Example values
| KEY | EXAMPLE | DESCRIPTION |
|---|---|---|
| API_PORT | 3004 | The port the API will listen on. |
| MONGO_PORT | 27017 | The port used by MongoDB. |
| MONGO_USERNAME | username | The root admin name for MongoDB. |
| MONGO_PASSWORD | password | The root admin password for MongoDB. |
| MONGO_DATABASE | my-db | The database name for MongoDB. |
| MONGO_SERVICE | mongo | Prod only. The name of the Docker service for MongoDB. |
| ENVIRONMENT | local | Keycloak. Local only. Set to local when running locally. |
| FRONTEND_PORT | 8080 | Keycloak. Local only. The port of the frontend application. |
| FRONTEND_URL | https://... | Keycloak. Production only. URL of frontend application. |
| BACKEND_URL | https://... | Keycloak. Production only. URL of backend application. |
| SSO_CLIENT_ID | my-id-1234 | Keycloak. Client ID. |
| SSO_CLIENT_SECRET | somesecret | Keycloak. Client secret. |
| SSO_AUTH_SERVER_URL | https://... | Keycloak. Authorization URL. |
| GC_NOTIFY_API_KEY | somesecret | API Key for GC Notify. |
| GC_NOTIFY_ADMIN_EMAIL | bob@gmail.com | Email address for admin mailbox. |
| CSS_API_TOKEN_URL | https://... | URL for getting CSS API Token. |
| CSS_API_CLIENT_ID | my-id-1234 | Client ID for CSS API account. |
| CSS_API_CLIENT_SECRET | somesecret | Secret for CSS API account. |
| CSS_API_BASE_URL | https://... | Base URL for CSS API. Used for API calls. |
| JIRA_ACCOUNT_EMAIL | bob@gmail.com | The email account used to access the JIRA project. |
| JIRA_TOKEN | sometoken | Token generated by JIRA to access their API. |
| TESTING | true | Disables Keycloak for API testing. |
| TEST_USERNAME | username | Username used for testing. |
| TEST_PASSWORD | password | Password used for testing. |
This project assumes that you have Docker installed on your system. If not, please install it first.
To start all three local components (Frontend, API, MongoDB), run the following command:
docker-compose up -d.
To stop the entire application, run the following:
docker-compose down
- Clone the repository with:
git clone https://github.com/bcgov/citz-imb-staff-purchasing-reimbursement.git. - Create the .env file and populate its values using the instructions mentioned above in Setup.
- Start the MongoDB container with
docker-compose up -d mongo. - Navigate to
/apiand runnpm run dev. - Navigate to
/appand runnpm run dev. - View the frontend at
http://localhost:8080or whichever port was populated in the.env.
| Command | Description |
|---|---|
npm run lint |
Runs ESLint, which looks for style and syntax errors. |
npm run cypress:component |
Runs any component frontend tests. |
npm run cypress:e2e |
Runs any end-to-end frontend tests. |
npx cypress open |
Opens the Cypress GUI. |
| Command | Description |
|---|---|
npm run lint |
Runs ESLint, which looks for style and syntax errors. |
npm run test |
Runs integration tests using Jest. TESTING ENV must be true. |