This project is a Go-based REST API that interacts with the Google Calendar API to poll all available rooms that are bookable today and tomorrow. The API is designed to eventually integrate with Slack via a bot, allowing users to easily check if there are desks available in the office.
- Features
- Prerequisites
- Installation
- Configuration
- Usage
- API Endpoints
- Slack Integration
- Contributing
- License
- Polls Google Calendar for available rooms.
- Checks availability for today and tomorrow.
- RESTful API endpoints for querying room availability.
- Future integration with Slack for easy desk availability checks.
- Go 1.22 or later
- Google Cloud Project with Google Calendar API enabled
- Service Account with access to the Google Calendar API
- Slack workspace (for future integration)
-
Clone the repository:
git clone https://github.com/KingMichaelPark/gcal-resource-lister.git cd gcal-resource-lister
-
Install dependencies:
go mod tidy
-
Set up Google Calendar API credentials:
- Create a service account in your Google Cloud Project.
- Download the JSON key file and save it in the project directory.
-
Environment Variables:
Set some environment variable for the API key. You can have it automatically with
mise
.GOOGLE_CALENDAR_API_KEY=YOUR_API_KEY
-
Google Calendar API: Share your calendar with the service account email to grant access.
- Run the server:
go run src/*
-
GET /rooms Returns the list of available rooms for today.
curl -X GET http://localhost:8080/rooms?day=today
-
GET /rooms Returns the list of available rooms for tomorrow.
curl -X GET http://localhost:8080/rooms?day=tomorrow
-
GET /rooms/:calendarId Returns the specific rooms availability
curl -X GET http://localhost:8080/rooms/:calendarId
Note: This feature is under development.
The API will eventually integrate with Slack using a bot. Users will be able to check room availability directly from Slack by interacting with the bot.
We welcome contributions! Please see CONTRIBUTING.md for more details.
This project is licensed under the MIT License. See the LICENSE file for details.
--- Feel free to open an issue or submit a pull request if you have any
questions or suggestions. Happy coding! I am very new to go
so let me
know if I can be better!