Google OAuth2 API does not allow for long-lived tokens in front-end applications (the token only lasts 1 hour, after which user must be explicitly prompted again - bad UX).
This backend is used to generate a more-persistent token.
-
Clone this repository and open current folder:
git clone https://github.com/maxpatiiuk/calendar-plus cd calendar-plus cd backend
-
Create Google OAuth2 client
- Create 2 Client ides - one for development, another for production
- Set type to "Web application"
- Set authorized redirect URI to
https://kgbbebdcmdgkbopcffmpgkgcmcoomhmh.chromiumapp.org/
(replacekgbb...
with the extension ID)
-
(optional) Edit the configuration in ./.env, ./.env.development and ./.env.production
-
Copy ./.env.example into
./.env.development.local
and./.env.production.local
and fill it in according to the instructions in that file and the credentials you received in the previous step. -
Install dependencies:
npm install
- Run
npm run dev
to start the development server
- Create new vercel.com project from this repository
- Change the "Root Directory" setting to current directory (/packages/backend)
- Set environment variables as per
./.env.production.local