Git Product home page Git Product logo

mulailomba-backend's Introduction

Description

MulaiLomba Backend services, built using NestJs, and the CQRS model.

Installation

$ yarn install

Running the app

# development
$ yarn run start

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod

Migrations

Create Migrations

To create a migration file

$ yarn migration:create <migration-name>

And move it inside the corresponding service's migration folder: migrations/*

Add your migration to the index.ts (eg. migrations/index.ts)

Create Seeder

To create a seeds file (must with prefix seed-*)

To create a seeder factory file (must with prefix seed.<factory-name>.factory.ts)

$ yarn migration:create seed-<seed-name>

And move seed inside the corresponding service's seed folder: src/libs/database/src/seeds/index.ts

Add your migration to the index.ts (eg. seeds/index.ts)

Rule:

  • If your seeder uses constant data, please create a factory first
  • If you used factory files to store data, migrate them back for deletion (down/revert code)
  • If you don't use factory files, you can ignore the migration code back
  • If you use another module for seed data (eg. StringUtils), you must adjust path declaration with (eg. ../../../common/src/utils) instead of (eg. @mualilomba/common)

Execute Migrations

Make sure you ONLY run the migrations/seed on your local database.

# make sure .env has the following
PG_DATABASE_URL=postgres://postgres:postgres@localhost:5432/<your-local-database-name>

To show the migrations/seed

$ yarn migration:show

And then run the migration/seed

$ yarn migration:run

The cloud environment database migrations will be run via CI/CD.

Stay in touch

  • Ghalmas Shanditya Putra Agung - Github

mulailomba-backend's People

Contributors

ghalmasshandityaaa avatar ipramudya avatar

Watchers

 avatar

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.