/fin_cap

All the things for the Financial Capability site

Primary LanguageHTML

FinCap - Financial Capability

All the things for Money Advice Service's Financial Capability website.

Prerequisites

Installation

Clone the repository:

$ git clone https://github.com/moneyadviceservice/fin_cap.git

Make sure all dependencies are available to the application:

$ bundle install
$ bowndler install

Set up the database

$ bundle exec rake db:create \
  && bundle exec rake db:schema:load \
  && bundle exec rake db:migrate \
  && bundle exec rake db:seed

Make sure to copy the .env-example file: cp .env-example .env

Usage

This is a standalone application and requires data from the MAS CMS. Follow the instructions below to get started.

  1. Start the CMS Navigate to your local CMS directory and start the application, e.g.
$ APP_NAME='FINCAP' rails s
  1. Start the application on a port which is different to the port you started the CMS on, e.g.
$ rails s -p 5000

Ensure that the FinCap application and the CMS application run on different servers. By running rails s the FinCap application will be available on the default port of 3000. You can set the port for your local CMS in your .env file. Eg PORT=5000

To access the application locally in your browser, navigate to the port on which you started the application, e.g. http://localhost:5000/.

Technical docs

To Do

Update link for the styleguide when the site is deployed.

Styleguide

Docker testing

You can run the tests locally within a docker container. This will setup all of the required dependencies within the container and replicates how the tests are executed in Jenkins. Please run the following command:

docker-compose down && docker-compose build && docker-compose -f docker-compose.yml run --rm rails ./script/test

Hooks

This project uses git hooks to ensure every commit follows best practices. The test script runs the code lints and the tests.

In order to use the hooks just run this commands:

  cp hooks/pre-push .git/hooks/pre-push
  chmod u+x .git/hooks/pre-push

Note: It is not recommended but if you want to ignore the hook, you can run:

git push --no-verify origin <your_branch>