Skip to content

ntxinh/api-log-monitor

Repository files navigation

APILog Monitor

A real-time HTTP request/response log monitoring dashboard built with React 19, TypeScript, Tailwind CSS, and Firebase Firestore.

Features

  • 📡 Real-time updates via Firestore onSnapshot listener
  • 🔍 Filter logs by Tenant ID, Service Name, and Status (Success/Error)
  • 🔎 Search by endpoint, correlation ID, IP, error message
  • 📊 Stats bar showing success/error counts, rate, and avg duration
  • 🗂️ Detail panel with full request/response headers, bodies, and metadata
  • 📱 Mobile-first responsive design
  • 🌑 Dark industrial theme with monospace fonts

Setup

1. Install dependencies

npm install

2. Configure Firebase

Copy .env.example to .env.local and fill in your Firebase project values:

cp .env.example .env.local

Then edit .env.local with your Firebase config from the Firebase Console → Project Settings → Your Apps.

3. Firestore Collection

The app expects a Firestore collection named ApiLogs (or apiLogs as fallback).

Documents should match this structure (C# property names with PascalCase are supported):

Field Type
Timestamp Timestamp
CorrelationId string
ServiceName string
Endpoint string
HttpMethod string
RequestHeaders map
RequestBody string (nullable)
ResponseStatusCode number
ResponseHeaders map
ResponseBody string (nullable)
DurationMs number
UserId number (nullable)
TenantId number (nullable)
ClientIp string (nullable)
ErrorMessage string (nullable)

Both PascalCase (Timestamp) and camelCase (timestamp) field names are supported.

4. Firestore Index

Create a composite index in Firestore for efficient ordering:

  • Collection: ApiLogs
  • Field: Timestamp (Descending)

Or the app will prompt you with a link to create it.

5. Run

npm run dev

Build

npm run build

Tech Stack

  • React 19 - UI framework
  • TypeScript - Type safety
  • Tailwind CSS - Styling
  • Zustand - State management
  • Firebase/Firestore - Real-time database
  • date-fns - Date formatting
  • lucide-react - Icons
  • JetBrains Mono - Monospace font

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors