A lightweight and self-hosted weather service.
Rainbbit does the following:
- reads free weather data from OpenWeatherMap;
- saves said data into a local SQLite database;
- plots several useful info;
- displays said plots without the need for JavaScript.
All of this is done in a single binary file that weighs less than 30MB.
- Add a light theme.
- Cache the database requests.
- Cache the plots.
Retrieves weather records stored in the database.
Gets the latest weather record.
Fetches all possible weather conditions.
Provides the zone name, lists plottable measures and available themes.
Generates an SVG plot for any measure.
Generates a custom SVG plot for temperature.
Generates a custom SVG plot for pressure.
Health check endpoint. Performs a SELECT 1 on the database and returns 204 No Content if successful.
First of all, create your own .env file:
cp .env.example .envYou should set your latitude and longitude, as well as a free OpenWeather 2.5 API key.
You can then either start the service locally:
go run .Or use Docker:
docker compose up -d| Name | Default value |
|---|---|
OWM_CRON |
0 0/30 * * * * |
APP_ADDRESS |
:3000 |
DATABASE_URL |
(If set, PostgreSQL is used instead of SQLite) |
If you want to migrate your existing SQLite data to PostgreSQL:
- Set
DATABASE_URLin your.envfile. - (Optional) Set
SQLITE_PATHif your database is not indata/data.sqlite. - Run the migration script:
go run ./cmd/migrateRainbbit is licensed under MIT.
