This project gets the current location from the international space station api, and stores it in a database for later use.
The whole purpose is to store the current location, together with the timezone, to be able to check on a specific date at a specific hour, how many minutes were spent by the ISS on a specific Timezone.
- Application Structure
- Application Dataflow
- Running app locally
- Application testing
- Application usage
- Author message
This application is structured by:
- Cron Service (Go) A service which purpose is to run cronjobs
- Api Service (Go) A web server to be consumed by client application
- Mail Service (Go) A service that takes care of sending emails
- Api Gateway (Go) An entry point to the services
- Client (Vue) An application the end user can interact with
- RabbitMQ Message broker
- PostgreSQL Database Database to store ISS location
For local development all the applications run in docker containers and it is orchestrated via docker-compose
- The Cron Service pulls the ISS's location every minute from the iss api and it is converted to a schema needed for our research.
- Once the data is converted, the Cron Service stores the data into the database, this proccess only goes one way and cron service is only responsible for writing data to the DB.
- After the data is saved, the Cron Service queues the timezone into a rabbitMQ queue.
- The Mail Service consumes the Notification Queue and on a receive event, it triggers the notification functionality.
- The Mail Service queries the database to find subscribed users based on the timezone recieved.
- After the users are found, it sends a notification to all of them.
- The Api Service can get and query the ISS location data.
- The Api Serice can also write subscribed users to the database.
- The Api Service recieves all the calls via the api gateway.
- The Client Vue application is responsible for displaying datatables with the data and create subscribers.
- The end user is capable to get satelite data and post it's email to our database.
To be able to run the application you need docker and docker-compose installed. Please refer to the docs to install them before taking any further steps
For the Mail service to work add your email credentials to .env.docker, the emails will be sent from the specified account.
MAIL_HOST="smtp.gmail.com"
MAIL_DOMAIN_ADDRESS=example@mail.com
MAIL_PASSWORD=mypassword
Clone this repository
git clone https://github.com/Abeldlp/iss.gitGo to the directory
cd issBuild docker images (cup of coffee)
docker-compose buildRun all containers in detached mode
docker-compose up -dAt this point you will have five containers running and you can access the client on http://localhost:3000
If you want to access the database container use a client of your liking, and connect to postgres with the following.- USERNAME
user - PASSWORD
password - HOST
localhost - PORT
5432 - DATABASE
app-db
If you want to play with the api, the api gateway is listening on http://localhost:4444
To stop the containers you can run the following
docker-compose downOptionaly if you have
makeandbuild-essentialsinstalled locally you can make use of theMakefile
To run all tests at once you can make use of the Makefile. You will need make and build-essentials installed locally. Refer to your OS/Distro installation docs.
Before running any tests don't forget to stop all the containers, since client e2e testing is using the same port mapping to serve with mock and run tests.
make testThe above command will run api-service tests, cron-service tests, client unit tests and client e2e tests.
To run them individually you can run the following:
Api Service
cd api-service && go test ./testCron Service
cd schedule-service && go test ./testClient (unit)
cd client && npm run test:unit:ciClient (e2e)
cd client && npm run test:e2e:ciFor the client's e2e testing you can also run them in preview mode, so you can visualize what the tests are doing on a Chromium, Electron or Firefox browser. You can run them with the following command:
cd client && npm run test:e2eIn case of client project showcase, it is also possible to run the project in mocking mode, which will mock api calls and use static data. The project will be served on http://localhost:3000 You can serve the project with mock locally with the following command:
cd client && npm run dev-mockThe client application consists on:
- Email subscription
- Autofetch button.
- Aggregated Datatable
- Sample Datatable
- Informational tree
Email subscription
By subscribing to the email service, you save the email and timezone in the database. Everytime a new ISS location is added to the database, the message broker will queue the timezone for the mail service to recieve. If the ISS is on you timezone it will send you an email to notify you.
Autofetch button
This button allows the user to fetch data automatically every minute so page reload is not required to fetch data.
Aggregated Datatable
Datatable containing the data aggregated. You are able to paginate, sort and filter using the selectors.
Sample Datatable
Datatable containing all the data stored in the database. You are able to paginate and sort.
Informational Tree
You can always check the explanation of the page parts in case you get lost.
This application is simple to use and straight to the point. If you wish to develop locally remember that you will need Golang and Node installed.
If any questions come your way don't hesitate to drop an email to abel45991690@gmail.com


