https://github.com/defra/flood-service
Check flood risk - alpha - flood-service
https://github.com/defra/flood-service
Last synced: 10 months 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 (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-06-25T14:43:58.000Z (11 months ago)
- Last Synced: 2025-06-25T15:19:22.611Z (11 months ago)
- Language: JavaScript
- Homepage: https://flood-alpha.aws.defra.cloud/
- Size: 1.1 MB
- Stars: 5
- Watchers: 11
- Forks: 2
- Open Issues: 15
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://sonarcloud.io/dashboard?id=DEFRA_flood-service)[](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
```