redThread / README.md
3v324v23's picture
Fix HF connect error: explicitly set app_port and relax helmet security for iframes
255ad41
---
title: RedThread
emoji: πŸ•ΈοΈ
colorFrom: red
colorTo: purple
sdk: docker
app_port: 7860
pinned: false
---
# RedThread
**AI-assisted location-based recommendation platform** that combines intelligent intent parsing, safety validation, and structured data extraction.
## Architecture
```
ultimate_spider/
β”œβ”€β”€ client/ # React + Vite frontend
β”‚ └── src/
β”‚ β”œβ”€β”€ api/ # Backend communication layer
β”‚ β”œβ”€β”€ components/ # Reusable UI components
β”‚ β”œβ”€β”€ pages/ # Page-level compositions
β”‚ └── styles/ # Design system
└── server/ # Node.js + Express backend
└── src/
β”œβ”€β”€ config/ # Environment-driven configuration
β”œβ”€β”€ controllers/ # Request orchestration (thin)
β”œβ”€β”€ middleware/ # Rate limiting, safety guard, error handler
β”œβ”€β”€ routes/ # HTTP route definitions
β”œβ”€β”€ services/ # Business logic (AI, safety, scraper)
β”œβ”€β”€ utils/ # Logger, custom errors
└── validators/ # Request body validation
```
## Quick Start
```bash
# Backend
cd server
npm install
cp .env.example .env # Add your GROQ_API_KEY
npm run dev
# Frontend (new terminal)
cd client
npm install
npm run dev
```
- **Frontend**: http://localhost:5173
- **Backend**: http://localhost:3001
- **Health**: http://localhost:3001/api/health
## Tech Stack
| Layer | Tech |
|-------|------|
| Frontend | React 19, Vite |
| Backend | Express 4, Node.js |
| AI | Groq API (Llama 3.3 70B) |
| Security | Helmet, CORS, Rate Limiting, Safety Middleware |
## Environment Variables
| Variable | Description |
|----------|-------------|
| `PORT` | Server port (default: 3001) |
| `NODE_ENV` | Environment (development/production) |
| `GROQ_API_KEY` | Groq API key for AI intent parsing |