Welcome to this express app!
To use this app, follow the instructions below:
-
Clone this repository.
-
Create a
.env
file and add the following variables:PORT=3000
NODE_ENV=development
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
To get your
GOOGLE_CLIENT_ID
andGOOGLE_CLIENT_SECRET
:- Go to the Google Developer Console and create a new project.
- Enable the Google Calendar API for your project.
- Create OAuth2 credentials for a web app with the following redirect URI:
http://localhost:3000/oauth2callback
. - Download the JSON file and copy the
client_id
andclient_secret
values into your.env
file.
-
Run
npm install
to install all the required modules. -
Run
npm run dev
to start the app onhttp://localhost:3000
. -
Visit
http://localhost:3000/docs
to access the Swagger API documentation.
To authorize your host, follow these steps:
- Call the
/initiate-auth
API. - The API will return an
authUrl
. - Open the
authUrl
in your browser and grant permission to your Google account. - Once permission is granted, the browser will redirect to
http://localhost:3000/oauth2callback
with an authorization code in the request body. - The above auth code is already taken into care to generate access token and refresh token, and set the credentials. You don't have to do anything else.
- You are now authorized to use the other APIs.
I have randomly picked 10 available meeting slots between 9th April 2023 to 16th April 2023 in advance. You can add/update/remove slots in utils.ts
file.
App deployed @Vercel Production link : https://simple-calendly-backend.vercel.app/ Docs link : https://simple-calendly-backend.vercel.app/docs/
Thank you for using this app!