Этот репозиторий содержит бэкенд-часть проекта MyHome, построенного на микросервисной архитектуре из 10 сервисов.
api
account
reference
event
email
chat
correction
document-detail
single-payment-document
payment
MySQL
MongoDB
RabbitMQ
Redis
- Node >= 20
- Docker
docker-compose.yml для RabbitMQ:
version: '3.1'
services:
rmq:
image: rabbitmq:3-management
restart: always
ports:
- "15672:15672"
- "5672:5672"
docker-compose.yml для MongoDB:
version: '3'
services:
mongo:
image: mongo:4.4.4
container_name: mongo
restart: always
environment:
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=admin
ports:
- 27017:27017
volumes:
- ./mongo-data-4.4:/data/db
docker-compose.yml для MySQL:
version: '3.1'
services:
mysql:
image: mysql:latest
container_name: mysql
restart: always
environment:
- MYSQL_ROOT_PASSWORD=admin
- MYSQL_USER=root
- MYSQL_PASSWORD=admin
ports:
- "3306:3306"
volumes:
- ./mysql-data:/var/lib/mysql
docker-compose.yml для Redis:
version: '3'
services:
redis:
image: redis:latest
container_name: redis
restart: always
ports:
- "6379:6379"
volumes:
- ./redis-data:/data
Поднять docker-compose.yml можно docker-compose up -d
в папке с файлом
git clone https://github.com/wybin4/myhome.git
npx nx@latest init
npm install --location=global nx @nrwl/cli
- copy folder envs.exmaple to envs folder
nx run [any]:serve:development
Запуск всех сервисов - nx run-many --target=serve --all --parallel=10
Отдельный запуск сервиса nx run reference:serve:development
, nx run account:serve:development
или nx run api:serve:development
CREATE SCHEMA `account`;
CREATE SCHEMA `reference`;
CREATE SCHEMA `document_detail`;
CREATE SCHEMA `correction`;
CREATE SCHEMA `single_payment_document`;
CREATE SCHEMA `payment`;
CREATE SCHEMA `event`;