- Make sure you have a GCP project with Calendar API enabled and a Desktop App OAuth2.0 client ID active.
Download
credentials.json
and drop it in the root of the project. Make sure theredirect_uris
array containshttp://localhost:3000/authenticate
, for redirection purposes. - After that, do
go run cmd/main.go
- Hit
localhost:3000/authenticate
in the browser, authenticate with the Google account you have the Calendar API enabled for.- Copy the
google-session
cookie value from response and use it as a Bearer token for future requests on/api/
path.
- Copy the
- Hit
GET localhost:3000/api/showtime
, which should already show available showtime slots filtered after your calendar events.- Hit
PATCH localhost:3000/api/showtime/:id
to book the showtime seat, and add the event to your calendar. - Hit
DELETE localhost:3000/api/showtime/:id
to cancel booking, and clear the calendar event.
- Hit
And that's it!