| Component | Status |
|---|---|
| Frontend - GitHub Pages | |
| Backend - Railway | |
| E2E - Playwright tests |
-
Create file in the root with db credentials
.envPORT= UI_URL= DB_PORT= DB_HOST= DB_NAME= DB_USERNAME= DB_PASSWORD= MAIL_SMTP_SERVICE=smtp.gmail.com [email protected] MAIL_APP_PASSWORD= AUTH_AT_SECRET=__AUTH_AT_SECRET__ AUTH_RT_SECRET=__AUTH_RT_SECRET__ ``` -
Fulfill
code/backend/home-expenses-api/src/datasource.tsfor db and migrationimport { DataSource, DataSourceOptions } from 'typeorm'; export const datasourceOptions: DataSourceOptions = { type: 'mssql', host: 'DB_HOST', username: 'DB_USERNAME', password: 'DB_PASSWORD', database: 'DB_NAME', entities: ['dist/modules/expenses/db/*.js', 'dist/modules/users/db/*.js'], migrations: ['dist/migration/*.js'] }; const dataSource = new DataSource(datasourceOptions); export default dataSource;
-
Install packages
$ npm i
-
Running the app:
# development with watch mode $ npm run start:dev # production mode $ npm run start:prod
npm run migration:generate -- src/migration/YouSriptFilenpm run migration:run# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov- Install nodejs version 18.14.0 from here
- You can try the latest version, but there is no guaranty that it will work properly
- This project runs on
nodev18.14.0 andnpmv9.3.1 and usesangular-cliv15
- Edit your
\etc\hosts(C:\Windows\System32\drivers\etc\hosts) file to include the following line:127.0.0.1 local.home-expenses.com - For local running open command line and execute following commands:
- go to
code/frontend/home-expenses-uifolder - Run
npm i - Run
npm start-localfor local UI + local backend - Run in a lightweight nodejs mode:
npm i -g http-servernpm run build-localcd docshttp-server --p 8081
- Run
npm start-railwayfor local UI + remote backend (railway)
- go to
- Navigate to:
https://local.home-expenses.com:8444
cd code/frontend/home-expenses-ui
npm run test- Configure
.envfile with following content:PLAYWRIGHT_USERNAME=<ASK TEAM> PLAYWRIGHT_PASSWORD=<ASK TEAM> APP_URL=https://local.home-expenses.com:8444 - Provide
APP_URLfor the app which you want to test locally - Install Playwright with Chromium:
npx playwright install --with-deps chromium
- Run tests locally:
- start app and run tests
npm run start-local(with running local backend) or justnpm run start-railway(with remote backend)npm run e2eornpm run e2e-uiwith UI mode
- run tests for any real env:
npm run e2e-local:cinpm run e2e-dev:ci
- start app and run tests
- Check reports
e2e:show-reportfor local report fromplaywright-reportfolder by default- create your own npm script
playwright show-report <PATH_TO_PLAYWRIGHT_REPORT_FOLDER>to run from anywhere
- Locally run
npm run deploy - Do not modify folder
docsto something else inside angular.json"outputPath": "docs",.docsfolder is a requirement for correct GitHub Pages deployment (https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#about-publishing-sources) - Not every merge to frontend app triggers GitHub Pages deployment. Usually html diff should occur.
| Environment | UI | Backend | Swagger URL |
|---|---|---|---|
| dev | https://unlimit1984.github.io/home-expenses/all-expenses | https://home-expenses-dev.up.railway.app | https://home-expenses-dev.up.railway.app/api |
| prod | - | - | - |