Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Grey College JCR Website Build Status

This is the code running the Grey JCR website. Making the website open source will hopefully provide an oportunity for Grey JCR members to get involved in the website. Feel free to install this on your local machine and play around with it.

Getting Started

This application follows 12 factor principles. Instructions on how to install, run and develop this application are detailed below.

1. Clone this project

Either use the command git clone from your command line or use the download link and extract the zip file.

2. Install project dependencies

There are three core dependencies required to install this project:

  • Node.js - Use Node Version Manager (nvm) to manage the version of node installed on your machine. Once nvm is installed simply go in to the root directory of this project and type nvm use to switch to the required version of node.js.
  • PostgreSQL 9.6 - Download from here. This is used to store most of the state of the application (users, debts, events etc.). Install postgres on your local machine and create an empty database called "grey".
  • Redis 3 - This is required to store user sessions. Simply install locally and make a note of the port it's running on (usually 6379).

After these navigate to the directory you've copied that application in to in your command line and run npm install. This will read from the "package.json" file and install all of the node dependencies.

3. Create Environment File

Some environment variables are used by the app and are listed in a file called ".env" in the main directory of the site. You will need to create this file and define the following variables:

# This is used for storing user sessions can be any string

# Details for using the paypal API only required for developing the debts service

# Your Durham details, these are used to set you in your local installation
CIS_NAME=Ben Willis

# These are used by the website to send booking confirmation emails etc

# Connection details for your local Postgres database

# Connection details for redis

# Somewhere on your machine to store static files

Inside your files directory you will need the following folders: avatars, events, uploaded, manifestos.

4. Build the application

This project is migrating to typescript so we need to transpile to regular javascript. To do this run npm run build. You'll need to rerun this after any changes you make. You can also run npm run build-api or npm run build-ui to build just the backend or frontend individually.

5. Set up the Postgres database

To set up the database you need to create the tables and add your user (defined in .env) as the website editor. To do this run the following:

  1. npm run migrate - this will create the required tables in the database
  2. npm run seed - this will add the user defined in the .env file as well as some other fixtures

Note the migrate step is required on installation and whenever there are any changes to the database. It is often useful to delete and recreate the "grey" database and run the migrations again to get a clean state.

6. Running the app

Simply run npm run start to start the app. Then visit "localhost:3000" in your browser to view the site. To stop the app simple press ctrl+c in you terminal.


The testing strategy is work in progress but in general we use two types of tests:

Unit Tests

To test the back end we use unit tests to test individual parts of the application (e.g. an endpoint or a single service function). These are either in the "test" directory or end with ".spec.ts". To run these use npm run test after building the application.

Visual Tests

There are no automated tests so we rely on manually checking. To do this with the new UI components run npm run storybook which will show "stories" for different components. These are described in the source code in files that end ".stories.tsx".


If you want to get involved in the website feel free to email me at or the current website editor if you have any questions!


The MIT License (MIT)

You can’t perform that action at this time.