Skip to content

wearefuturegov/whatworks-csc

Repository files navigation

Build Status Coverage Status License

What Works Centre for Childrens' Social Care Website

This is the website for the What Works Centre for Childrens' Social Care (as the title suggests). It's (so far) a pretty simple Rails app, the only difference being that instead of a database, it uses Contentful as its backend.

Development

Prerequisites

  • PostgreSQL
  • Ruby 2.5+

Setup

Clone the repo

git clone https://github.com/wearefuturegov/whatworks-csc.git

Install dependencies

bundle install

Set up environment variables

Copy the .env.example file and create a .env file, replacing the placeholder values for the variables prefixed with CONTENTFUL_ with actual values from the Contentful admin panel. The PREVIEW_TOKEN can be generated by running:

bundle exec rake secret

Run migrations

If you're setting this up with a brand new Contentful environment, you can create the necessary content types by running the migrations:

bundle exec rake contentful:migrate

Create new migrations by running

bundle exec rake contentful:migrations:generate CamelCasedMigrationNameGoesHere

For more information on Contentful migrations, see the Contentful Model documentation

Run server

bundle exec rails s

The server is now running at http://localhost:3000