{"id":31652927,"url":"https://github.com/doganarif/fastapi-radar","last_synced_at":"2025-10-07T10:39:34.165Z","repository":{"id":315504482,"uuid":"1059778083","full_name":"doganarif/fastapi-radar","owner":"doganarif","description":"A powerful debugging dashboard for FastAPI applications. Monitor HTTP requests, SQL queries, and exceptions in real-time with a beautiful React UI. One-line integration, zero configuration needed.","archived":false,"fork":false,"pushed_at":"2025-09-27T17:20:46.000Z","size":8207,"stargazers_count":138,"open_issues_count":2,"forks_count":8,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-27T19:08:44.895Z","etag":null,"topics":["api-monitoring","debugging","developer-tools","devtools","fastapi","monitoring","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doganarif.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-18T23:54:40.000Z","updated_at":"2025-09-27T17:28:16.000Z","dependencies_parsed_at":"2025-09-19T21:00:32.325Z","dependency_job_id":null,"html_url":"https://github.com/doganarif/fastapi-radar","commit_stats":null,"previous_names":["doganarif/fastapi-radar"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/doganarif/fastapi-radar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doganarif%2Ffastapi-radar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doganarif%2Ffastapi-radar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doganarif%2Ffastapi-radar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doganarif%2Ffastapi-radar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doganarif","download_url":"https://codeload.github.com/doganarif/fastapi-radar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doganarif%2Ffastapi-radar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278762926,"owners_count":26041444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-monitoring","debugging","developer-tools","devtools","fastapi","monitoring","python"],"created_at":"2025-10-07T10:39:32.696Z","updated_at":"2025-10-07T10:39:34.154Z","avatar_url":"https://github.com/doganarif.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# FastAPI Radar\n\n[![Python Version](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n**A debugging dashboard for FastAPI applications providing real-time request, database query, and exception monitoring.**\n\n**Just one line to add powerful monitoring to your FastAPI app!**\n\n## See it in Action\n\n![FastAPI Radar Dashboard Demo](./assets/demo.gif)\n\n## Installation\n\n```bash\npip install fastapi-radar\n```\n\nOr with your favorite package manager:\n\n```bash\n# Using poetry\npoetry add fastapi-radar\n\n# Using pipenv\npipenv install fastapi-radar\n```\n\n**Note:** The dashboard comes pre-built! No need to build anything - just install and use.\n\n## Quick Start\n\n### With SQL Database (Full Monitoring)\n\n```python\nfrom fastapi import FastAPI\nfrom fastapi_radar import Radar\nfrom sqlalchemy import create_engine\n\napp = FastAPI()\nengine = create_engine(\"sqlite:///./app.db\")\n\n# Full monitoring with SQL query tracking\nradar = Radar(app, db_engine=engine)\nradar.create_tables()\n\n# Your routes work unchanged\n@app.get(\"/users\")\nasync def get_users():\n    return {\"users\": []}\n```\n\n### Without SQL Database (HTTP \u0026 Exception Monitoring)\n\n```python\nfrom fastapi import FastAPI\nfrom fastapi_radar import Radar\n\napp = FastAPI()\n\n# Monitor HTTP requests and exceptions only\n# Perfect for NoSQL databases, external APIs, or database-less apps\nradar = Radar(app)  # No db_engine parameter needed!\nradar.create_tables()\n\n@app.get(\"/api/data\")\nasync def get_data():\n    # Your MongoDB, Redis, or external API calls here\n    return {\"data\": []}\n```\n\nAccess your dashboard at: **http://localhost:8000/\\_\\_radar/**\n\n## Features\n\n- **Zero Configuration** - Works with any FastAPI app (SQL database optional)\n- **Request Monitoring** - Complete HTTP request/response capture with timing\n- **Database Monitoring** - SQL query logging with execution times (when using SQLAlchemy)\n- **Exception Tracking** - Automatic exception capture with stack traces\n- **Real-time Updates** - Live dashboard updates as requests happen\n- **Flexible Integration** - Use with SQL, NoSQL, or no database at all\n\n## Configuration\n\n```python\nradar = Radar(\n    app,\n    db_engine=engine,            # Optional: SQLAlchemy engine for SQL query monitoring\n    dashboard_path=\"/__radar\",   # Custom dashboard path (default: \"/__radar\")\n    max_requests=1000,           # Max requests to store (default: 1000)\n    retention_hours=24,          # Data retention period (default: 24)\n    slow_query_threshold=100,    # Mark queries slower than this as slow (ms)\n    capture_sql_bindings=True,   # Capture SQL query parameters\n    exclude_paths=[\"/health\"],   # Paths to exclude from monitoring\n    theme=\"auto\",                # Dashboard theme: \"light\", \"dark\", or \"auto\"\n    db_path=\"/path/to/db\",       # Custom path for radar.duckdb file (default: current directory)\n)\n```\n\n### Custom Database Location\n\nBy default, FastAPI Radar stores its monitoring data in a `radar.duckdb` file in your current working directory. You can customize this location using the `db_path` parameter:\n\n```python\n# Store in a specific directory\nradar = Radar(app, db_path=\"/var/data/monitoring\")\n# Creates: /var/data/monitoring/radar.duckdb\n\n# Store with a specific filename\nradar = Radar(app, db_path=\"/var/data/my_app_monitoring.duckdb\")\n# Creates: /var/data/my_app_monitoring.duckdb\n\n# Use a relative path\nradar = Radar(app, db_path=\"./data\")\n# Creates: ./data/radar.duckdb\n```\n\nIf the specified path cannot be created, FastAPI Radar will fallback to using the current directory with a warning.\n\n### Development Mode with Auto-Reload\n\nWhen running your FastAPI application with `fastapi dev` (which uses auto-reload), FastAPI Radar automatically switches to an in-memory database to avoid file locking issues. This means:\n\n- **No file locking errors** - The dashboard will work seamlessly in development\n- **Data doesn't persist between reloads** - Each reload starts with a fresh database\n- **Production behavior unchanged** - When using `fastapi run` or deploying, the normal file-based database is used\n\n```python\n# With fastapi dev (auto-reload enabled):\n# Automatically uses in-memory database - no configuration needed!\nradar = Radar(app)\nradar.create_tables()  # Safe to call - handles multiple processes gracefully\n```\n\nThis behavior only applies when using the development server with auto-reload (`fastapi dev`). In production or when using `fastapi run`, the standard file-based DuckDB storage is used.\n\n## What Gets Captured?\n\n- ✅ HTTP requests and responses\n- ✅ Response times and performance metrics\n- ✅ SQL queries with execution times\n- ✅ Query parameters and bindings\n- ✅ Slow query detection\n- ✅ Exceptions with stack traces\n- ✅ Request/response bodies and headers\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n### Development Setup\n\nFor contributors who want to modify the codebase:\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/doganarif/fastapi-radar.git\ncd fastapi-radar\n```\n\n2. Install development dependencies:\n\n```bash\npip install -e \".[dev]\"\n```\n\n3. (Optional) If modifying the dashboard UI:\n\n```bash\ncd fastapi_radar/dashboard\nnpm install\nnpm run dev  # For development with hot reload\n# or\nnpm run build  # To rebuild the production bundle\n```\n\n4. Run the example apps:\n\n```bash\n# Example with SQL database\npython example_app.py\n\n# Example without SQL database (NoSQL/in-memory)\npython example_nosql_app.py\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Built with [FastAPI](https://fastapi.tiangolo.com/)\n- Dashboard powered by [React](https://react.dev/) and [shadcn/ui](https://ui.shadcn.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoganarif%2Ffastapi-radar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoganarif%2Ffastapi-radar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoganarif%2Ffastapi-radar/lists"}