Money Advice Service's legacy tools
The Money Advice Service’s legacy tools application.
gem install bundler
Clone the repository:
$ git clone --recursive https://github.com/moneyadviceservice/frontend.git
Install MariaDB/MySQL
$ brew install mariadb
Make sure MySQL is running.
$ brew services restart mariadb
Install Bower
npm install -g bower
Add Rails LTS credentials (get the username and password from Ben L)
bundle config gems.railslts.com USERNAME:PASSWORD
Make sure all dependencies are available to the application:
$ bundle install
$ bowndler install
Make sure to copy the .env-example file:
cp .env-example .env
Setup the database:
bundle exec rake db:create db:schema:load
To start the application:
$ foreman s
The site makes a lot of requests to the CMS application. If
you are not developing anything that integrates with CMS, you can
enable the application cache in development mode by running:
DEV_CACHE=true rails s -p 5000
Or alternatively you can add DEV_CACHE=true
to your .env file.
In development, frontend will use the local CMS for convenience. See CMS repository README for instructions on setting up a local CMS instance.
You can change the MAS_CMS_URL on .env file. Use https://staging-mas-cms.moneyhelper.org.uk for testing, or http://localhost:PORT to point to a local running CMS.
Don’t forget to restart the server after the modification.
Assuming you have run bowndler install
, you may have issues with previous bower
installations.
rm -rf vendor/assets/bower_components
rm bower.json
bowndler install
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)We like to develop features from the outside in. We write our user stories in a
declarative style. When contributing a feature:
The application is backed by a RESTful JSON API. This is described for humans
as a blueprint file using the
API Blueprint Language Specification. Changes you make to the
blueprint file will be automatically reflected in the online
API documentation and mock API.
### Writing front-end code
There are a number of documents to help everyone write maintainble, performant and readible HTML, CSS and Javascript.
We recommend having a flick through these when working on new features:
The application uses Bower to manage front-end packages. Dependencies should
be defined in the bower.json configuration file. Once installed they will be
automatically available to the asset pipeline.
There are minor differences to the header and footer in the empty template, to enable
the HTML to run in a static fashion. For example, we remove the authentication links
in the header as they require knowledge about the user’s sessions – which
can’t easily be shared across multiple sites, domains, etc.
This is done via a hide_elements_irrelevant_for_third_parties?
flag in the views.
Projects such as RAD keep this stored in their repo, and have a simple CSS file
that overrides or adds the bits they want.
We use Draper for decorators. Decorators help us to keep logic out of our
views, avoid procedural helpers and ensure our models are free of any
presentational concerns.
Run the following in the command line.
RAILS_ENV=development bundle exec rake karma:install karma:run_once
You’ll need a heroku account with permissions to the staging-partner-tools
and partner-tools
apps.
https://git.heroku.com/staging-partner-tools.git
git push staging your-branch:main
heroku pipelines:promote --app partner-tools
will promote the build to production