https://medium.com/ngx/nestjs-angular-grpc-f8eca5404fc7
Exapmle of Nestjs microservices with gRPC and Angular SPA. Chat with JWT (JWS) authorization and message stream.
- Install protoc and protoc-gen-grpc-web for your OS
- Install nest cli
- Install db-migrate
- Install grpcurl
- Install docker and docker-compose
npm install
in project root directory
Backend:
npm run docker:dev:[up|down|restart]
for backend with docker and all microservices. Debug indocker logs -f [auth|chat|user]
docker logs [auth|chat|user]
or use plugins for docker in your IDEnest start [--debug --watch] [auth|chat|user]
for start without dockernest build [auth|chat|user]
for build distdb-migrate [up|down|reset|create|db] [[dbname/]migrationName|all] [options]
- For example
db-migrate create -e user --sql-file -m apps/user/src/services/dal/db/migrations
Frontend:
cd frontend && npm run start
npm run build --prod
If need regenerate grpc use:
npm run build:grpc:back
for backendnpm run build:grpc:front
for frontendnpm run build:grpc
for all