diff --git a/README.md b/README.md index 2d4968d..a7d8063 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,15 @@ -# Weather Station +# Ecowitt Weather Station Client -## Project Setup +![](/screenshot.png) + +A custom front-end and middleware for displaying data from my Ecowitt weather station. + +## Details + +The front-end is built using Vue and relies on Tailwind, DaisyUI and GraphJS for the UI. +The middleware is a Cloudflare Worker and is needed to hide to the users the token key. + +### Frontend Project Setup ```sh # Install dependencies @@ -11,4 +20,23 @@ npm run dev # Compile and Minify for Production npm run build + ``` + +### Middleware + +To start developing your Worker, run `npx wrangler dev` +To publish your Worker to the Internet, run `npx wrangler publish` + +Environment variables should be put for local dev in a `.dev.vars` file using _dotenv_ format, and then pushed using `npx wrangler secret`. + + +### API endpoints + +- Istant weather data: `https://weather-station-api.jacksalici.workers.dev` + +- Daily weather data (5 minute span from the last 24h): + ```js + const api_url = `https://weather-station-api.jacksalici.workers.dev/?mode=history&start_date=${encodeURIComponent(moment().subtract(24, 'hours').format('YYYY-MM-DD HH:mm:ss'))}&end_date=${encodeURIComponent(moment().format('YYYY-MM-DD HH:mm:ss'))}; + ``` + diff --git a/middleware/readme.md b/middleware/readme.md deleted file mode 100644 index 65ac1e5..0000000 --- a/middleware/readme.md +++ /dev/null @@ -1,13 +0,0 @@ -# Middleware - -> Basically, it's the stuff that is between the front-end and the Ecowitt database and hides to the users the token key. - -To start developing your Worker, run `npx wrangler dev` -To publish your Worker to the Internet, run `npx wrangler publish` - -Environment variables should be put for local dev in a `.dev.vars` file using _dotenv_ format, and then pushed using `npx wrangler secret`. - -```js -//url -const api_url = `https://weather-station-api.jacksalici.workers.dev/?mode=history&start_date=${encodeURIComponent(moment().subtract(24, 'hours').format('YYYY-MM-DD HH:mm:ss'))}&end_date=${encodeURIComponent(moment().format('YYYY-MM-DD HH:mm:ss'))}` ; -``` diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..27bda3e Binary files /dev/null and b/screenshot.png differ