Skip to content

Latest commit

 

History

History
96 lines (60 loc) · 2.65 KB

developer_setup.md

File metadata and controls

96 lines (60 loc) · 2.65 KB

Developer Setup

This document provides instructions on how to set up the project on your local machine for development purposes.

Prerequisites

Before you start, make sure the following tools are installed on your system:

  • Git: Version control system to clone the project repository Download Git
  • Docker: To containerize the application and ensure it runs consistently across different environments Download Docker
  • Node.js: JavaScript runtime to run the application Download Node.js

Setup

Start by making a copy of the .env.example file and renaming it to .env. This file contains the environment variables that the application needs to run. You can change the values of the variables to match your environment.

Run the following command in the /webapp folder to copy the .env.example file:

cp .env.example .env

Then, you can start the database and the application with the following commands:

source start-database.sh

To access the database, see the database guide.

Pre-commit hooks

To ensure the quality of the codebase, we use pre-commit hooks to run linting and formatting checks before committing the code. This will help to catch any issues early and maintain a consistent code style.

ln -s ../../scripts/pre-commit .git/hooks/pre-commit

Usage

To run the project, you can use the following commands in the /webapp folder:

npm install; npm run dev

This command will install the dependencies and start the application in development mode. You can access the application at http://localhost:3000.

Testing

The project uses both unit tests and E2E tests to ensure the quality of the codebase.

Unit tests

We use Jest for unit tests. You can run the tests with the following command:

npm run test

In addition, you can run the tests in watch mode with the following command:

npm run test:watch

Watch mode will re-run the tests whenever a file changes making it easier to develop new features.

E2E tests

We use Cypress for E2E tests. You can run the tests with the following command:

Interactive mode: Run the following command in root folder to open the Cypress test runner:

npx cypress open

Headless Mode (for running tests in CI):

Run the following command in root folder to run the tests in headless mode:

npm test:e2e

To test the summary assistant

Run the following command in root folder

docker compose run api pytest