About the project

Over the last 12 months or so I have been working on a small Java application which needs to be continuously running in the background. The application itself is not that interesting, all it does is collecting the information from different APIs and sending me occasional emails when it finds new information. It has only two users (including myself), and I have no intention of making it public.

The setup around this application, however, is a lot more interesting, and I have learnt a lot from it, so I thought I would share some of my learnings.

The problem

Until I have implemented the solution described below the only way to read the logs of my application (it prints a lot of time) was to SSH to my server, and open an instance of the “screen” application on which it runs. It was way too many steps, and it meant that I could only do so from a computer, so I thought I should make them available on the Internet so that I could access them from any device which has a connection to WWW. I decided to use Firebase for this purpose.

I will separate the whole process into three parts:

  1. Setting up Firebase (this article);
  2. Updating my Java application to start uploading the information to the server;
  3. Creating a website which can access the data;

Firebase setup

I have created a new project from the Firebase console by giving the name and my location.

screen-shot-2016-09-11-at-8-27-01-am

Then I needed to add a service account which would be used to write the logs. I have followed the official Firebase documentation to achieve that step.

As I mentioned, I have two users (including myself), so I added two accounts in the Firebase console. I went to “Auth” section and then selected “SET UP SIGN-IN METHOD”.

screen-shot-2016-09-11-at-8-31-15-am

screen-shot-2016-09-11-at-8-32-07-am

For now, I only needed to “Enable” the simple “Email/Password” option. After that, I could return to the “USERS” section to add my two accounts.

screen-shot-2016-09-11-at-8-33-46-am

That was all of the setup I needed on the Firebase side.

 

%d