Building an event directory

Hi,

we have events on our sites, which users can attend depending on the authentication status. As I understand there is nothing “out of the box” available for managing events in Ghost, thats why I thought if the following setup could work?

  1. We host our event data in Supabase, everything event specific (date, time etc.)
  2. with the event data we map it to a ghost post #events
  3. we use ghost to serve the event detail page

Am I hallucinating or could that be achieved?

Embedding javascript on a Ghost page or post is entirely possible, so there’s no reason you can’t do this.

You may also want to consider whether the event index is generated live (client side javascript or a cloud function that retrieves it on demand), or whether a cron job or scheduled cloud function updates the events index page and the individual event pages on some schedule. If changes are slow and traffic is high, and your visitors are just reading the supabase data (not changing it) it may make a lot of sense to batch update Ghost, rather than having every page visit result in requests to Supabase.

Obviously, think carefully about your access keys. Clientside javascript can only use a public read-only key. Anything else is going to be unsafe. If you need to lock things down, then you need a cloud function / service somewhere that holds your secret keys for you and makes the requests to supabase.

1 Like