Giter Site home page Giter Site logo

nestjs-rabbitmq-microservices's Introduction

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

nestjs-rabbitmq-microservices's People

Contributors

mguay22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nestjs-rabbitmq-microservices's Issues

Migrations setup

With this architecture , how do you setup the migrations . I've been trying since couple of days , without success.

I di the below :

`
const configService = new ConfigService();

export const dataSourceOptions: DataSourceOptions = {
type: 'postgres',
url: configService.get('POSTGRES_URL'),
entities: ['dist/**/.entity.js'],
migrations: ['dist/migrations/
.js'],
logging: true,
synchronize: false,
};

const dataSource = new DataSource(dataSourceOptions);

export default dataSource;
`

then in packagejson
"typeorm": "npm run build && npx typeorm -d ./libs/common/src/config/data-source.ts", "migration:generate": "npm run typeorm -- migration:generate", "migration:run": "npm run typeorm -- migration:run", "migration:revert": "npm run typeorm -- migration:revert",
and finnally i run the command
npm run typeorm -- migration:generate "migrations/create-users"

but i'm getting the error
Error: Unable to open file: "/home/zoutigo/projets/ordering/ordering_app/libs/common/src/config/data-source.ts". Cannot use import statement outside a module
at Function.loadDataSource (/home/zoutigo/projets/ordering/ordering_app/node_modules/typeorm/commands/CommandUtils.js:22:19)
at async Object.handler (/home/zoutigo/projets/ordering/ordering_app/node_modules/typeorm/commands/MigrationGenerateCommand.js:68:26)
Could you please tell we what i'm doing wrong ?

App not starting with a mongoDB error

After Full install and a npm start dev, getting the following error message. 3 docker mongoDB containers are successfully started.

[Nest] 3492 - 21/05/2024 15:49:53 ERROR [MongooseModule] Unable to connect to the database. Retrying (1)...

Docker Compose Error

NOTE : The docker-compose is for orders only.

services:
  orders:
    build:
      context: .
      dockerfile: ./apps/orders/Dockerfile
      target: development
    command: npm run start:dev orders
    env_file:
      - ./apps/orders/.env
    depends_on:
      - mongodb-primary
      - mongodb-secondary
      - mongodb-arbiter
    volumes:
      - .:/usr/src/app
      - /usr/src/app/node_modules
    ports:
      - '3000:3000'
  mongodb-primary:
    image: docker.io/bitnami/mongodb:5.0
    environment:
      - MONGODB_ADVERTISED_HOSTNAME=mongodb-primary
      - MONGODB_REPLICA_SET_MODE=primary
      - MONGODB_ROOT_PASSWORD=password123
      - MONGODB_REPLICA_SET_KEY=replicasetkey123
    volumes:
      - 'mongodb_master_data:/bitnami/mongodb'
    ports:
      - '27017:27017'

  mongodb-secondary:
    image: docker.io/bitnami/mongodb:5.0
    depends_on:
      - mongodb-primary
    environment:
      - MONGODB_ADVERTISED_HOSTNAME=mongodb-secondary
      - MONGODB_REPLICA_SET_MODE=secondary
      - MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary
      - MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=password123
      - MONGODB_REPLICA_SET_KEY=replicasetkey123

  mongodb-arbiter:
    image: docker.io/bitnami/mongodb:5.0
    depends_on:
      - mongodb-primary
    environment:
      - MONGODB_ADVERTISED_HOSTNAME=mongodb-arbiter
      - MONGODB_REPLICA_SET_MODE=arbiter
      - MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary
      - MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=password123
      - MONGODB_REPLICA_SET_KEY=replicasetkey123

volumes:
  mongodb_master_data:
    driver: local

ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services: 'mongodb-primary'
Unsupported config option for volumes: 'mongodb_master_data'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.