Skip to content

SoftwareBrothers/worklog-monitor-api

Repository files navigation

Installation

Setup env variables

  1. Copy example env cp .env.dist .env
  2. Populate with your own values
  3. Copy users-dictionary cp users-dictionary.json.example users-dictionary.json
  4. Populate with data

Use the makefile to run the application locally

When you run it for the first time, it will download and build all needed images

make

Creating a self signed SSL certificate. Use following command and follow the instruction:

Boilerplate ships with built-in certificate, however you can create your own!

make cert

Edit your local hosts file

  1. Open hosts file in your editor. (eg. sudo vim /etc/hosts)
  2. add your DOMAIN variable eg.
    127.0.0.1     app.local www.app.local
    
  3. Save changes

Visit your application in browser https://app.local or http://app.local

Debugging

Run the app in debug mode:

Using docker-compose

docker-compose -f ./docker-compose.yaml -f ./with-debug.yaml up --build -d

Using makefile

make debug

IDE configuration

JetBrains IDE (IntelliJ IDEA, WebStorm, PHPStorm, ...)

  1. In your IDE go to Run -> Edit Configurations...

  2. + (Add New Configuration) -> Attach to Node.js/Chrome

    • Name: name it as you want, like debug
    • Host: localhost
    • Port: 9229
    • Attach to: Chrome or Node.js > 6.3
    • Reconnect automatically
    • OK
  3. Start debugging!

vscode

  1. Install Docker Extension for vscode: https://code.visualstudio.com/docs/azure/docker
  2. Press CMD(Ctrl)+Shift+P(Command Palette) and find “Debug: Open launch.json”:
  3. Then choose Docker: Node.js
  4. Paste this configuration:
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "App: Attach Docker to Node",
            "type": "node",
            "request": "attach",
            "remoteRoot": "/home/node/app",
            "port": 9229,
            "address": "localhost",
            "localRoot": "${workspaceFolder}",
            "protocol": "inspector",
            "restart": true
        }
    ]
}

nestJS

Running the app

# development
yarn start

# watch mode
yarn start:dev

# production mode
yarn start:prod

Test

# unit tests
yarn test

# e2e tests
yarn test:e2e

# test coverage
yarn test:cov

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •