Coder Social home page Coder Social logo

patrickniyogitare28 / node-ts-super-plate Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 117 KB

A boilerplate for a node web api application. It's designed to work out-of-the-box.

TypeScript 90.56% Shell 0.22% Dockerfile 9.23%
nodejs typescript boilerplate express

node-ts-super-plate's Introduction

Boilerplate

A boilerplate for a node web api application. It's designed to work out-of-the-box.

Tests

Getting started

git clone https://github.com/PatrickNiyogitare28/node-ts-super-plate.git

cd node-boilerplate

npm install

npm start

curl localhost:8080/api/greeter?name=Bill

  • Should return: Hello, Bill!

Building

npm run build

Testing

npm test

Running in Docker

Building a production docker image

$ docker build . -t <docker-username>/app-name
# docker build . -t patrickniyo/stackoverflow-auth-microservice/

Running the production docker image in a container

$ docker run -p <app-port>:<localhost-port> [image-name or image-id]
# docker run -p 5000:5000 patrickniyo/stackoverflow-auth-microservice/

Requirements

Recommended

Windows-specific

Includes

Config files

eslintrc.json

Has all the rules/config for ESLint.

mocharc.jsonc

Config settings for mocha when running it from the command line.

  • ts-node/register - for compilation.

  • module-alias/register - for path alias recognition.

package.json

scripts

  • clean - removes dist folder.

  • build - runs clean and builds app.

  • start - cleans, builds, and starts app.

  • test - runs mocha with settings in mocharc.jsonc.

_moduleAliases

Needed for module-alias package. Should match keys in paths of tsconfig.json as such (note the lack of wildcard in package.json):

package.json

{
  // ...
  "_moduleAliases": {
    "@service": "dist/service"
    // ...
  }
  // ...
}

tsconfig.json

{
  "compilerOptions": {
    // ...
    "paths": {
      "@service/*": ["./src/service"]
      // ...
    }
    // ...
  }
}

tsconfig.json

include key is for including any source files that you want VSCode to recognize.

tsconfig-build.json

Used only for build to exclude the test folder in compilation.

Visual Studio Code

After cloning and prior to opening in Visual Studio Code, go ahead and run the install and build commands to prevent it barking at you.

npm install

npm run build

Once you have the folder open in Visual Studio Code, it will prompt you to download some recommended extensions... Do that...

Recommended Extensions

Code linter for TypeScript and JavaScript

Sidebar test runner for Mocha Tests

node-ts-super-plate's People

Contributors

patrickniyogitare28 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.