Giter VIP home page Giter VIP logo

nestjs-microservices's Introduction

Nest Logo

Description

Nest framework TypeScript starter repository.

Installation

in the project root ( assuming youh ave docker in your environment )

docker compose up 

Running the app

make sure that you have docker installed in order to spin op all the services. Each service should have it's .env.sample file that you need to convert into .env files. Add the ports that you want each service to have. Note: auth, roles, permissions each have tcp ports for internal communication, since roles, and permissions supply proper authorizatino, and auth supplies authentication. --

ENV FILES

Every service has it's own .env.example file that contains the env keys that are needed in the current version. Run the following command on all the ENVs to turn them into .env files

mv .env.example .env
docker compose up

-- By watchinng the logs in attached mode, you can see if there are any exceptions along the way.

Setting Up MongoDB For Local Development (MAC OS & Linux)

See this DOC FILE for more info FIRST: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/ Enter the following commands in the terminal:

brew tap mongodb/brew
brew update
brew install mongodb-community

NOTE:

the mongod.conf file may have different locations depending on your OS.

MAC OS INTEL PROCESSOR:

conf file location: /usr/local/etc/mongod.conf log directory location: /usr/local/var/log/mongodb data directory location: /usr/local/var/mongodb

MAC OS SILICON PROCESSOR:

conf file location: /opt/homebrew/etc/mongod.conf log directory location: /opt/homebrew/var/log/mongodb data directory location: /opt/homebrew/var/mongodb

WHEN YOU HAVE INSTALLED MONGODB:

Create the following bash method in your .bash_profile file:

function mongo() {
  if [ $# -eq 0 ]; then
      echo "Opening MongoDB Service Client ..."
      brew services start mongodb-community

      echo  "Verifying that MongoDB has started successfully ... "
      ps aux | grep -v grep | grep mongod
  fi
  if [ "$1" = "--restart" ]; then
    echo "Restarting the mongodb service ..."
    brew services restart mongodb-services
  fi  
  if [ "$1" = "--stop" ]; then
    echo "Stopping MongoDB Service ..."
    brew services stop mongodb-community
  fi  
}

open your conf file with nano, vim, or code,

systemLog:
  destination: file
  path: /usr/local/var/log/mongodb/mongo.log
  logAppend: true
storage:
  dbPath: /usr/local/var/mongodb
net:
  bindIp: 127.0.0.1, ::1
  ipv6: true

TELL MONGOD WHERE TO STORE DATA:

Note the location of the log file and associate it with the mongod executable.

mongod --dbpath /usr/local/var/mongodb

connect mongo shell ( MONGOSH ) to your local MongoDB instance:

mongosh "mongodb://127.0.0.1:12027/database_name"

KEEP MongoDB and MONGOSH updated:

brew update
brew upgrade mongodb-community
brew upgrade mongosh

Test

# unit tests
$ pnpm run test

# e2e tests
$ pnpm run test:e2e

# test coverage
$ pnpm 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-microservices's People

Contributors

redbonzai avatar

Watchers

 avatar

nestjs-microservices's Issues

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.