1. Mission
Statement: Build a weather station component for the next ESTCube mission.
Estimated time required: 4-6 hours.
Purpose: To familiarize you with the tools required to develop for the MCS.
2. Description
The importance of weather information while tracking spacecraft cannot be emphasized enough. There’s a lot of groundwork and preparation required before and during a satellite pass and the current weather determines a lot of the factors involved. For this exercise, you have to fetch weather information from a given data source and display it on the ESTCube MCS dashboard.
3. Requirements
-
Prepare a self-contained web application front-end for the MCS.
-
Fetch weather information from a given data source (http://meteo.physic.ut.ee/xml/data3.php).
-
Convert the data to JSON and set it as the datasource for a datagrid on the MCS dashboard.
-
All the data must be from the JSON datasource.
-
Your result should look something like this :)
4. Tools
You’ll be playing with the following toys (Use them wisely):
-
Git (https://try.github.io)
-
Node package manager (https://www.npmjs.com)
-
NodeJS (https://nodejs.org)
-
AngularJS (https://angular.io)
-
Docker (https://docs.docker.com)
-
Webpack (https://webpack.github.io)
5. Steps
| This example has been developed in a Windows environment, if you’re a Mac/Linux user, your commands/steps might vary a little but not too much. |
-
Install NPM on your machine (http://blog.teamtreehouse.com/install-node-js-npm-windows) or (https://www.joyent.com/blog/installing-node-and-npm).
-
Clone/fork the exercise from ESTCube official GitHub (https://github.com/estcube/MCS-Recruitment).
-
Navigate to the MCS-Recruitment directory in the terminal.
-
Don’t get discouraged by the number of files in the exercise :P . Most of them are support/configuration files.
-
The only area you need to work with is the "weather-station" folder.
-
So, let’s start!!
-
Install required packages using NPM:
npm install
-
You’ll see a bunch of packages being installed (Check if successful).
-
Now try running the MCS locally using NodeJS:
npm start
-
You may now access the MCS dashboard on your machine (http://localhost:8080):
-
And the weather information section looks like this (http://localhost:8080/weather-information):
-
Do your magic!! Add the required functionality to the Weather information section.
| Look around and you’ll know how the MCS works :). |
-
Feel free to modify as much/little as you like (as required).
-
Now, it’s time to deploy the MCS to a Docker container.
-
Install Docker on your machine.
-
Check the Docker machine status (It should be running):
docker-machine status
if not, try starting it:
docker-machine start default
| If you’re on Windows, you might need VirtualBox to be installed too, although the default installation does it for you. |
-
Navigate to the MCS-Recruitment directory in the terminal.
-
Build the Docker image (It’ll take a while):
docker build -t mcs-app .
-
You should now be able to list the Docker images:
docker images
-
Now try running the MCS locally using Docker:
docker run -it --rm -p 8080:8080 mcs-app
-
You may now access the MCS dashboard on your machine (http://192.168.99.100:8080):
| Your machine might assign a different IP address for the docker image. |
So, use the "ls" command to find your IP address:
docker-machine ls
-
Give yourself a high-five when your application works!!
-
Commit the changes to your git repository.
You don’t need to push the Docker images or containers to Git, Docker is for you to run the application in a container locally. We’ll only need to see the "Weather station" code in your fork of the entire repository.
|
-
Send us the link to your GitHub/Bitbucket repository.
-
Sit back, relax and enjoy a well deserved beer :P.
6. Terminology
-
MCS - The ESTCube Mission control system
-
Windows - Microsoft® Windows®
-
Mac - #TrueHipster
7. Notes
| This exercise is NOT a test, this is a bootcamp to help you get started. |
-
The primary objective of this exercise is to help you get familiar and started with the tools you’re going to use to develop components for the ESTCube Mission control system.
-
The steps are just a guideline to help you achieve the goal. You are more than welcome and actively encouraged to experiment, tinker and even break the tools mentioned here (the more the better!).
-
To help you convert from XML to JSON, you may use the x2js library (https://github.com/abdmob/x2js). You’re also welcome to use your own.
-
Please don’t waste too much of your time perfecting beyond what’s actually required. Sometimes good enough is actually enough.
| The perfect is the enemy of the good (https://en.wikipedia.org/wiki/Perfect_is_the_enemy_of_good). |
-
Be sure to commit as much as possible (when necessary), so we may know how you tackled the issue.
-
If you’re hosting on a GitHub/Bitbucket private repository invite umesh.bhat@estcube.eu as a colloborator.
-
We’re more than happy to help at any stage, should you get stuck. Asking for clarification is considered a good habit to adopt and is encouraged.
-
We might update this document as per feedback to correct typos and additional information.