Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions admin-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
84 changes: 84 additions & 0 deletions admin-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# OpenContext Admin UI

React-based administration interface for OpenContext knowledge management system.

## Features

- **Dashboard**: Real-time statistics and overview of document processing status
- **Document Manager**: Upload, manage, and monitor document ingestion pipeline
- **Search Interface**: Test MCP search tools (find_knowledge and get_content)
- **Settings**: API key management and system configuration

## Tech Stack

- React 19.1.1
- TypeScript 5.8.3
- Vite 7.1.2
- Tailwind CSS 3.4.17
- React Router DOM 7.8.1
- React Query 5.85.3
- Zustand 5.0.7
- Axios 1.11.0
- Lucide React 0.539.0

## Development

### Prerequisites

- Node.js 18+
- npm or yarn
- OpenContext backend running on localhost:8080

### Setup

```bash
# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview
```

### Environment Variables

```bash
# Optional - defaults to localhost:8080
VITE_API_BASE_URL=http://localhost:8080/api/v1
```

## Usage

1. Start the backend server (OpenContext Core)
2. Run the frontend development server
3. Navigate to http://localhost:5173
4. Configure API key in Settings page
5. Upload documents and test search functionality

## API Integration

The admin UI integrates with OpenContext backend APIs:

- **Admin APIs**: Require X-API-KEY header authentication
- **Search APIs**: Public endpoints for MCP tool testing
- **File Upload**: Multipart form data with progress tracking

## Architecture

- **Components**: Reusable UI components in `/src/components/ui/`
- **Pages**: Main application views in `/src/pages/`
- **API Client**: Centralized HTTP client in `/src/lib/api.ts`
- **State Management**: Zustand store for authentication state
- **Types**: TypeScript definitions in `/src/types/`

## Contributing

1. Follow existing code style and patterns
2. Add TypeScript types for new features
3. Test API integrations with backend
4. Ensure responsive design works on all screen sizes
23 changes: 23 additions & 0 deletions admin-ui/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import { globalIgnores } from 'eslint/config'

export default tseslint.config([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs['recommended-latest'],
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
},
])
13 changes: 13 additions & 0 deletions admin-ui/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading