Skip to content

noms-digital-studio/nodejs-webapp-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published