Add web UI with artifact table and upload functionality

Features:
- Modern web interface with table view of all artifacts
- Display all metadata: filename, type, size, test info, tags
- Upload form with full metadata support
- Query/filter interface
- Detail modal for viewing full artifact information
- Download and delete actions
- Integrated seed data generation via UI
- Responsive design with gradient theme

Technical:
- Pure HTML/CSS/JavaScript (no frameworks)
- FastAPI serves static files
- Seed data API endpoint for easy testing
- Pagination support
- Real-time deployment mode display

The UI is now accessible at http://localhost:8000/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-14 16:12:32 -05:00
parent 2dea63f99f
commit 7b2b49e394
6 changed files with 1176 additions and 3 deletions

View File

@@ -1,9 +1,13 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.staticfiles import StaticFiles
from fastapi.responses import FileResponse
from app.api.artifacts import router as artifacts_router
from app.api.seed import router as seed_router
from app.database import init_db
from app.config import settings
import logging
import os
# Configure logging
logging.basicConfig(
@@ -33,6 +37,12 @@ app.add_middleware(
# Include routers
app.include_router(artifacts_router)
app.include_router(seed_router)
# Mount static files
static_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), "static")
if os.path.exists(static_dir):
app.mount("/static", StaticFiles(directory=static_dir), name="static")
@app.on_event("startup")
@@ -45,9 +55,9 @@ async def startup_event():
logger.info("Application started successfully")
@app.get("/")
async def root():
"""Root endpoint"""
@app.get("/api")
async def api_root():
"""API root endpoint"""
return {
"message": "Test Artifact Data Lake API",
"version": "1.0.0",
@@ -57,6 +67,23 @@ async def root():
}
@app.get("/")
async def ui_root():
"""Serve the UI"""
index_path = os.path.join(static_dir, "index.html")
if os.path.exists(index_path):
return FileResponse(index_path)
else:
return {
"message": "Test Artifact Data Lake API",
"version": "1.0.0",
"docs": "/docs",
"ui": "UI not found. Serving API only.",
"deployment_mode": settings.deployment_mode,
"storage_backend": settings.storage_backend
}
@app.get("/health")
async def health_check():
"""Health check endpoint"""