Giter Club home page Giter Club logo

bookmark-backend's Introduction

Notice Board

NodeJS backend template

Prerequisite

Belows should be installed on your system before running this code of server.

  • Node.js version 18.14.x or more latest version
  • npm version 9.5.x or more latest version
  • PostgresQL 14.6 (It can be downloaded as a docker image from general)
  • Docker latest version
  • Docker-compose latest version (for development)

Installing

Package installing

npm install --save

Engineering Guide

Preparing Environment

There are all default values in the env files already

  1. Backend environment
    • open ./env/backend.env file and update your desired values.
  2. DB environment
    • open ./env/backend.env file and update your loca values.


Preparing local DB

It's for local developing. The Production DB will be running standalone, please do not connect while you are developing

  • Start DB

    docker-compose -f ./docker/DB-docker-compose.yml --env-file ./deploy/env/postgresql.env up -d
  • Stop and clean up DB

    docker-compose -f ./docker/DB-docker-compose.yml --env-file ./deploy/env/postgresql.env down

  • DB Migration
    • install migration tool
      npm install knex -g
    • Run migration
      knex migrate:latest

Test Commands

Unit test

  • Full test
    npm run test
  • Module test
    npm run test:{folder name}
    • ex> npm run test:dao, npm run test:dao:repositories, npm run test:services


Running Service Commands

run local environment

npm run start:local

run dev environment

npm run start:dev

run production environment

npm run start:prod

Usefull Utilitis

pgcli postgresql Command line Client

  • Install (for Mac)
    brew install pgcli
  • Usage
    • connect
      pgcli -h {HOST} -p {PORT} -u {user}
      ex> $pgcli -h 127.0.0.1 -p 5432 -u book

Postgresql GUI Client

bookmark-backend's People

Contributors

pokers avatar minjuling avatar seongeon-kim avatar dawon00 avatar flyingcop 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.