Skip to content

uniQuk/GraphAPI-Viewer

Repository files navigation

Note: This is an independent project and is not affiliated with, officially maintained, or endorsed by Microsoft. The API specifications are sourced from Microsoft's official msgraph-sdk-powershell repository.

Microsoft Graph API Viewer

An interactive viewer for Microsoft Graph API's OpenAPI specifications with dark mode support and intuitive navigation.

🔗 Live Demo

Prerequisites

  • Python 3.7+
  • pip (Python package manager)

Setup

  1. Set up the environment:
python3 -m venv venv
source venv/bin/activate
  1. Install Python dependencies:
pip install -r requirements.txt
  1. Make scripts executable:
chmod +x scripts/*.py

Usage

1. Download OpenAPI Specifications

Fetch the latest OpenAPI specifications from Microsoft's repository:

./scripts/update_openapi.py

The specifications will be downloaded to the openapi directory.

2. Convert and Process

Convert the OpenAPI YAML files to optimized JSON format:

./scripts/convert_yaml.py

3. Generate Site

Build the static site:

./scripts/generate_site.py

4. Run Locally

cd build && python3 -m http.server 8000

Visit http://localhost:8000 in your browser.

Features

  • 🌓 Dark/Light mode with system preference support
  • 📱 Responsive design using Bootstrap 5
  • 🔄 Switch between v1.0 and beta API versions
  • 🎨 Color-coded HTTP methods for easy identification
  • ⚡ Lazy loading of endpoint details
  • 📊 Structured parameter and response displays
  • 🔗 Deep linking support for sharing specific:
    • API versions
    • Categories
    • Tags
    • Endpoints
  • 🔍 Clear endpoint path organization with:
    • Logical path segmentation
    • Method grouping
    • Tag-based categorization
    • Endpoint summaries
  • 💾 Persistent theme preferences
  • 📱 Mobile-optimized interface:
    • Collapsible sidebar
    • Responsive tables
    • Touch-friendly controls
    • Improved method display on small screens

Mobile View Features

  • Slide-out navigation menu
  • Mobile-optimized header layout
  • Improved method visibility (methods appear above endpoints)
  • Touch-friendly controls
  • Responsive tables
  • Backdrop overlay for sidebar
  • Automatic menu closing after selection

Screenshots

Dark Mode

Dark Mode Overview

Light Mode

Light Mode Overview

API Endpoint Details

Endpoint Details

Project Structure

.
├── build/               # Generated site
├── openapi/             # API specifications
├── scripts/             # Build scripts
└── src/                 # Source files
    ├── templates/       # HTML templates
    ├── styles/          # CSS files
    └── scripts/         # JavaScript files

Data Source

The OpenAPI specifications are fetched from:

URL Structure

The application supports deep linking with the following URL structure: Examples:

  • Version only: /#/v1.0
  • Category: /#/v1.0/Identity.SignIns
  • Tag: /#/v1.0/Identity.SignIns/identityProviders.identityProvider
  • Full path: /#/v1.0/Identity.SignIns/identityProviders.identityProvider/[endpoint-hash]

Deployment

The build directory can be deployed to:

  • GitHub Pages
  • Netlify
  • Any static hosting service
  • Local web servers

The application automatically detects its environment and adjusts base paths:

  • For GitHub Pages: Automatically detects repository name and adjusts paths
  • For local development: Uses root path
  • For custom deployments: No configuration needed

Tech Stack

  • Bootstrap 5.3.2: UI framework
  • Bootstrap Icons 1.11.1: Icon set
  • PyYAML: YAML processing
  • Requests: HTTP client

License

MIT License - see LICENSE

For third-party licenses, see THIRD_PARTY_LICENSES.md

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published