Giter Club home page Giter Club logo

nodejs-webapp-starter's Introduction

Starter project for a web-app using Node, Express, and the GDS templates

This is a minimal project using express and node witht he GDS toolkit templates.

Get Started

Clone this repo

Install the dependencies required to run the service and start the server in:

$ npm install
$ npm start

Visit localhost:3000

Alternatively, for development you can run "gulp" to start the server with nodemon and watch for asset changes.

Project Structure

  • app - contains client views and routes
  • assets - contains static assets and raw JS and SCSS
  • gulp - contains gulp build tasks
  • public - is generated by the build to contain assets and processed JS and CSS. Contents of public are exposed by express
  • govuk_modules - generated by the build containing GDS template assets

Developer Guide

Gulp

The build uses gulp. Add your own gulp tasks in /gulp or below.

The following are provided:

  • tasks.js - default and build tasks that compose other tasks
  • copy-assets - moves assests to /public
  • copy-modules - moves the GDS layouts, assets, and SASS from the dependency into govuk_modules
  • nodemon - starts the server
  • sass - processes SASS into public/stylesheets
  • watch - watches for changes to sass and assets and regenerates
  • clean - removes all generated content from /public, /govuk_modules etc

NB This is a minimal starter so there is no JS processing or testing. Add your own.

Node Server

server.js is kept simple and does the following

  • Use nunjucks as the template engine
  • Exposes static resources /public, /govuk_modules
  • Sets routing to use app/routes.js

How to use the templates

Prototype Kit Documentation

Using this project as the basis of your own project

  1. Delete the commit history: rm -rf .git

  2. Reconstruct the Git repo with only the current content:

git init
git add .
git commit -m "Initial commit"
  1. Set your new remote origin:
git remote add origin <github-uri>
git push -u --force origin master

nodejs-webapp-starter's People

Contributors

atodd-noms avatar todderz avatar

Stargazers

 avatar

Watchers

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