This repository is the backend solution for benweare.co.uk.
It uses the Express.js framework to create an easy to launch service.
I use a personalised version of Swagger-UI to document the API, this is called Swagger-UI-SLIM. This was also created by me so I could have a lightweight solution with minimal/no configuration required.
This site is hosted on Heroku under these applications:
The frontend solution is a React based app.
It uses React-Router to incorporate a multi-page application.
This site constantly polls the API with a socket connection to check for updated news and weather data.
Documentation on the benweare.co.uk API can be found in:
The server fetches data at different intervals:
- News Endpoints refresh every 8 minutes.
- Weather Endpoints refresh every 15 minutes.
This is not intended for usage outside of my personal website, though can be adapted to suit other webscrape/server uses.
This frontend-UI to this repository is installed via NPM called benweare.co.uk-client. In the case that someone else wishes to use this repo, they can substitute this module for their personal frontend package or use their own static files.
There are required environment variables.
- DISCORD_CLIENT_ID
- DISCORD_TOKEN
These are required to login the bot into Discord.
- METOFFICE_API_TOKEN
- LATITUDE
- LONGITUDE
These are used to collect weather data from the Met Office API.
- NASA_API_KEY
This is used to collect the NASA Daily Image.