-
Notifications
You must be signed in to change notification settings - Fork 2
Guides
John Lecegues edited this page Mar 15, 2024
·
5 revisions
This section aims to give useful guides & information to the developer.
Guides relating to setting up the project, environment, etc.
- Download the ESLint Extension
- Download the Prettier Extension
- Set to auto-format on save by pressing
CTRL + SHIFT + P
and going toOpen User Settings (JSON)
and adding these:
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
- Run
npm install
in both frontend and backend directories to make sure ESLint and Prettier packages are installed
- There are separate configurations in both frontend/ and backend/, so these steps should be done on both ends.
-
npm run format
will check code formatting using Prettier in the directory -
npm run format:fix
will fix all code formatting errors using Prettier in the directory -
npm run lint
will show all linting errors in the directory -
npm run lint:fix
will fix all linting errors in the directory
-
cd
into the/testing
directory - Run
npm install
thennpx playwright install
; this will install the Playwright browsers and dependencies
- First,
cd
into the folder you want to run tests from (e.g.smoke-test
)
To run the tests normally:
npx playwright test
To run the tests with an interactive UI Window
npx playwright test --ui
To run the debugger and step through the testing phases
npx playwright test --debug
Guides relating to Docker, Docker containers, etc.
To build the container
docker-compose build {--no-cache (does not reuse cache)} {service-name (builds specific service)}
To start all containers
docker-compose up {--build (builds before starting)} {-d (detach from container console)}
To stop all containers
docker-compose down
To list all running containers and their details
docker-compose ps
To attach a running container's bash terminal to interact with it via bash terminal
docker-compose exec {service-name} bash
Special script to find the ip of the containers' postgres serivce
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' term-project-2024-team-4-postgres-1
Additionally, PGAdmin4 can be accessed at http://localhost:5050
. Instructions to access database via PGAdmin4:
- Head to
http://localhost:5050
- Enter credentials specified in
docker-compose.yaml
- At default it will be username:
[email protected]
and password:root
- Press "Connect Server" and enter a name for it (can be anything)
- Head to "Connection" tab and find the "Host name/address" through the terminal using this script:
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' term-project-2024-team-4-postgres-1
- Enter database, username, and password specified in your
.env
file. Default is db:postgres
, username:postgres
, and password:your_password
- Connect and should be able to access "my_database" with pre-generated schemas