feat: initial IQAI multi-model AI dashboard
- Express backend with Replicate API proxy (chat, models, account, search) - React + Vite + Tailwind frontend with custom Midnight Violet color scheme - @mention autocomplete to route messages to specific models - Parallel multi-model queries with model selection in sidebar - DuckDuckGo web search context injection - Model manager UI (add/edit/remove Replicate models) - Per-model system instructions per conversation - Replicate account info display in sidebar - Conversation history with local persistence (Zustand) - Full Docker deployment (backend + nginx-served frontend) - Montserrat + Poppins fonts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
39
backend/server.js
Normal file
39
backend/server.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import express from 'express';
|
||||
import cors from 'cors';
|
||||
import { readFile } from 'fs/promises';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname, join } from 'path';
|
||||
import dotenv from 'dotenv';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
// Lazy import routes after dotenv loaded
|
||||
const { chatRouter } = await import('./routes/chat.js');
|
||||
const { modelsRouter } = await import('./routes/models.js');
|
||||
const { accountRouter } = await import('./routes/account.js');
|
||||
const { searchRouter } = await import('./routes/search.js');
|
||||
|
||||
const app = express();
|
||||
const PORT = process.env.PORT || 3001;
|
||||
const FRONTEND_URL = process.env.FRONTEND_URL || 'http://localhost:5173';
|
||||
|
||||
app.use(cors({
|
||||
origin: [FRONTEND_URL, 'http://localhost:80', 'http://localhost'],
|
||||
credentials: true
|
||||
}));
|
||||
app.use(express.json({ limit: '10mb' }));
|
||||
|
||||
app.use('/api/chat', chatRouter);
|
||||
app.use('/api/models', modelsRouter);
|
||||
app.use('/api/account', accountRouter);
|
||||
app.use('/api/search', searchRouter);
|
||||
|
||||
// Health check
|
||||
app.get('/api/health', (req, res) => res.json({ status: 'ok', timestamp: new Date().toISOString() }));
|
||||
|
||||
app.listen(PORT, '0.0.0.0', () => {
|
||||
console.log(`IQAI Backend running on http://0.0.0.0:${PORT}`);
|
||||
console.log(`API Token: ${process.env.REPLICATE_API_TOKEN ? '✓ configured' : '✗ NOT SET'}`);
|
||||
});
|
||||
Reference in New Issue
Block a user