Next.js frontend for the AI Document Manager. Upload documents, get AI-powered summaries and classifications, and chat with your documents using RAG (Retrieval Augmented Generation).
- Next.js 16 - App Router with React Server Components
- React 19 - Latest React with compiler optimizations
- Tailwind CSS 4 - Utility-first styling
- shadcn/ui - Radix-based component library
- Axios - HTTP client for API calls
- TypeScript - Type safety
- Document Upload - Drag & drop zone with file validation (PDF, TXT)
- Document Management - List, view status, delete documents
- AI Processing - Automatic summarization and classification via Logos RAG service
- Chat with Documents - Ask questions about your documents with streaming responses
- Dual Chat Views - Simple (ChatGPT-style) and Split (document + chat side-by-side)
Lumen (Frontend) → Atlas (NestJS Backend) → Logos (Python RAG Engine)
- Lumen: User interface, document management, chat UI
- Atlas: Authentication, document metadata, API gateway to Logos
- Logos: Document parsing, chunking, embeddings, vector search, LLM calls
app/
├── documents/
│ └── page.tsx # Document list + upload page
├── chat/
│ └── [documentId]/
│ └── page.tsx # Chat with document page
├── layout.tsx # Root layout with providers
├── page.tsx # Redirect to /documents
└── globals.css # Tailwind styles
components/
├── ui/ # shadcn/ui components
├── documents/
│ ├── upload-zone.tsx # Drag & drop upload
│ └── document-card.tsx # Document list item
└── chat/
├── message.tsx # Chat message bubble
├── chat-simple.tsx # Simple chat view
└── chat-split.tsx # Split view (doc + chat)
contexts/
└── auth-context.tsx # Auth state management
lib/
├── api.ts # Axios client + API functions
└── utils.ts # Utility functions
types/
└── index.ts # TypeScript types
- Node.js 18+
- Atlas backend running on
http://localhost:3000 - Logos RAG service running on
http://localhost:8000
# Install dependencies
npm install
# Create environment file
cp .env.example .env.localCreate .env.local:
NEXT_PUBLIC_API_URL=http://localhost:3000npm run devVisit http://localhost:3000 (Note: Next.js defaults to port 3000, you may need to use 3001 if Atlas is running)
# Terminal 1: Logos (RAG Engine)
cd ~/Documents/projects/logos
docker compose up -d
# Terminal 2: Atlas (Backend)
cd ~/Documents/projects/atlas
npm run start:dev
# Terminal 3: Lumen (Frontend)
cd ~/Documents/projects/lumen
npm run dev -- -p 3001 # Use port 3001 to avoid conflict with Atlas| Endpoint | Method | Description |
|---|---|---|
/documents/upload |
POST | Upload a document |
/documents |
GET | List user's documents |
/documents/:id |
GET | Get document details |
/documents/:id/status |
GET | Get processing status |
/documents/:id |
DELETE | Delete a document |
/chat |
POST | Chat with document (SSE stream) |
Currently using localStorage for JWT token storage. Set the token manually for testing:
localStorage.setItem('access_token', 'your-jwt-token-here');To get a token, register/login via Atlas API:
# Register
curl -X POST http://localhost:3000/auth/register \
-H "Content-Type: application/json" \
-d '{"email": "test@example.com", "password": "password123", "name": "Test User"}'
# Login
curl -X POST http://localhost:3000/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "test@example.com", "password": "password123"}'npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint