A full-stack news intelligence application that fetches news articles from RSS feeds, stores them in a vector database, and provides an AI-powered chat interface to query and retrieve relevant news information using semantic search and Google Gemini AI.
This project consists of two main components:
- chat-bot - Backend API server built with Bun, Express, and TypeScript
- chat-client - Frontend web application built with Next.js and React
- News Ingestion: RSS feeds are periodically fetched (every 55 minutes) using Inngest scheduled jobs
- Vector Storage: News articles are processed, chunked, and stored as embeddings in Qdrant vector database
- Semantic Search: User queries are converted to embeddings and used to find relevant articles
- AI Responses: Google Gemini AI generates contextual answers based on retrieved articles
- Runtime: Bun - Fast JavaScript runtime
- Framework: Express.js
- Database: PostgreSQL with Prisma ORM
- Vector Database: Qdrant
- AI: Google Gemini 2.0 Flash
- Task Scheduling: Inngest
- Other: RSS Parser, Axios, CORS, Helmet, Morgan
- Framework: Next.js 16
- UI: React 19, Tailwind CSS
- Language: TypeScript
.
├── chat-bot/ # Backend API server
│ ├── src/
│ │ ├── config/ # Configuration files (Qdrant, news URLs)
│ │ ├── controllers/ # Route controllers
│ │ ├── services/ # Business logic (chat, embedding, retrieval, etc.)
│ │ ├── route/ # API routes
│ │ ├── types/ # TypeScript types
│ │ ├── utils/ # Utility functions
│ │ ├── inngest/ # Inngest scheduled functions
│ │ ├── app.ts # Express app setup
│ │ └── server.ts # Server entry point
│ ├── prisma/ # Database schema and migrations
│ ├── docker-compose.yml # Docker services configuration
│ └── package.json
│
└── chat-client/ # Frontend web application
├── app/ # Next.js app directory
├── public/ # Static assets
└── package.json
- Bun installed (v1.3.1+)
- Node.js installed (for frontend)
- PostgreSQL database
- Qdrant vector database (can be run via Docker)
- Google Gemini API key
- Navigate to the backend directory:
cd chat-bot- Install dependencies:
bun install- Set up environment variables:
cp .env.example .envEdit .env and configure:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/news_intelligence"
# Qdrant
QDRANT_URL="http://localhost:6333"
QDRANT_COLLECTION="news_vectors"
# Google Gemini
GEMINI_API_KEY="your-gemini-api-key"
# Server
PORT=5000
# Inngest (if using cloud)
INNGEST_EVENT_KEY="your-inngest-event-key"
INNGEST_SIGNING_KEY="your-inngest-signing-key"- Set up the database:
bunx prisma migrate dev
bunx prisma generate- Start Qdrant (if using Docker):
docker-compose -f qdrant.docker-compose.yml up -d- Run the backend server:
# Development mode (with watch)
bun run dev
# Production mode
bun run startThe API server will run on http://localhost:5000
- Navigate to the frontend directory:
cd chat-client- Install dependencies:
npm install
# or
bun install- Run the development server:
npm run dev
# or
bun devThe frontend will run on http://localhost:3000
You can also run the entire stack using Docker:
cd chat-bot
docker-compose up -dSend a query to get AI-generated answers based on news articles.
Request:
{
"query": "What are the latest developments in technology?"
}Response:
{
"answer": "Based on the latest news articles...",
"responseTimeMs": 1234
}The application uses Inngest to run scheduled tasks:
- News Fetching: Runs every 55 minutes
- Fetches news from RSS feeds (currently BBC News)
- Processes and chunks articles
- Generates embeddings
- Stores in Qdrant vector database
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | Yes |
QDRANT_URL |
Qdrant server URL | Yes |
QDRANT_COLLECTION |
Vector collection name | Yes |
GEMINI_API_KEY |
Google Gemini API key | Yes |
PORT |
Server port | No (default: 5000) |
INNGEST_EVENT_KEY |
Inngest event key | Optional |
INNGEST_SIGNING_KEY |
Inngest signing key | Optional |
Stores chat interactions and responses:
id: Unique identifiersessionId: User session identifieruserQuery: User's questionllmResponse: AI-generated responseresponseTimeMs: Response time in millisecondscreatedAt: Timestamp
- ✅ RSS feed parsing and ingestion
- ✅ Semantic search using vector embeddings
- ✅ AI-powered question answering with Google Gemini
- ✅ Scheduled news updates via Inngest
- ✅ RESTful API for chat interactions
- ✅ Modern Next.js frontend
- ✅ PostgreSQL for data persistence
- ✅ Qdrant for vector similarity search
Backend:
cd chat-bot
bun run dev # Runs with watch modeFrontend:
cd chat-client
npm run dev # Runs Next.js dev servercd chat-bot
bunx prisma migrate dev # Create a new migration
bunx prisma generate # Generate Prisma Client
bunx prisma studio # Open Prisma Studio GUIThis project is private.
This is a private project. For contributions, please contact the repository owner.
Built with ❤️ using Bun, Next.js, and Google Gemini AI