A full-stack web application that enables users to log in securely with their Google account using OAuth 2.0 and view their upcoming Google Calendar events. Built using React (frontend) and FastAPI (backend), this project demonstrates secure authentication, token exchange, and third-party API integration.
- Google OAuth 2.0 login
- Access token + refresh token handling
- Display Google Calendar events on a dashboard
- Secure token exchange and backend validation
- Organized frontend/backend folder structure
- Frontend: React, Axios, Vite
- Backend: FastAPI, OAuthlib, Pydantic
- Auth: Google OAuth 2.0
- Others: JWT, dotenv, HTTPOnly cookies
google-oauth-calendar-app/ βββ frontend/ # React frontend β βββ ... βββ backend/ # FastAPI backend β βββ ... βββ README.md
git clone https://github.com/Rushikesh8603/google-oauth-calendar-app.git cd google-oauth-calendar-app
- Backend (FastAPI) π§ Setup
cd backend
python -m venv venv
source venv/bin/activate # Use venv\Scripts\activate on Windows
pip install -r requirements.txt
π Create .env file
GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret REDIRECT_URI=http://localhost:8000/callback FRONTEND_URL=http://localhost:5173
uvicorn main:app --reload
- Frontend (React) π§ Setup
cd frontend npm install
npm run dev Access frontend at: http://localhost:5173
π Google OAuth Setup Go to Google Cloud Console
Create a new project & OAuth credentials
Set:
Authorized redirect URI: http://localhost:8000/callback
Authorized JavaScript origin: http://localhost:5173
Copy Client ID and Client Secret to your .env file
π API Used Google Calendar API API Docs Used to fetch userβs upcoming events after authentication
πΈ Demo
Watch Demo https://youtu.be/UCR5bZ7TyG8?si=eXzynsU_pyLrFXFm
π§βπ» Author Rushikesh Patare