Giter Site home page Giter Site logo

spacewatch's Introduction

Go Go Report Card GitHub GitHub go.mod Go version

spacewatch

The International Space Station is a modular space station in low Earth orbit. It is a multinational collaborative project involving five participating space agencies: NASA, Roscosmos, JAXA, ESA, and CSA. The ownership and use of the space station is established by intergovernmental treaties and agreements.

The Spacewatch service is a REST API that provides functionality for tracking the International Space Station. The service's primary function is to provide information if the ISS is visible in the sky at the given moment. We assume the ISS is visible if both conditions are satisfied: the sky cloud coverage is less than 30%, and it is nighttime.

Note: The service is under development, and it is not intended for production use.

development

To use the service at the moment, you need to register at Weatherbit.io to get an API KEY. Once you get the key, you need to export it as an Env Var SPACEWATCH_WEATHER_API_KEY

Make targets useful for development and testing:

$ make
vet                  Run go vet and shadow
check                Run static check analyzer
cover                Run unit tests and generate test coverage report
test                 Run unit tests locally
tidy                 Run go mod tidy and vendor
run                  Run service locally

Run service locally:

$ make run
go run cmd/spacewatch-api/main.go
SPACEWATCH : 2021/12/07 16:56:28.966230 main.go:62: main : Started
SPACEWATCH : 2021/12/07 16:56:28.966388 main.go:69: main : Config :
--web-address=localhost:9000
--web-read-timeout=5s
--web-write-timeout=5s
--web-shutdown-timeout=5s
--web-cache-ttl=10s

SPACEWATCH : 2021/12/07 16:56:29.024535 main.go:96: main : Spacewatch API listening on localhost:9000

Test the service:

$ curl localhost:9000
{"lat":-43.93,"long":-36.43,"timezone":"Atlantic/South_Georgia","cloud_coverage":100,"day_part":"night","is_visible":false}
$ curl localhost:9000
{"lat":-21.71,"long":-7.31,"timezone":"Atlantic/St_Helena","cloud_coverage":9,"day_part":"day","is_visible":true}

Received payload:

{"lat":-21.71,"long":-7.31,"timezone":"Atlantic/St_Helena","cloud_coverage":9,"day_part":"day","is_visible":true}
  • lat/long - ISS coordinates at the time of the request
  • timezone - where is ISS
  • clud_coverage in %
  • day_part - is it day or night in the timezone
  • is_visible - indicates if the ISS can be seen on the sky (cloud coverage <= 30% and night)

roadmap

  • implement server-side caching (minimize load on third party services)
  • replace weather provider (currently there are limitations with no of requests)
  • add Caddy server as a proxy in front of the service (TLS, request rate limiting)
  • add a healthcheck endpoint
  • add request tracing and metrics (Prometheus)
  • use context for requests cancellations
  • implement middleware (and move logging functionality)
  • configure autodeployment (GitHub Actions)
  • register the service in the RapidAPI for public use

tbd

  • add gRPC interface

spacewatch's People

Contributors

dependabot[bot] avatar qba73 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

spacewatch's Issues

Use Caddy as a proxy

Add Caddy server as a proxy in front of the service (TLS, request rate limiting)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.