We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/chakradharkalle03-arch/MCP2'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
# π Node.js Frontend - Complete Guide
## β¨ Node.js Frontend Created!
A beautiful Node.js/Express frontend has been created that connects to your FastAPI backend!
## π Architecture
```
Browser (Port 3000)
β
Node.js/Express Frontend
β
FastAPI Backend (Port 8001)
β
ChromaDB + RAG Pipeline
```
## π Quick Start
### 1. Install Dependencies
```bash
cd frontend
npm install
```
### 2. Start Frontend Server
```bash
npm start
```
Or for development with auto-reload:
```bash
npm run dev
```
### 3. Make Sure Backend is Running
In another terminal:
```bash
cd .. # Go back to project root
python main.py
```
### 4. Access the UI
**Open in your browser:**
```
http://localhost:3000
```
## π¨ Features
### Frontend Features
- β
**Node.js/Express Server** - Proxy to backend
- β
**Beautiful UI** - Modern dark theme design
- β
**File Upload** - Drag & drop Excel files
- β
**Question Answering** - Interactive Q&A interface
- β
**Real-time Status** - Connection indicators
- β
**Toast Notifications** - User feedback
- β
**Responsive Design** - Works on all devices
### Backend Integration
- β
**Health Check** - Proxies `/api/health` to backend
- β
**Collection Info** - Proxies `/api/info` to backend
- β
**File Upload** - Proxies `/api/upload` to backend
- β
**Question Answering** - Proxies `/api/ask` to backend
## π Project Structure
```
frontend/
βββ server.js # Express server (proxy)
βββ package.json # Node.js dependencies
βββ .env # Configuration
βββ README.md # Frontend documentation
βββ .gitignore # Git ignore rules
βββ public/ # Static files
β βββ index.html # Main UI page
β βββ styles.css # Beautiful styling
β βββ script.js # Frontend logic
βββ uploads/ # Temporary uploads (auto-cleaned)
```
## π§ Configuration
Edit `frontend/.env`:
```env
PORT=3000
BACKEND_URL=http://localhost:8001
```
## π― Usage
### Start Both Servers
**Terminal 1 (Backend):**
```bash
cd C:\Users\user\Downloads\MCP2
.\venv\Scripts\python.exe main.py
```
**Terminal 2 (Frontend):**
```bash
cd C:\Users\user\Downloads\MCP2\frontend
npm start
```
### Access the UI
1. **Open browser**: http://localhost:3000
2. **Upload file**: Drag & drop Excel file
3. **Ask questions**: Type question or click quick buttons
4. **View answers**: See formatted answers with context
## π API Endpoints
The frontend proxies these to the backend:
| Frontend Endpoint | Backend Endpoint | Method | Description |
|-------------------|------------------|--------|-------------|
| `/api/health` | `/health` | GET | Health check |
| `/api/info` | `/info` | GET | Collection info |
| `/api/upload` | `/upload` | POST | Upload Excel |
| `/api/ask` | `/ask` | POST | Ask questions |
## π¨ UI Features
- **Drag & Drop Upload** - Easy file upload
- **Quick Question Buttons** - Pre-defined questions
- **Formatted Answers** - Clean answer display
- **Context Visualization** - Retrieved context shown
- **Copy to Clipboard** - Easy answer copying
- **Status Indicators** - Connection status
- **Toast Notifications** - User feedback
- **Loading Overlays** - Visual feedback
## π‘ Example Usage
1. **Open**: http://localhost:3000
2. **Upload**: Drag `examples/semiconductor_components.xlsx` to upload area
3. **Ask**: Click "MOSFET" quick button or type your question
4. **View**: See formatted answer with context
5. **Copy**: Click copy button to copy answer
## π§ Development
```bash
# Install dependencies
cd frontend
npm install
# Start with auto-reload (requires nodemon)
npm run dev
# Start production
npm start
```
## π Dependencies
- **express**: Web server
- **axios**: HTTP client for backend communication
- **multer**: File upload handling
- **cors**: CORS middleware
- **dotenv**: Environment variables
- **nodemon** (dev): Auto-reload for development
## β
Status
**Frontend**: Node.js/Express server
**Backend**: FastAPI server on port 8001
**UI**: Beautiful modern interface
**Integration**: Fully connected
## π Ready!
**Start frontend**: `cd frontend && npm start`
**Access UI**: http://localhost:3000
**Make sure backend is running**: `python main.py`
**Enjoy the beautiful Node.js frontend!** π