3.8 KiB
3.8 KiB
Token Aggregation Service - Control Panel & Proxmox Deployment
✅ Complete Implementation
The Token Aggregation Service now includes a full-featured Control Panel and Proxmox deployment capabilities.
Features
Control Panel UI
- Dashboard: Real-time service statistics
- API Key Management: Add/edit/delete external API keys
- Endpoint Management: Configure RPC and API endpoints
- DEX Factory Management: Manage DEX factory addresses
- Authentication: Secure login with role-based access
Admin API
- JWT authentication
- Role-based access control
- API key encryption
- Endpoint health checks
- Audit logging
Proxmox Deployment
- Automated LXC container creation
- Service installation
- Frontend build and nginx setup
- Systemd service configuration
Quick Start
1. Database Setup
# Run migrations
psql $DATABASE_URL -f explorer-monorepo/backend/database/migrations/0011_token_aggregation_schema.up.sql
psql $DATABASE_URL -f explorer-monorepo/backend/database/migrations/0012_admin_config_schema.up.sql
2. Deploy to Proxmox
cd smom-dbis-138/services/token-aggregation
./scripts/deploy-to-proxmox.sh
3. Create Admin User
./scripts/create-admin-user.sh
4. Access Control Panel
Navigate to http://<container-ip> and login.
File Structure
token-aggregation/
├── src/ # Backend (22 TypeScript files)
│ ├── api/
│ │ ├── routes/
│ │ │ ├── tokens.ts # Public API
│ │ │ └── admin.ts # Admin API
│ │ └── middleware/ # Auth, cache, rate-limit
│ ├── database/
│ │ └── repositories/
│ │ └── admin-repo.ts
│ └── indexer/ # All indexers
├── frontend/ # Control Panel (12 files)
│ ├── src/
│ │ ├── pages/ # 5 pages (Dashboard, Login, ApiKeys, Endpoints, DexFactories)
│ │ ├── components/ # Layout, ProtectedRoute
│ │ ├── services/ # API client
│ │ └── stores/ # Auth store
│ └── Dockerfile # Frontend container
├── scripts/
│ ├── deploy-to-proxmox.sh
│ └── create-admin-user.sh
└── docker-compose.full.yml # Full stack
API Endpoints
Public API
GET /api/v1/chainsGET /api/v1/tokensGET /api/v1/tokens/:addressGET /api/v1/tokens/:address/poolsGET /api/v1/tokens/:address/ohlcvGET /api/v1/tokens/:address/signalsGET /api/v1/searchGET /api/v1/pools/:poolAddress
Admin API (requires auth)
POST /api/v1/admin/auth/loginGET /api/v1/admin/api-keysPOST /api/v1/admin/api-keysPUT /api/v1/admin/api-keys/:idDELETE /api/v1/admin/api-keys/:idGET /api/v1/admin/endpointsPOST /api/v1/admin/endpointsPUT /api/v1/admin/endpoints/:idGET /api/v1/admin/dex-factoriesPOST /api/v1/admin/dex-factoriesGET /api/v1/admin/statusGET /api/v1/admin/audit-log
Configuration via Control Panel
Adding API Keys
- Login to control panel
- Navigate to "API Keys"
- Click "Add API Key"
- Select provider, enter key name and API key
- Save
Adding Endpoints
- Navigate to "Endpoints"
- Click "Add Endpoint"
- Select chain, type, enter name and URL
- Optionally set as primary
- Save
Adding DEX Factories
- Navigate to "DEX Factories"
- Click "Add Factory"
- Select chain and DEX type
- Enter factory address
- Enter router/pool manager if applicable
- Save
Status
Implementation: ✅ 100% Complete
- Backend: ✅ Complete
- Frontend: ✅ Complete (5 pages, all components)
- Database: ✅ Complete (2 migrations)
- Deployment: ✅ Complete (Proxmox script ready)
Ready for: Production deployment to Proxmox VM