Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Creating a new meetup on meetup.com when a new event is pushed to the db and activated. #6

Open
AniketSK opened this issue Nov 27, 2018 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@AniketSK
Copy link
Collaborator

The back story:
New events can be written to the db by the admins via the admin panel.
There will be an optional flag to make it live on meetup.

The problem:
This requires publishing the event via meetup apis. However, since this is a call to an external API, we'd normally have to get a paid plan to do that.

Proposed solution: Trading time for money.
Here's how we can totally legitimately get an integration like that going without moving to a paid plan.

  • New events are pushed by the admin console to the firestore db.
  • Another always on system, such as a raspberry pi, is running an application that is monitoring the firestore as well
  • This application (could be a node server or kotlin native), uses the firestore like a client application. Just watching the db for changes like anyone else.
  • This application, when it observes that an entry has been made to the db, kicks off the api call to meetup on its end. Bypassing the need for an external api call from firebase directly.
  • Whatever the result of the api call is, is written back to the db so the firebase application is aware of the result.

Drawbacks
While the pi does stay up 90% of the time, it's possible that the net's down, or there's a power cut or something else has taken the pi offline.
This is actually automatically dealt with, since the next time the pi comes back online, it will read the db and make the api call at that time.
Since the firestore is the single source of truth, this isn't going to go out of sync though we may need identifiers on it such as 'meetup api call in progress' to know if there is going to be a delay.
Therefore, under normal circumstances if we're not rushed, this delay of maybe hours? Shouldn't matter.

Discussion
This is one proposed solution to staying on a free plan and still achieving everything we wanted.
I maintain a pi that's always on anyway, so I could easily host this.

Thoughts? Ideas? Code to propose?

@AniketSK AniketSK added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Nov 27, 2018
@preetjdp
Copy link

Why not just call the api from the Admin Panel.
If a "post to Meetup" toggle is enabled , it will push to Firestore and Meetup.

@preetjdp
Copy link

Rather than using cloud functions, firebase functions can also be used as they have a free limit of 125k/month.

@AniketSK
Copy link
Collaborator Author

@preetjdp that's a great idea! There's a react project already in the repo, that's the admin panel. You can see its source under src.
Just open up the root of this project in vscode.
Thanks for the fantastic suggestion!

@nikhil-thakkar
Copy link
Collaborator

Though @preetjdp suggestion is good but we need to do some pre-processing for e.g. uploading the banner for the event to Meetup, and then referencing it in create event Meetup api. Keeping this logic at client side is a bit of pain.
Hence the cloud function route. What you guys think?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants