-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c3fa81
commit 0551add
Showing
2 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,57 @@ | ||
# electricity-prices-go | ||
# Electricity Prices API | ||
|
||
An API for information about electricity prices in Spain. Data is scraped from [REData Api](https://www.ree. | ||
es/en/apidatos) and exposed via a [restful API](https://elec-api.daithiapp.com/). | ||
|
||
This API supports a [dashboard application](https://elec.daithiapp.com/), an Alexa Skill and Flash briefing. | ||
|
||
In addition to the API there is a sync job that can be run separately to sync data from REData. | ||
|
||
This repo is a replacement for the [original implementation](https://github.com/daithihearn/electricity-prices) written in Kotlin. | ||
|
||
## Stack | ||
|
||
- Go | ||
- MongoDB | ||
|
||
## API | ||
To run locally you will need to have a MongoDB instance running. Update the `MONGO_URL` environment variable to point to your instance. | ||
You will also require `make` to be installed. | ||
|
||
Then to run locally simply run: | ||
|
||
```bash | ||
make run | ||
``` | ||
|
||
To build the executable binaries locally run: | ||
|
||
```bash | ||
make build | ||
``` | ||
The binaries will be installed in the build folder and can be run directly. | ||
|
||
If you want to build the docker image run: | ||
|
||
```bash | ||
make image | ||
``` | ||
|
||
## Sync Job | ||
To run the sync locally run: | ||
|
||
```bash | ||
make sync | ||
``` | ||
|
||
The `make build` command described in the API section will build both binaries. | ||
|
||
The `make image` command described in the API section will build a single docker image for both the API and sync job. | ||
|
||
To run the docker image for the sync job run like so: | ||
|
||
```bash | ||
docker run -d --rm elec-prices-sync ./sync | ||
``` | ||
|
||
Running without the `./sync` will run the API. |