Giter Club home page Giter Club logo

beis-mspsds's Introduction

Office for Product Safety & Standards Services

Build Status Coverage Status Dependabot Status

Getting Setup

This project includes git submodules, so when running git clone you need to add the --recurse-submodules option. If you have already pulled, you can run git submodule init and then git submodule update --recursive instead. You might also need to run git submodule update --recursive if the submodule is updated because of a pull.

Install Docker: https://docs.docker.com/install/.

Increase the memory available to Docker to at least 4GB (instructions for Mac, Windows).

Copy the file in the root of the directory called .env-template. Rename the copy of the file to .env and fill in any environment variables. This .env file will be git ignored, so it is safe to add sensitive data. See the accounts section below for information on how to obtain some of the optional variables.

Add the following entry for Keycloak to your hosts file (instructions):

127.0.0.1   keycloak

Build and start-up the full project:

docker-compose up

Alternatively, you can run the specific component you're interested in using e.g. docker-compose up psd-web or docker-compose up cosmetics-web.

You'll then most likely want to run the Cosmetics setup steps or PSD setup steps.

When pulling new changes from master, it is sometimes necessary to run the following if there are changes to the Docker config:

docker-compose down && docker-compose build && docker-compose up

Design system

Projects in this repository use the GOV.UK design system. To aid it, the shared-web gem provides an implementation of some of the components - see the README for more details.

Mac tips

Docker shared volume performance is poor on Mac which can significantly affect e.g. asset compilation. You can use docker-sync to speed up runtime:

gem install docker-sync
docker-sync-stack start

Windows Subsystem for Linux

You will have to install the docker server on Windows, and the docker client on WSL.

To make this work, make the current path look like a Windows path to appease Docker for Windows:

sudo ln -s /mnt/c /c
cd /c/path/to/project

(from https://medium.com/software-development-stories/developing-a-dockerized-web-app-on-windows-subsystem-for-linux-wsl-61efec965080) If the web container complains it can find files in the /app folder (e.g. bin/bundle), that might be sign you're in the wrong directory.

You may also want to setup docker-sync using these instructions.

Accounts

Keycloak

The local developer instance of Keycloak is configured with the following default user accounts:

Log in to the Keycloak admin console to add or edit users.

Ask someone on the team to create an account for you on the Int and Staging environments.

GOV.UK Notify

If you want to send emails from your development instance, or update any API keys for the deployed instances, you'll need an account for GOV.UK Notify

  • ask someone on the team to invite you.

GOV.UK Platform as a Service

If you want to update any of the deployed instances, you'll need an account for GOV.UK PaaS - ask someone on the team to invite you.

Amazon Web Services

We're using AWS to supplement the functionality of GOV.UK PaaS. If you want to update any of the deployed instances, you'll need an account - ask someone on the team to invite you. If you get an error saying you don't have permission to set something, make sure you have MFA set up.

Deployment

Anything which is merged to master (via a Pull Request or push) will trigger the Travis CI build and cause deployments of the various components to the int space on GOV.UK PaaS.

Deployment to research environment does not currently happen automatically, for details see section "Research" in prototypes

Anything merged into the branch staging (only via a Pull Request) will cause Travis CI to instead build to the staging space. Please only do this if you are confident that this is a stable commit.

Anything merged into the branch prod (only via a Pull Request) will cause Travis CI to instead build to the prod space. Please only do this if you are confident that this is a stable commit.

Deployment from scratch

Once you have a GOV.UK PaaS account as mentioned above, you should install the Cloud Foundry CLI (cf) from https://github.com/cloudfoundry/cli#downloads and then run the following commands:

cf login -a api.london.cloud.service.gov.uk -u XXX -p XXX
cf target -o beis-mspsds

This will log you in and set the correct target organisation. The login command without -u -p options will not work in some terminals, in particular git-bash. Passing username and password in one line will.

If you need to create a new environment, you can run cf create-space SPACE-NAME, otherwise, select the correct space using cf target -o beis-mspsds -s SPACE-NAME.

Antivirus API

See antivirus/README.md.

Maintenance page

See maintenance/README.md.

Keycloak

See keycloak/README.md.

Cosmetics

See cosmetics-web/README.md.

Product safety database

See psd-web/README.md.

Other infrastructure

See infrastructure/README.md.

BrowserStack

BrowserStack

We use BrowserStack to test our service from a variety of different browsers and systems.

Licence

Unless stated otherwise, the codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation.

The documentation is © Crown copyright and available under the terms of the Open Government 3.0 licence.

beis-mspsds's People

Contributors

kicferk1 avatar tom-bell-softwire avatar broder avatar anthonypengelly avatar raamsoftwire avatar dwrendell avatar dependabot-support avatar samlionheart avatar aidayounesi avatar jasiekmiko avatar matthewburstein avatar tiagosusanopinto avatar lukaszdygon avatar greysteil avatar

Watchers

James Cloos avatar Ralph avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.