Giter VIP home page Giter VIP logo

gcal-resource-lister's Introduction

GitHub go.mod Go version

Office Room Availability Checker

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.

Table of Contents

Features

  • 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.

Prerequisites

  • 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)

Installation

  1. Clone the repository:

    git clone https://github.com/KingMichaelPark/gcal-resource-lister.git
    cd gcal-resource-lister
  2. Install dependencies:

    go mod tidy
  3. 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.

Configuration

  1. Environment Variables:

    Set some environment variable for the API key. You can have it automatically with mise.

    GOOGLE_CALENDAR_API_KEY=YOUR_API_KEY
  2. Google Calendar API: Share your calendar with the service account email to grant access.

Usage

  1. Run the server:
    go run src/*

API Endpoints

  • 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

Slack Integration

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.

Contributing

We welcome contributions! Please see CONTRIBUTING.md for more details.

License

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!

gcal-resource-lister's People

Contributors

kingmichaelpark avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.