🔏
starhackit
  • README
  • Getting started
    • Requirements
    • Quick Start
  • Frontend
    • The Frontend
      • Npm scripts
    • Unit testing
    • End 2 End Testing
    • Multi Application
    • Production Build
    • Internationalization
    • Configuration
    • Cut and Paste detector
    • Webpack
  • Backend
    • Node Backend
      • Npm scripts
    • Development Enviromnent with docker-compose
    • Testing
      • Code Coverage
    • Configuration
    • Debugging
    • Database
    • Http Server
      • CORS
    • Authentication
      • Social Authentication
      • Local Authentication with JWT
    • Email
    • Redis
    • Api Model
      • Api Mocking
  • Deployment
    • Build, Tag and Push Docker Images
    • Releasing
    • Deploy Infrastructure with GruCloud
    • Deploy with Ansible
Powered by GitBook
On this page
  • Database
  • Install and Start
  • Configuration
  • Migration

Was this helpful?

  1. Backend

Database

PreviousDebuggingNextHttp Server

Last updated 1 year ago

Was this helpful?

Database

This project can use the most popular SQL databases such as PostgreSQL, MySQL, Oracle, MSSQL and Sqlite. This is achieved with , the most popular for Node.js

Install and Start

Start the postgres database and other services:

$ npm run docker:up

Connect to the database:

$ psql "postgres://postgres:password@localhost:6432/dev?sslmode=disable"

Configuration

Here is an example of the configuration for Postgres:

"db":{
    "url": "postgres://postgres:password@localhost:6432/dev?sslmode=disable",
    "options": {
      "logging": true
    }
}

Migration

Database migration are not necessary for development environment but only for system already in production.

Run the following command to migrate the database:

$ npm run db:migrate
Sequelize
ORM