A progressive Node.js framework for building efficient and scalable server-side applications.
Nest Framework TypeScript.
$ npm install
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.
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;
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
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
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
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
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 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
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
Two ways to deploy application
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
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.
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.
- Website - https://nestjs.com
Nest is MIT licensed.