Richard87 / releaser

Simple notification when repositories is updated
https://releaser.richardhagen.no
MIT License
69 stars 3 forks source link

Question about the implementation #5

Closed mdwragg closed 7 years ago

mdwragg commented 8 years ago

Hi!

I've been digging through your code trying to understand how it all works, if you wouldn't mind spending a wee bit of time explaining how the firebase part of the app works I'd be really thankful! I'm guessing that something back there watches for changes on github and emits the 'new release' email, could you share the firebase config/setup with me?

Many thanks again for the cool app, I'm keen to learn how it works as I'd like to implement a similar tool.

Thanks in advance for taking the time - I appreciate it.

Martin.

Richard87 commented 8 years ago

Hi!

Yes pretty much, Firebase does all the magic (it's basically a real-time database) that syncronizes the data in the browser with your server... AngularFire2 is a wrapper around it that adds RxJs to the mix which again makes it easy to handle the data in Angular2.

Also there is a script that runs every other minute checking for updates in the database, and checks for new releases on GitHub every 30 minutes, I uploaded a new file 2de3cf2

mdwragg commented 8 years ago

Hi again Richard,

Thanks for the extra explanation and for the PHP. May I ask, where do you run the PHP for the version you have stood up at releaser.richardhagen.no?

Is there extra configuration somewhere so that the PHP 'knows' where to query firebase to get the registered repos for the given user? I can't see anywhere obvious where this is happening. Sorry for the questions, I'm not familiar with PHP and firebase so just trying to understand how it is all put together.

Thanks again for your help, github is such a great place to learn and collaborate!

Martin.

Richard87 commented 8 years ago

Hi!

Yes, I run the command in a API section of https://richardhagen.no. I use ktamas77/firebase-php, and if you look at the example in the readme, it takes a base-url for your firebase-database, and a authentication token.

In the php script i posted, its a Symfony command, and I have set up symfonys dependency injector to create the FirebaseLib object for me with the correct credentials :)

Also, for future reference, if you take a look at https://github.com/Richard87/releaser/blob/master/CheckUpdatesCommand.php#L7 and searched for \Firebase\FirebaseLib php in google, you would find the most likely class I use ;)

Keep the questions coming, I'm glad to help!

mdwragg commented 7 years ago

Hi @Richard87 - my apologies I didn't keep this thread going, I got dragged off to concentrate on a quarterly product release. I really hope to be able to put something together like this project for our GitHub organisation. This project and your help have inspired me though. Thanks for taking the time to answer my questions, I appreciate it.

Thanks again.