Skip to content

mateuszc-kainos/motr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MOTR (MOT Reminders)

Root project for the MOT Reminders service.

Integration with GOV Notify

Gov Notify integration details

Building

This repository uses git-secrets to prevent secrets from being committed. Please ensure you have git-secrets installed on your machine: https://github.com/awslabs/git-secrets#installing-git-secrets

To build all sub-projects:

./gradlew clean build

ZIP artefacts will reside in: ${sub-project-root}/build/distributions.

To build individual projects:

./gradlew :<sub_project_name>:clean :<sub_project_name>:build

Testing
Unit testing

Unit tests are part of the artefact building process (see Building paragraph)

Building and running MOTR Locally

Prerequisite

Docker and run scripts

  1. Change directory to docker: cd docker

  2. docker compose up - This will create a docker container and images for DynamoDB and Localstack. Please check you have the latest versions of these as they might be cached from previous versions. This should be left in the background and not terminated.

  3. Open a new terminal and make you are still in the docker directory

  4. Make sure AWS credentials are set up and running e.g. aws_set_creds default && aws_auth_mfa. Use default profile which is identical to dvsamotdev account.

  5. Create DynamoDB tables - ./init_dynamodb_tables.sh - endpoint = http://localhost:7654 or http://host.docker.internal:7654

  6. Create S3 bucket and download assets to Localstack - ./localstack_s3_assets.sh - endpoint = http://localhost:4663

Build

To build the application make sure you are in the root directory and then:

sam build

Run

To run the application locally make sure have a successful build whilst in the root directory and then:

sam local start-api

**Make sure AWS credentials are set up and running e.g. aws_set_creds default && aws_auth_mfa. Use default profile which is identical to dvsamotdev account.

**Make sure you are connected to the VPN.

This will start the application at http:://127.0.0.1:3000. Go to http:://127.0.0.1:3000/start for starting point.

All paths and environments are listed in the template.yaml file.

You can add/edit environment variables and paths as shown below:

 Environment:
        Variables:
          REGION: eu-west-1
Events:
  VrmGet:
    Type: Api
    Properties:
      Path: /vrm
      Method: GET
  VrmPost:
    Type: Api
    Properties:
      Path: /vrm
      Method: POST

Each time you edit the code or template.yaml you will need to build: sam build and run the application: sam local start-api to see the changes.

Logs

Logs for DynamoDB is in this file: docker/log_out

About

MOT Reminders

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 84.2%
  • HTML 9.3%
  • Handlebars 5.9%
  • Other 0.6%