Amazon Web Services wrapper
-
Pay attention, that we have certain quality criteria, which we should follow during application development.
TODO: explain domain
Database schema is available here. There is a couple of conventions:
- Data is divided into several schemas. Tables are named as follows:
{schema}___{table}
. In postgres it should be converted into{schema}.{table}
.
- React as a frontend library
- Redux + Redux Toolkit as a state manager
- Assets - static assets (images, global styles)
- Common - common/shared files (types, enums)
- Components - plain react components
- Exceptions
- Helpers
- Services - api accessing services
- Store - redux store with all features as sub folders
- Validation-schemas - schemas that used for forms validation
- Api - rest endpoints. There should be no domain logic
- Common - common/shared files (types, enums)
- Data - everything related to data access (migrations, models, repositories)
- Exceptions
- Helpers
- Services - domain logic
- Validation-schemas - schemas that used for input data validation
As we are already using js on both frontend and backend it would be useful to share some contracts and code between them.
- Joi as a schema validator
- Create and fill all .env files. These files are:
- .env/frontend.env
- .env/backend.env
- .env/postgres.env
You should use .env.example folder as a reference.
-
Install dependencies (node_modules). Run
npm run install:all
in the root folder. -
Install pre-commit hooks:
npx simple-git-hooks
in the root folder. This hook is used to verify code style on commit. -
Run database. You can either run it in docker using command
cd ./docker/bws && docker-compose -f docker-compose.services.yml up --build
or by installing postgres on your computer. Docker variant is preferred. -
Apply migrations:
cd backend && npm run migrate:dev
-
Run backend:
cd backend && npm run start:dev
-
Run frontend:
cd frontend && npm run start
- Create and fill all .env files. These files are:
- .env/frontend.env
- .env/backend.env
- .env/postgres.env
You should use .env.example folder as a reference.
- Run docker:
cd .docker/bws && docker-compose -f docker-compose.yml up --build
All code is hosted in docker containers on AWS. CI/CD implemented using Github Actions