🤖 Chatbot Creation Framework
A comprehensive platform for creating and managing multimodal RAG (Retrieval-Augmented Generation) chatbots with document processing capabilities, integrated with n8n workflows.
🚀 Quick Start
Prerequisites
- Node.js 18+
- Docker Desktop
- Git
1. Setup
# Install dependencies
npm install
# Copy environment file and configure
cp .env.example .env.local
# Edit .env.local with your settings
2. Start Infrastructure
# Start all services
docker-compose up -d
# Set up database
npm run test:setup
3. Run Application
# Start development server
npm run dev
Visit http://localhost:3000 to see your application!
📋 Testing Your Setup
Follow our comprehensive Testing Guide to verify everything is working correctly.
Quick Health Check
# Test all services
npm run db:test
docker-compose ps
curl http://localhost:3000
🏗 Architecture
This framework consists of:
- Frontend/Backend: Next.js 14 with TypeScript
- Database: PostgreSQL with pgvector for vector operations
- Storage: MinIO (S3-compatible) for file storage
- Cache: Redis for sessions and performance
- Processing: n8n workflow integration
- Containerization: Docker & Docker Compose
📚 Documentation
- System Architecture - Complete system design
- Technical Specifications - Detailed requirements and flows
- API Documentation - OpenAPI specification
- Deployment Guide - Production deployment
- Project Roadmap - Implementation plan
🔧 Development Commands
# Database
npm run db:generate # Generate Prisma client
npm run db:push # Push schema to database
npm run db:migrate # Run migrations
npm run db:studio # Open Prisma Studio
npm run db:test # Test database connection
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run type-check # TypeScript checking
# Docker
npm run docker:dev # Start development environment
npm run docker:prod # Start production environment
npm run docker:down # Stop all containers
npm run docker:logs # View logs
🌐 Service Endpoints
| Service | URL | Description |
|---|---|---|
| Application | http://localhost:3000 | Main web application |
| MinIO Console | http://localhost:9001 | S3 storage management |
| Prisma Studio | http://localhost:5555 | Database administration |
| PostgreSQL | localhost:5432 | Database connection |
| Redis | localhost:6379 | Cache connection |
🏃♂️ Current Status
✅ Completed (Phase 1: Foundation)
- System architecture and database design
- Next.js 14 application structure with TypeScript
- Docker environment with PostgreSQL, MinIO, Redis
- Prisma database models and schema
- Tailwind CSS design system
- Project documentation and API specifications
🚧 In Progress (Phase 2: Core Features)
- User authentication with NextAuth.js
- Project management dashboard
- File upload system
- Document processing integration
📅 Planned (Phase 3+)
- Real-time chat interface
- n8n workflow integration
- Vector search and RAG
- Production deployment automation
🛠 Features
🔐 Multi-tenant Architecture
Each chatbot project gets:
- Isolated PostgreSQL database
- Dedicated MinIO storage bucket
- Separate processing workflows
📄 Multimodal Document Processing
- Support for PDF, Markdown, DOCX
- Automatic image extraction and storage
- Text processing and embeddings generation
💬 Real-time Chat System
- WebSocket-based messaging
- Conversation history
- Context-aware responses using RAG
🔄 n8n Integration
- Automated document processing workflows
- Status tracking and error handling
- Webhook-based status updates
🔒 Environment Variables
Key environment variables (see .env.example):
# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/db
# Authentication
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key
# Storage
MINIO_ACCESS_KEY=access-key
MINIO_SECRET_KEY=secret-key
# n8n Integration
N8N_BASE_URL=http://n8n-instance.com
N8N_API_KEY=your-n8n-api-key
🚀 Deployment
Development
docker-compose up -d
npm run dev
Production
docker-compose -f docker-compose.yml up -d
For detailed deployment instructions, see Deployment Guide.
📊 Monitoring
Health Checks
- Application:
GET /api/health - Database:
GET /api/health/database - Storage:
GET /api/health/storage
Logs
# Application logs
docker-compose logs -f app
# Service logs
docker-compose logs -f postgres redis minio
🤝 Contributing
- Follow the Project Roadmap
- Use the established patterns in the codebase
- Run tests before submitting changes
- Update documentation as needed
📝 License
This project is licensed under the MIT License.
🆘 Need Help?
- Check the Testing Guide for common issues
- Review service logs:
docker-compose logs [service] - Verify environment configuration in
.env.local - Ensure all prerequisites are installed
Ready to build amazing chatbots? Start with our Testing Guide to verify your setup! 🎉