GithubHelp home page GithubHelp logo

nestjs-blue-sky-app's Introduction

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

Description

Nest Framework TypeScript.

Installation

$ npm install

Environment variable configuration

Create .env file at root folder, please refer .env.sample at the same location. It is requried by docker-compose.yml file while spining postgis and pgadmin.

Also create .env.development, .env.staging and .env.production at location './src/shared/config/env/', please refer .env.sample at the same location. It is requried by docker-compose.yml file.

Please refer docker-compose.yml file for details.

Before running the app create database

Database name as mentioned in environment file.

-- Database: db_changeit

-- DROP DATABASE IF EXISTS db_changeit;

CREATE DATABASE db_changeit
    WITH
    OWNER = postgres
    ENCODING = 'UTF8'
    LC_COLLATE = 'English_United States.1252'
    LC_CTYPE = 'English_United States.1252'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1
    IS_TEMPLATE = False;

Running the app

If one have postgis i.e database setup already configured

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Running the app using docker

Docker is an open platform for developing, shipping, and running applications.

The applcation is also spining up local postgis server with docker-compose along with pgadmin.

# development
$ docker-compose up development -d

# staging
$ docker-compose up staging -d

# production mode
$ docker-compose up production -d

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Swagger UI

Swagger UI allows anyone — be it your development team or your end consumers — to visualize and interact with the API’s resources.

http://localhost:3000/docs

Look for blue sky section in swagger UI for API

Project Documentation

Compodoc is a documentation tool for Angular applications. Since Nest and Angular share similar project and code structures, Compodoc works with Nest applications as well.

Generation

$ npx @compodoc/compodoc -p tsconfig.json -s

See the official documentation for more options.

Open your browser and navigate to http://localhost:8080

Typeorm Migrations

Typeorm Migrations Please refer to understand migrations

If any changes in database i.e entities, please execute typeorm migration:generate it will generate migration scripts.

# generate scripts
$ npm run typeorm:migration:generate

# run scripts
$ npm run typeorm:migration:run

Import GeoJSON to PostGIS:

Ogr2ogr is the swiss-army knife when it comes to conversion of GIS data. It is part of the Geospatial Data Abstraction Library and provides an easy way to convert data between common storage formats: GeoJSON, Shapefile, PostGIS and others.

For install and how to import GeoJSON to PostGIS, Please refer the links

GDAL Please refer to understand installion

Import GeoJSON to PostGIS Please refer to import

# Import GeoJSON to PostGIS (Command Line)
$ C:\OSGeo4W\bin>ogr2ogr -f "PostgreSQL" PG:"dbname=your-database-name user=your-username password=mypassword" /path/to/jour/GeoJSon/file -nln table-name -append

Hosting Application

Two ways to deploy application

  1. phusionpassenger

Passenger® is an app server that runs and automanages your web apps with ease. Also improves security, reliability and scalability.

Deploying a Node.js app on a Linux/Unix production server

  1. Kubernetes

Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications.

Deploy a Container Web App on Amazon EKS One can use Kubernetes (k8s) from any cloud provider.

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

License

Nest is MIT licensed.

nestjs-blue-sky-app's People

Contributors

kadamsan avatar

Watchers

 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.