Clarticle is a RAG (Retrieval-Augmented Generation) chat system that enables intelligent conversations about your article collection using Claude AI.
Clarticle uses a hybrid microservices architecture combining Go and Node.js for optimal performance:
%%{init: {'flowchart': {'htmlLabels': false}, 'securityLevel': 'loose'}}%%
graph TD
subgraph "Clarticle Frontend"
A[React Client]
end
A <--> |HTTP/API| B
subgraph "Clarticle Backend Services"
B[Go API Gateway]
B <--> |HTTP| C
B --> |Cache| D[Redis Cache]
C[Node.js RAG Service]
C <--> |Embeddings| E[FAISS Vector Store]
C <--> |API| F[Claude AI API]
C --> |Fetch & Process| G[Web Articles]
end
subgraph "Data Layer"
E --> H[Local Vector Storage]
I[articles.json]
J[PostgreSQL Database]
end
I --> |Load on Startup| C
B <--> |SQL| J
style A fill:#61dafb,stroke:#21262d,stroke-width:2px,color:#000
style B fill:#0969da,stroke:#21262d,stroke-width:2px,color:#fff
style C fill:#2ea043,stroke:#21262d,stroke-width:2px,color:#fff
style D fill:#cf222e,stroke:#21262d,stroke-width:2px,color:#fff
style J fill:#336791,stroke:#21262d,stroke-width:2px,color:#fff
style F fill:#fb8500,stroke:#21262d,stroke-width:2px,color:#000
style G fill:#6e7781,stroke:#21262d,stroke-width:2px,color:#fff
style I fill:#6e7781,stroke:#21262d,stroke-width:2px,color:#fff
Article-Chat/
โโโ client/ # React frontend application
โ โโโ src/
โ โ โโโ components/ # React components
โ โ โ โโโ ui/ # shadcn/ui components
โ โ โ โโโ ChatInterface.tsx
โ โ โ โโโ ArticleManager.tsx
โ โ โ โโโ Footer.tsx
โ โ โ โโโ theme-provider.tsx
โ โ โ โโโ theme-toggle.tsx
โ โ โโโ lib/ # Utilities and API client
โ โ โ โโโ api.ts
โ โ โ โโโ utils.ts
โ โ โโโ App.tsx # Main app component
โ โ โโโ main.tsx # Entry point
โ โ โโโ index.css # Global styles
โ โโโ package.json
โ โโโ vite.config.ts # Vite configuration
โ โโโ tailwind.config.js # Tailwind CSS config
โ โโโ README.md # Frontend documentation
โ
โโโ server/ # Go backend (API Gateway)
โ โโโ cmd/
โ โ โโโ api/
โ โ โโโ main.go # Entry point
โ โโโ internal/ # Private packages
โ โ โโโ config/ # Configuration management
โ โ โโโ handlers/ # HTTP handlers
โ โ โโโ middleware/ # HTTP middleware
โ โ โโโ models/ # Data models
โ โ โโโ services/ # Business logic
โ โ โ โโโ rag_client.go # RAG service client
โ โ โ โโโ cache.go # Redis cache service
โ โ โโโ validation/ # Input validation
โ โ โโโ errors/ # Error handling
โ โ โโโ workers/ # Worker pools
โ โโโ go.mod
โ โโโ go.sum
โ โโโ README.md # Backend documentation
โ
โโโ rag-service/ # Node.js RAG service
โ โโโ src/
โ โ โโโ services/ # Core services
โ โ โ โโโ claude.service.ts
โ โ โ โโโ embeddings.service.ts
โ โ โ โโโ faiss-vectorstore.service.ts
โ โ โ โโโ langchain.service.ts
โ โ โโโ routes/ # API routes
โ โ โ โโโ chat.routes.ts
โ โ โ โโโ articles.routes.ts
โ โ โโโ middleware/ # Express middleware
โ โ โโโ utils/ # Utilities
โ โ โ โโโ errors.ts
โ โ โ โโโ startup-loader.ts
โ โ โโโ index.ts # Entry point
โ โโโ package.json
โ โโโ tsconfig.json
โ โโโ nodemon.json # Nodemon config
โ โโโ README.md # RAG service documentation
โ
โโโ data/ # Data directory
โ โโโ articles.json # Initial articles list
โ โโโ faiss_store/ # Vector store (generated)
โ
โโโ docker-compose.yml # Docker orchestration
โโโ client.Dockerfile # Frontend container
โโโ server.Dockerfile # Backend container
โโโ rag-service.Dockerfile # RAG service container
โโโ nginx.conf # Nginx configuration for frontend
โโโ README.md # This file
โโโ INSTALL.md # Installation guide
- React 19 with TypeScript
- Vite for build tooling
- shadcn/ui component library
- Tailwind CSS v4 for styling
- Go 1.24+ with Fiber framework
- PostgreSQL 15 for user authentication and data persistence
- Worker pools for concurrent request handling
- Redis for response caching
- Structured logging with slog
- Node.js 20+ with Express
- LangChain.js for RAG pipeline
- Claude AI (Anthropic) for language model
- FAISS for local vector storage
- HuggingFace Transformers for embeddings
- Docker & Docker Compose for containerization
- Multi-stage builds for optimized images
- PostgreSQL Alpine for lightweight database container
- User Authentication: Secure user registration, login, and session management
- Intelligent Chat: Ask questions about your articles and get contextual answers
- Conversation History: Persistent chat history with conversation management
- Article Management: Add articles via URL for processing
- Local Embeddings: Free embeddings using HuggingFace models
- Response Caching: Lightning-fast repeated queries with Redis
- Professional UI: Claude/ChatGPT-style interface with animations
- Error Handling: Comprehensive error handling with detailed error codes
- Concurrent Processing: Handle multiple users simultaneously
For detailed installation instructions, see INSTALL.md.
# Clone repository
git clone https://github.com/Danor93/Clarticle.git
cd Clarticle
# Setup environment
cp server/.env.example server/.env
cp rag-service/.env.example rag-service/.env
cp client/.env.example client/.env
# Add your Anthropic API key to rag-service/.env
# ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
# Start services
docker-compose up --build
# Access application
open http://localhost:3000- Docker Desktop
- Anthropic Claude API key
- 4GB+ RAM recommended
- Modern web browser
- Article Processing: Add articles via URL โ Text extraction โ Chunking โ Embedding generation โ Vector storage
- Chat Flow: User question โ Vector search โ Relevant context retrieval โ Claude AI generation โ Response
- Caching: Repeated questions are cached for instant responses
Key environment variables:
ANTHROPIC_API_KEY: Your Claude API key (required)CLAUDE_MODEL: Model selection (default: claude-3-7-sonnet-latest)CHUNK_SIZE: Text chunk size for embeddings (default: 1000)RAG_SEARCH_RESULTS: Number of context chunks to retrieve (default: 4)
- Response Time: 5-8 seconds (first query), <100ms (cached)
- Concurrent Users: 10-50 supported
- Article Processing: 6-8 chunks per article
- Cache Hit Rate: ~40% in typical usage
Potential features for extended development:
- Streaming Responses: Real-time response streaming
- Advanced Analytics: User engagement metrics and conversation analytics
- Multi-tenant Support: Organization and team management
- Testing Suite: Unit and integration tests
- K8s Deployment: Kubernetes manifests and CI/CD pipelines