A React administration dashboard for managing LLM API access, monitoring usage, and handling user requests.
- Overview
- Features
- Tech Stack
- Getting Started
- Available Scripts
- Project Structure
- API Documentation
- Contributing
PlaywithLLM Admin UI is a comprehensive administration interface built with React and TypeScript. It provides a dashboard for managing API keys, monitoring requests, analyzing usage statistics, and tracking costs.
- Dashboard: Overview of key metrics and performance indicators
- API Key Management: Create, view, and revoke API keys
- Usage Monitoring: Track token usage and request metrics
- Cost Analysis: View cost breakdowns by day, model, or API key
- Request Monitoring: Review and analyze API requests
- Documentation: Built-in API documentation
- Authentication: Secure user login and registration
- Framework: React 18 with TypeScript
- Build Tool: Vite
- UI Components: MUI
- State Management: React Context API
- Routing: React Router DOM
- API Communication: Axios, Socket.io
- Data Visualization: Recharts
- Styling: Emotion/styled-components
- Authentication: JWT-based (backend implementation)
- Node.js (v16 or higher)
- npm or yarn
-
Clone the repository:
git clone https://github.com/playwithllm/admin-ui.git cd admin-ui
-
Install dependencies:
npm install # or yarn
-
Create a
.env
file in the root directory based on the.env.example
file:cp .env.example .env
-
Update the environment variables in the
.env
file as needed:VITE_API_URL=http://localhost:4000 VITE_WS_URL=ws://localhost:4000
-
Start the development server:
npm run dev # or yarn dev
-
Open your browser and navigate to http://localhost:3030
In the project directory, you can run:
npm run dev
- Runs the app in development mode on http://localhost:3030npm run build
- Builds the app for production to thedist
foldernpm run preview
- Previews the production build locallynpm run lint
- Lints the codebase for potential errorsnpm run prod
- Builds and previews the production app
src/
├── assets/ # Static assets like images
├── components/ # Reusable UI components
├── context/ # React Context providers
├── hooks/ # Custom React hooks
├── pages/ # Application pages
├── theme/ # Theme configuration
├── types/ # TypeScript type definitions
├── utils/ # Utility functions
├── App.tsx # Main app component
└── main.tsx # Application entry point
API documentation is available within the application through the Documentation page. It includes:
- Authentication instructions
- Available endpoints
- Request/response formats
- Rate limiting information
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request