Skip to content

This project demonstrates a scalable, modular integration hub using Python FastAPI, designed to seamlessly incorporate multiple advanced features like Zoho Single Sign-On (SSO) (OAuth 2.0 & OpenID Connect), Zoho WorkDrive APIs, RAG (Retrieval-Augmented Generation), chatbot integrations, and future enterprise APIs

Notifications You must be signed in to change notification settings

vishwajitvm/FastAPI-Integrations-Hub

Repository files navigation

πŸš€ FastAPI-Integrations-Hub: Zoho APIs, SSO, WorkDrive, RAG & Chatbot

This project demonstrates a scalable, modular integration hub using Python FastAPI, designed to seamlessly incorporate multiple advanced features like Zoho Single Sign-On (SSO) (OAuth 2.0 & OpenID Connect), Zoho WorkDrive APIs, RAG (Retrieval-Augmented Generation), chatbot integrations, and future enterprise APIs β€” all under one unified architecture.

βœ… Refactored using FastAPI routers for clean, maintainable, and scalable code β€” perfect for continuously evolving multi-feature use cases!


πŸ’‘ Features

  • βœ… Login with Zoho SSO (OAuth 2.0 + OpenID Connect)
  • πŸ”‘ Decode id_token (JWT) to extract user profile info (name, email, Zoho User ID)
  • πŸ—‚οΈ Access personal WorkDrive folders (My Folders)
  • πŸ‘₯ Access team folders (Team Folders)
  • 🧠 Future support for RAG (retrieval-augmented generation) modules
  • πŸ€– Extendable chatbot integrations (LLMs, agent-based bots, etc.)
  • πŸ’Ό Maintain user sessions with FastAPI (in-memory or future scalable storage)
  • 🧩 Highly modular router-based structure for adding any number of APIs cleanly

πŸ—‚οΈ Project Structure

your_project/
β”œβ”€β”€ main.py               # Main FastAPI app entry point
β”œβ”€β”€ config.py            # Central configuration (env vars, API base URLs)
β”œβ”€β”€ .env                 # Environment variables (client ID, secret, etc.)
β”œβ”€β”€ requirements.txt     # Python dependencies
β”œβ”€β”€ README.md            # Project documentation (this file)
β”œβ”€β”€ templates/
β”‚   β”œβ”€β”€ login.html       # Login page template
β”œβ”€β”€ routers/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ zoho/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ auth.py     # Auth routes (login, callback, logout)
β”‚   β”‚   β”œβ”€β”€ folders.py  # WorkDrive folder routes
β”‚   β”‚   └── zoho_client.py  # Zoho API helpers
β”‚   β”œβ”€β”€ rag/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ rag_routes.py  # Retrieval-augmented generation logic
β”‚   β”‚   └── rag_utils.py
β”‚   β”œβ”€β”€ chatbot/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ chatbot_routes.py  # Chatbot endpoints
β”‚   β”‚   └── chatbot_utils.py
β”‚   └── otherapi/
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ routes.py
β”‚       └── utils.py
β”œβ”€β”€ constants/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ response_messages.py  # Centralized response messages
β”‚   └── status_codes.py       # HTTP status codes
└── utils/
    β”œβ”€β”€ __init__.py
    └── shared.py     # Shared helpers
    └── zoho_folder_helpers.py     # Zoho api file itration common function
    β”œβ”€β”€ zoho_client.py
    β”œβ”€β”€ helpers.py
    

πŸ“ Folder usage

  • routers/zoho/ β€” Zoho SSO and WorkDrive logic.
  • routers/rag/ β€” RAG-based modules (e.g., vector DB queries, knowledge retrieval).
  • routers/chatbot/ β€” AI chatbot integrations and agent logic.
  • routers/otherapi/ β€” additional APIs (placeholder for future integrations).
  • constants/ β€” central definitions for response messages and status codes.
  • utils/ β€” shared helpers and utilities across modules.

πŸ’‘ How it works

1️⃣ User clicks Login with Zoho button.
2️⃣ Redirected to Zoho OAuth page.
3️⃣ User authenticates and grants consent.
4️⃣ App exchanges code for tokens (access_token, id_token).
5️⃣ id_token is decoded to get user profile.
6️⃣ Session stored (initially in-memory, can be upgraded later).
7️⃣ User gains access to features like:

  • βœ… My Folders
  • βœ… Team folders
  • πŸ’¬ Future: RAG-powered knowledge queries
  • πŸ€– Future: Chatbot interactions 8️⃣ User can logout anytime.

✨ Future directions

  • πŸ”’ JWT signature validation for production.
  • πŸ—‚οΈ Expand WorkDrive to include file upload and management.
  • πŸ€– Integrate advanced AI agent workflows.
  • πŸ”Ž Add RAG for contextual enterprise Q&A.
  • 🌐 Integrate more SaaS or internal business APIs.

βš™οΈ Setup Instructions

1️⃣ Clone the repository

git clone https://github.com/vishwajitvm/FastAPI-Integrations-Hub.git
cd FastAPI-Integrations-Hub

2️⃣ Create virtual environment & install dependencies

python -m venv venv
source venv/bin/activate    # On Windows: venv\Scripts\activate
pip install -r requirements.txt

3️⃣ Add environment variables

Create a .env file in the root directory and paste:

FLASK_SECRET_KEY=your_secret_key_here
ZOHO_CLIENT_ID=your_zoho_client_id_here
ZOHO_CLIENT_SECRET=your_zoho_client_secret_here
ZOHO_REDIRECT_URI=http://localhost:8000/callback

⚠️ Match your Zoho app redirect URI exactly.


4️⃣ Run the app

uvicorn main:app --host 127.0.0.1 --port 8000 --reload

Then open http://localhost:8000/ in your browser.


🟒 Quick Bash Summary

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# Create .env and paste credentials

uvicorn main:app --host 127.0.0.1 --port 8000 --reload

.

πŸ“„ API Documentation

FastAPI automatically provides interactive and static API documentation out of the box!

1️⃣ Swagger UI URL

 http://localhost:8000/docs
  • Interactive interface to explore and test your endpoints directly.

  • Supports authentication flows, parameters, and request bodies.

  • Ideal for developers and API testers.

2️⃣ ReDocURL

 http://localhost:8000/redoc
  • Clean, well-structured static documentation view.

  • Great for sharing with business or non-technical stakeholders to explain available APIs.

  • Provides easy navigation and human-readable endpoint summaries.

.

⚑️ Additional Notes

No extra setup is needed β€” both docs are auto-generated from your FastAPI routers and docstrings.

You can customize descriptions, summaries, and request/response schemas directly in your router files using standard FastAPI annotations.


βœ‰οΈ Contact

Created by Vishwait VM β€” vishwajitmall0@gmail.com

Feel free to reach out for questions, suggestions, or collaborations! πŸš€


About

This project demonstrates a scalable, modular integration hub using Python FastAPI, designed to seamlessly incorporate multiple advanced features like Zoho Single Sign-On (SSO) (OAuth 2.0 & OpenID Connect), Zoho WorkDrive APIs, RAG (Retrieval-Augmented Generation), chatbot integrations, and future enterprise APIs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published