Description

Nest framework TypeScript starter repository.

Installation

npm install

Prerequisites

  • Node >= 12
  • Docker >= 18
  • Angular CLI installed globally npm install -g @angular/cli
  • Start a Postgres server on localhost port 5432. The server should grant full access to a database called buddybudget with login credentials buddybudget:buddybudget. (Could be achieved by running docker-compose up buddybudget-sql.)

Running the App

docker-compose up buddybudget-sql
npm run build
npm run start:prod

Both the frontend and backend is served by the node backend on port 3000.

Setting up Development Environment

The best development experience is achieved, like so

  1. Ensure database is running

    docker-compose up buddybudget-sql   
  2. The backend can then be started, like so:

    npm run start

    To restart the backend automatically on file changes and enable debugging use this command instead:

    npm run start:debug
  3. Start the frontend

    ng serve

The frontend and backend will now be available on port 4200 and 3000, respectively. And both will be reloaded automatically on changes.

Inserting data

curl -F upload=@data/trans.xlsx "http://localhost:3000/api/transactions/batch/xlxs?format=skandia"
curl -F upload=@data/statement.xlsx "http://localhost:3000/api/transactions/batch/xlxs?format=norwegian"

Test

Test coverage has not yet been implemented, coming soon.

# unit tests
npm run test

# e2e tests
npm run test:e2e

# test coverage
npm run test:cov

Boilerplate

These are the initial commands used to create this project.

  1. nest new buddybudget
  2. cd buddybudget
  3. nest new ng-app client ## Select don't initialize
  4. ng new client
  5. npm i --save @nestjs/typeorm typeorm
  6. npm install pg --save
  7. ng add @angular/material