https://github.com/mungujn/weather-server
A weather app backend built using go, gRPC, Redis and docker
https://github.com/mungujn/weather-server
docker docker-compose go grpc grpc-go redis tls
Last synced: about 1 year ago
JSON representation
A weather app backend built using go, gRPC, Redis and docker
- Host: GitHub
- URL: https://github.com/mungujn/weather-server
- Owner: mungujn
- License: mit
- Created: 2018-12-02T12:56:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-12T06:13:44.000Z (about 4 years ago)
- Last Synced: 2024-10-23T20:11:19.475Z (over 1 year ago)
- Topics: docker, docker-compose, go, grpc, grpc-go, redis, tls
- Language: Go
- Homepage:
- Size: 81.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Weather app backend
[](https://travis-ci.com/mungujn/weather-server)
[](https://goreportcard.com/report/github.com/mungujn/weather-server)
Backend for a weather app. App consists of 3 services; an api, a database service and the core weather service.
## API Service
This service exposes an API endpoint that client apps access to retrieve information on the weather in a given location, at a particular time.
## Weather service
This service retrieves weather information from a provider. The server for this service is an RPC server, built using gRPC. It exposes one RPC service, 'GetWeather' for retrieving the weather. The GetWeather operation first uses an RPC client (that connects to the database RPC service) to read weather data cached in the database.
If the weather request is for a location not in the database, or if the weather data retrieved from the database is too old, the service fetches fresh data from a weather provider (still not yet determined), immediately returns this data to the API service and then uses a separate thread (goroutine) to cache the newly retrieved weather data by making a create RPC call to the database service
## Redis Database service
A slightly customised redis server. Based on the alpine redis image with a modified configuration file.
Communication between services is encrypted and secured with SSL/TLS.
Run
`docker-compose up`
to bring up all the services
Supply two SSL key file pairs; "wapi.crt", "wapi.key" and "weather.crt", "weather.key" in a docker volume (or bind mount like in my docker-compose.yml file)