Skip to content

πŸ§™ Mithrandir Admin Dashboard - Unified admin interface for managing services on the Mithrandir server. Built with React, TanStack Router, and shadcn/ui.

License

Notifications You must be signed in to change notification settings

fork-archive-hub/mithrandir-admin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ§™β€β™‚οΈ Mithrandir Admin - The One Admin to Rule Them All

Modern, professional admin dashboard for managing all Mithrandir services.

🎯 Features

Phase 1: Transcription Dashboard (CURRENT)

  • βœ… Real-time transcription job monitoring
  • βœ… Job status tracking (pending, processing, completed, failed)
  • βœ… Progress indicators and statistics
  • βœ… Job retry and delete functionality
  • βœ… Auto-refresh every 5 seconds
  • βœ… Search and filtering
  • βœ… Modern UI with shadcn/ui components

Coming Soon

  • πŸ”„ Delegation System Dashboard
  • 🎯 n8n Workflow Management
  • πŸ“Š System Monitoring & Health
  • πŸ—„οΈ Database Management
  • βš™οΈ Service Control Panel

πŸš€ Tech Stack

  • Framework: Vite + React 19 + TypeScript
  • UI: shadcn/ui + Tailwind CSS
  • Routing: TanStack Router
  • State: TanStack Query (React Query)
  • Tables: TanStack Table
  • Icons: Lucide React

πŸ“¦ Installation

cd ~/Projects/mithrandir-admin
npm install

πŸ”§ Development

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

🌐 API Integration

⚠️ CRITICAL: This dashboard MUST use the Mithrandir Unified API (port 8080)

The dashboard integrates with the Mithrandir Unified API, which acts as an API Gateway/BFF (Backend for Frontend):

  • Unified API: http://100.77.230.53:8080 (API Gateway)
    • /api/dashboard/* - Dashboard statistics and activity
    • /transcription/* - Transcription jobs (proxied to Palantir backend)
    • /ssh-status - System monitoring
    • /services/* - Service health checks

DO NOT point directly to backend services (e.g., port 9003). The Unified API provides:

  • βœ… Consistent API contracts
  • βœ… Centralized CORS, authentication, rate limiting
  • βœ… Service abstraction and flexibility
  • βœ… Data aggregation from multiple backend services

πŸ“ Configuration

Environment variables in .env:

# βœ… CORRECT - Always use Unified API (port 8080)
VITE_APP_TITLE="Mithrandir Admin"
VITE_API_BASE_URL=http://100.77.230.53:8080
VITE_TRANSCRIPTION_API=http://100.77.230.53:8080/transcription
VITE_UNIFIED_API=http://100.77.230.53:8080

# Network Configuration
VITE_ALLOWED_HOSTS=dashboard.shire,admin.shire,mithrandir-admin.shire,localhost,100.77.230.53

❌ INCORRECT - Do NOT use backend service ports directly:

# ❌ WRONG - Do not point to backend services!
VITE_API_BASE_URL=http://100.77.230.53:9003
VITE_TRANSCRIPTION_API=http://100.77.230.53:9003/api/v1

πŸ”§ API Type Generation

This project uses TypeScript types generated from the Transcription Palantir OpenAPI specification for type-safe API integration.

Regenerate types after Transcription Palantir API updates:

# Generate types from local API (default)
npm run generate:types

# Or specify custom API URL
TRANSCRIPTION_API_URL=http://palantir.tailnet:3001 npm run generate:types

Generated file: src/types/palantir.d.ts

Usage example:

import type { paths, components } from './types/palantir';

type JobsResponse = paths['/api/v1/jobs']['get']['responses']['200']['content']['application/json'];
type Job = components['schemas']['Job'];

When to regenerate:

  • After updating Transcription Palantir API
  • When TypeScript compilation errors indicate type mismatches
  • Before deploying changes

See Transcription Palantir: Consumer Type Generation Guide for complete documentation.

🎨 Project Structure

src/
β”œβ”€β”€ routes/                    # Route definitions
β”‚   └── _authenticated/
β”‚       └── transcription/    # Transcription routes
β”œβ”€β”€ features/                 # Feature modules
β”‚   └── transcription/        # Transcription feature
β”‚       β”œβ”€β”€ components/       # UI components
β”‚       β”œβ”€β”€ api/             # API integration
β”‚       └── data/            # Types and constants
└── components/              # Shared components

πŸš€ Deployment

The admin dashboard is deployed on Mithrandir server:

  • Service: mithrandir-admin.service (systemd user service)
  • Port: 3000
  • Location: /home/nbost/Projects/mithrandir-admin/
  • Auto-deploy: Push to main branch triggers GitHub Actions deployment

Deployment Process

# Local development
git add .
git commit -m "feat: your changes"
git push origin main

# GitHub Actions automatically:
# 1. Runs CI (lint, type-check, build)
# 2. Deploys to production via SSH
# 3. Restarts mithrandir-admin service

Manual Deployment

# SSH to Mithrandir
ssh mithrandir

# Navigate to project
cd /home/nbost/Projects/mithrandir-admin

# Pull latest changes
git pull

# Install dependencies (if needed)
npm install

# Build
npm run build

# Restart service
systemctl --user restart mithrandir-admin

πŸ“– Documentation

πŸ—οΈ Architecture

Mithrandir Admin Dashboard (Port 3000)
           β”‚
           β”‚ HTTP/REST
           β–Ό
Mithrandir Unified API (Port 8080)
           β”‚
           β”œβ”€β†’ /api/dashboard/*  β†’ Dashboard stats
           β”œβ”€β†’ /transcription/*  β†’ Transcription Palantir (Port 9003)
           β”œβ”€β†’ /ssh-status       β†’ System monitoring
           └─→ /services/*       β†’ Service health

Built with ❀️ for Mithrandir homelab infrastructure

About

πŸ§™ Mithrandir Admin Dashboard - Unified admin interface for managing services on the Mithrandir server. Built with React, TanStack Router, and shadcn/ui.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

No packages published

Contributors 2

  •  
  •  

Languages