Giter Club home page Giter Club logo

notifications-template-preview's Introduction

notifications-template-preview

Generates PNG and PDF previews of letter templates created in the GOV.UK Notify admin app.

Setting Up

Docker container

This app uses dependencies that are difficult to install locally. In order to make local development easy, we run app commands through a Docker container. Run the following to set this up:

  make bootstrap-with-docker

Because the container caches things like Python packages, you will need to run this again if you change things like "requirements.txt".

AWS credentials

To run the app you will need appropriate AWS credentials. See the Wiki for more details.

environment.sh

In the root directory of the application, run:

echo "
export NOTIFICATION_QUEUE_PREFIX='YOUR_OWN_PREFIX'
"> environment.sh

Things to change:

  • Replace YOUR_OWN_PREFIX with local_dev_<first name>.

Pre-commit

We use pre-commit to ensure that committed code meets basic standards for formatting, and will make basic fixes for you to save time and aggravation.

Install pre-commit system-wide with, eg brew install pre-commit. Then, install the hooks in this repository with pre-commit install --install-hooks.

To test the application

make test-with-docker

If you need to run a specific command, such as a single test, you can use the run_with_docker.sh script. This is what test and other make rules use.

./scripts/run_with_docker.sh pytest tests/some_specific_test.py

To run the application

# run the web app
make run-flask-with-docker

Then visit your app at http://localhost:6013/.

# run the background tasks
make run-celery-with-docker

Celery is used for sanitising PDF letters asynchronously. It requires the NOTIFICATION_QUEUE_PREFIX environment variable to be set to the same value used in notifications-api.

Further documentation

notifications-template-preview's People

Contributors

allait avatar benthorner avatar blesseddev avatar c4seyla avatar corlettb avatar crystalpea avatar dependabot[bot] avatar idavidmcdonald avatar imdadahad avatar kentsanggds avatar klssmith avatar leohemsted avatar pyup-bot avatar quis avatar richardc0 avatar risicle avatar rjbaker avatar robbrazil avatar sakisv avatar samuelhwilliams avatar servingupaces avatar tombye avatar venusbb avatar whpearson avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.