GithubHelp home page GithubHelp logo

billowdev / cashflowkub-nestjs-sequelize-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 883 KB

[Hobies Project :)] personal-financial-management-system-nestjs-restful-api

JavaScript 0.35% TypeScript 99.65%

cashflowkub-nestjs-sequelize-api's Introduction

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

package

yarn add @nestjs/swagger dotenv pg pg-hstore sequelize sequelize-typescript @nestjs/config
yarn add class-transformer class-validator 
yarn add @fastify/helmet
yarn add @nestjs/passport @nestjs/jwt passport passport-local passport-jwt
yarn add argon2
yarn add @nestjs/sequelize
yarn add uuid
 
yarn add fastify-multipart



yarn add fastify-multer

yarn add @fastify/static

yarn add -D @types/passport-jwt @types/passport-local
yarn add -D @types/sequelize

migration

sequelize/cli#987 (comment)

npx [email protected] db:migrate
npx sequelize-cli migration:generate --name create-user

FASTIFY

yarn add @nestjs/platform-fastify @fastify/static fastify
----
main.ts
----

const envToLogger = {
  development: {
    transport: {
      target: 'pino-pretty',
      options: {
        translateTime: 'HH:MM:ss Z',
        ignore: 'pid,hostname',
      },
    },
  },
  production: true,
  test: false,
}

async function bootstrap() {
  const app = await NestFactory.create(
    AppModule,
    new FastifyAdapter({
      logger: envToLogger[process.env.NODE_ENV] ?? true
    })
  );

Seeder

npx sequelize-cli seed:create --name user-seeder --seeders-path ./src/database/seeders/
  npx sequelize-cli db:drop                           Drop database specified by configuration
  npx sequelize-cli init                              Initializes project
  npx sequelize-cli init:config                       Initializes configuration
  npx sequelize-cli init:migrations                   Initializes migrations
  npx sequelize-cli init:models                       Initializes models
  npx sequelize-cli init:seeders                      Initializes seeders
  npx sequelize-cli migration:generate                Generates a new migration file
  npx sequelize-cli migration:create                  Generates a new migration file
  npx sequelize-cli model:generate                    Generates a model and its migration
  npx sequelize-cli model:create                      Generates a model and its migration
 
  npx sequelize-cli seed:generate                     Generates a new seed file
  npx sequelize-cli seed:create                       Generates a new seed file

Running Seeds
npx sequelize-cli db:seed:all
Undoing Seeds
Seeders can be undone if they are using any storage. There are two commands available for that:

If you wish to undo the most recent seed:

  npx sequelize-cli db:seed:undo

If you wish to undo a specific seed:

  npx sequelize-cli db:seed:undo --seed name-of-seed-as-in-data

If you wish to undo all seeds:

  npx sequelize-cli db:seed:undo:all

cashflowkub-nestjs-sequelize-api's People

Contributors

billowdev avatar

Watchers

 avatar

cashflowkub-nestjs-sequelize-api'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.