Giter VIP home page Giter VIP logo

express-typescript-boilerplate's Introduction

express-typeScript-boilerplate

Bored of writing boilerplate code to setup your express app with TypeScript? Me too! This template provides you everything you need to start developing your app.

Additionally the template includes WebStorm configuration and gulp build tasks

Quickstart

  • Download the template
  • Make sure gulp is installed as global npm dependency. If not, execute npm install gulp -g to install it
  • Execute npm install, this will download all dependencies and compile TypeScript to JavaScript so that the app can be started.
  • Run gulp serve and open the url localhost:3000 to see your app running

WebStorm Integration

The template is supposed to be used in conjunction with WebStorm. Automatic compilation of TypeScript into JavaScript and highlighting of TsLint errors is already configured.

It includes two WebStorm run configurations

  1. Server - without watch: Starts the app directly from the release folder
  2. Server - with watch: Starts the gulp task gulp serve to serve the app from the release folder and automatically restart the app after a file has been changed

Directory Structure

  • config - directory to store configuration files. Npm module nconf is used to allow overwriting default values with commandline and environment arguments
  • release - directory contains compiled TypeScript files and everything else that is necessary to run the app. The content of this directory should be deployed to the server later on. Directory is ignored in .gitignore.
  • typings - *.d.ts files required to get TypeScript support of several node modules. New files can be added using tsd commandline utility. I recommend adding those files to source control.
  • app.ts - Start file of the express app
  • gulpfile.js - gulp file containing all tasks necessary to start the app
  • package.json - normal package.json file
  • README.md - readme file
  • tsconfig.json - configuration for TypeScript compiler
  • tsd.json - configuration file for tsd commandline utility
  • tslint.json - TsLint config, used for highlighting in WebStorm as well as checking in gulp task ts:lint

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.