Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/defra/flood-service
Check flood risk - alpha - flood-service
https://github.com/defra/flood-service
Last synced: 6 days ago
JSON representation
Check flood risk - alpha - flood-service
- Host: GitHub
- URL: https://github.com/defra/flood-service
- Owner: DEFRA
- License: other
- Created: 2018-11-07T10:29:38.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-25T07:54:27.000Z (25 days ago)
- Last Synced: 2024-10-26T02:37:10.794Z (24 days ago)
- Language: JavaScript
- Homepage: https://flood-alpha.aws.defra.cloud/
- Size: 1.16 MB
- Stars: 5
- Watchers: 12
- Forks: 2
- Open Issues: 16
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
![Build status](https://github.com/DEFRA/flood-service/actions/workflows/ci.yml/badge.svg)[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_flood-service&metric=alert_status)](https://sonarcloud.io/dashboard?id=DEFRA_flood-service)[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_flood-service&metric=coverage)](https://sonarcloud.io/dashboard?id=DEFRA_flood-service)
# flood-service
This is the service tier node application supporting the Check for flooding service https://github.com/DEFRA/flood-app
## Environment variables
Create a .env file at the root of the project to set your environment variables locally, which is especially useful during development. The [dotenv](https://www.npmjs.com/package/dotenv) package facilitates this by automatically loading these variables at application start. This approach is recommended as a simpler alternative to global settings, like those in .bashrc.
For DEFRA employees, these environment variables are available in our private lfwconfig repository.
| name | description | required | default | valid | notes |
|-----------------------------------|------------------------|:--------:|-------------|-------------------------------------|-------|
| NODE_ENV | Node environment | no | production | development, dev, test, tst, production | |
| PORT | Port number | no | 3000 | | |
| FLOOD_SERVICE_CONNECTION_STRING | PG Connection String | yes | | | |
| FLOOD_SERVICE_S3_ACCESS_KEY | S3 Access Key | yes | | | |
| FLOOD_SERVICE_S3_SECRET_ACCESS_KEY| S3 Secret Key | yes | | | |
| FLOOD_SERVICE_S3_BUCKET | S3 Bucket | yes | | | |
| FLOOD_SERVICE_S3_TIMEOUT | S3 Http Timeout | no | 10000 (10s) | | |
| ERRBIT_PROJECT_KEY | Errbit Project Key | no | | | |
| ERRBIT_ENABLED | Errbit Enabled | no | | | |## Prerequisites
Local or remote Postgres/Postgis database installed from: https://github.com/DEFRA/flood-db, connection string `FLOOD_SERVICE_CONNECTION_STRING`
AWS serverless lfw-data tier processing telemetry, forecast, 5DF, fwis data and storing in the database: https://github.com/DEFRA/lfw-data
S3 Bucket storing some of the processed data files, referred to as `FLOOD_SERVICE_S3_BUCKET` in the env vars
Node v8+
## Testing the application
```
$ npm i
$ npm run test
```## Running the application
```
$ npm i
$ npm run start:local
```