Skip to content

KeraDB/explorer

Repository files navigation

keradb Labs

A modern, full-stack database management and monitoring application for keradb databases with real-time system monitoring.

πŸš€ Quick Start

Prerequisites

Start Servers

Backend (Terminal 1):

cd backend && ./start.sh

Runs on http://localhost:5800

Frontend (Terminal 2):

cd frontend && ./start.sh

Runs on http://localhost:5810

Open browser to http://localhost:5810

✨ Features

🌐 Web Interface

  • Modern React-based UI
  • Dark theme design
  • Responsive layout
  • Intuitive navigation

πŸ“Š Database Explorer

  • Create and open databases
  • Browse collections
  • Full CRUD operations
  • JSON document editing
  • Real-time updates

πŸ“ˆ System Monitor (NEW!)

  • Real-time monitoring - Auto-refresh every 5 seconds
  • Connection tracking - All registered databases
  • Performance metrics - Operation duration tracking
  • Visual analytics - Color-coded operations
  • Interactive UI - Click databases for details

πŸ” System Database

  • Automatic tracking - All database connections
  • Performance logging - Operation durations
  • Usage statistics - Access counts and patterns
  • OS-agnostic storage - Works on Windows/Linux/Mac
  • Persistent metadata - Survives server restarts

πŸ› οΈ Tech Stack

Backend

  • Rust - Systems programming language
  • Actix-Web - High-performance web framework
  • keradb - Document database engine
  • Serde - Serialization framework
  • Chrono - Date/time handling

Frontend

  • React 18 - UI framework
  • TypeScript - Type-safe JavaScript
  • Vite - Build tool & dev server
  • Tailwind CSS - Utility-first CSS
  • Axios - HTTP client
  • Lucide React - Icon library
  • React Router - Navigation

πŸ“ Project Structure

keradb-labs/
β”œβ”€β”€ backend/                      # Rust backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.rs              # API server
β”‚   β”‚   └── system_db.rs         # System database ✨
β”‚   β”œβ”€β”€ start.sh                 # Start script
β”‚   β”œβ”€β”€ SYSTEM_DB.md             # System DB docs
β”‚   β”œβ”€β”€ ARCHITECTURE.md          # Architecture guide
β”‚   └── README.md
β”‚
β”œβ”€β”€ frontend/                     # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Explorer.tsx
β”‚   β”‚   β”‚   └── SystemMonitor.tsx     ✨
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ Layout.tsx
β”‚   β”‚   β”‚   └── ConnectionHistory.tsx ✨
β”‚   β”‚   └── App.tsx
β”‚   β”œβ”€β”€ start.sh                 # Start script
β”‚   └── README.md
β”‚
β”œβ”€β”€ FRONTEND_IMPLEMENTATION.md    # Implementation guide
└── README.md                     # This file

πŸ“Š System Monitor Features

Dashboard View

  • Total Databases - Count of all registered databases
  • Total Collections - Sum across all databases
  • Total Documents - Complete document count
  • Auto-refresh - Updates every 5 seconds (toggleable)

Connection List

Each database shows:

  • Path and filename
  • Number of collections
  • Number of documents
  • Access count
  • Last accessed time

Performance Metrics

Click any database to see:

  • Average operation time
  • Recent operations (last 10)
  • Operation durations
  • Color-coded operation types:
    • πŸ”΅ open_database
    • 🟒 create_database
    • 🟣 insert_document
    • 🟑 update_document
    • πŸ”΄ delete_document

πŸ”— API Endpoints

System Monitoring

GET  /api/system/stats              # System statistics
GET  /api/system/connections        # Connection history
GET  /api/system/metrics/{db}       # Performance metrics
DELETE /api/system/connections/{db} # Remove connection

Database Operations

POST /api/databases/open            # Open database
POST /api/databases/create          # Create database
GET  /api/databases/{db}/stats      # Database stats

Document Operations

POST   /api/databases/{db}/documents    # Insert
GET    /api/databases/{db}/documents    # Find all
PUT    /api/databases/{db}/documents    # Update
DELETE /api/databases/{db}/documents    # Delete

πŸ“š Documentation

πŸ§ͺ Testing

Backend Tests

cd backend
./test_system_db.sh

View System Stats

curl http://localhost:5800/api/system/stats | jq

🎯 Use Cases

  1. Database Development - Quick prototyping and testing
  2. Performance Monitoring - Track operation durations
  3. Usage Analytics - See which databases are used most
  4. Database Management - Centralized control of multiple DBs

πŸ”’ Security Note

  • System database stored in user's home directory: ~/.keradb/
  • No authentication (add for production use)
  • CORS enabled for development

🚨 Troubleshooting

See individual README files in backend/ and frontend/ directories.

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Built with ❀️ using Rust, React, and keradb