Skip to content

incendiarybean/benweare-ts-server

Repository files navigation

Benweare-TS-Server

Description

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:

Frontend Application

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.

API Documentation

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.

Usage

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.

Requirements

There are required environment variables.

Discord Bot Requirements:

  1. DISCORD_CLIENT_ID
  2. DISCORD_TOKEN

These are required to login the bot into Discord.

Weather Requirements:

  1. METOFFICE_API_TOKEN
  2. LATITUDE
  3. LONGITUDE

These are used to collect weather data from the Met Office API.

NASA API Requirements:

  1. NASA_API_KEY

This is used to collect the NASA Daily Image.

About

This is the backend of benweare.co.uk.

Resources

Stars

Watchers

Forks