A state-of-the-art, real-time AI-powered search and Q&A engine designed to cut through the noise of the web and deliver clean, structured, and factual answers.
🌐 Live URL: https://paxai.onrender.com
Pax AI combines semantic web search with advanced language models to offer a smooth, peaceful, and lightning-fast knowledge discovery experience.
- Retrieval-Augmented Generation (RAG): Leverages Tavily Search API to fetch real-time web results and synthesizes them into coherent, cited answers.
- Dual-Model Intelligence: Integrated with Google Gemini (genai) and Mistral AI via LangChain for high-quality reasoning and generation.
- Voice Responses: Powered by ElevenLabs to convert text responses into high-fidelity, natural-sounding audio.
- Real-time Streaming: Utilizes Socket.io for real-time streaming of tokens and instant updates.
- Media Support: Integrated with ImageKit for storing and processing chat attachments.
- Secure Authentication: Features cookie-based authentication using JSON Web Tokens (JWT), input validation with Zod / Express Validator, and email verification via Brevo.
- Framework: React 19 + Vite
- Styling: Tailwind CSS v4 (Modern & responsive dark-mode UI)
- State Management: Redux Toolkit & React Redux
- Routing: React Router v8
- Real-time Connections: Socket.io Client
- Runtime: Node.js & Express
- Database: MongoDB (via Mongoose)
- AI & Search Orchestration: LangChain, Tavily API, Google GenAI SDK, Mistral AI SDK
- Email Platform: Brevo SMTP Service
- Image Hosting: ImageKit SDK
Pax-AI/
├── Backend/ # Node.js & Express Server
│ ├── src/
│ │ ├── controllers/ # Authentication & Chat Controllers
│ │ ├── services/ # AI, Search, Email, & Upload Services
│ │ ├── utils/ # Verification Email Templates & Helpers
│ │ └── models/ # MongoDB Mongoose Schema definitions
│ ├── server.js # Server Entry Point
│ └── package.json
└── Frontend/ # React 19 client
├── src/
│ ├── Features/ # Modules (Auth, Chat Dashboard, Sidebar)
│ └── app/ # App setup (Redux store, routes)
├── index.html # SPA HTML template
└── package.json
Before running the application, you need to configure the environment variables for both development and production.
Create a .env file inside the Backend/ directory:
# Server Configuration
PORT=5000
NODE_ENV=development
# Frontend Client URL
CLIENT_URL=http://localhost:5173
# Database Connection
MONGODB_URI=mongodb://localhost:27017/pax-ai
# Security & Tokens
JWT_SECRET=your_super_secret_jwt_key
# Gemini & Mistral APIs
GEMINI_API_KEY=your_gemini_api_key
MISTRAL_API_KEY=your_mistral_api_key
# Search API
TAVILY_API_KEY=your_tavily_api_key
# Voice API
ELEVENLABS_API_KEY=your_elevenlabs_api_key
# Email Verification (Brevo)
BREVO_API_KEY=your_brevo_api_key
BREVO_USER=your_verified_brevo_sender_email
# Image Uploads (ImageKit)
IMAGEKIT_PRIVATE_KEY=your_imagekit_private_keyFor deployment on Render, configure the following environment variables in your Render Web Service settings:
| Variable | Description | Value / Format |
|---|---|---|
NODE_ENV |
Mode of the Node environment | production |
CLIENT_URL |
Live origin of the frontend client | https://paxai.onrender.com |
MONGODB_URI |
Production database connection string | mongodb+srv://<user>:<password>@cluster.mongodb.net/pax-ai (MongoDB Atlas) |
JWT_SECRET |
Secure key for signing JWTs | [Use a strong random secret key] |
GEMINI_API_KEY |
Google Gemini API Key | [Your API Key] |
MISTRAL_API_KEY |
Mistral AI API Key | [Your API Key] |
TAVILY_API_KEY |
Tavily Search API Key | [Your API Key] |
ELEVENLABS_API_KEY |
ElevenLabs Text-to-Speech API Key | [Your API Key] |
BREVO_API_KEY |
Brevo SMTP Service API Key | [Your API Key] |
BREVO_USER |
Verified Brevo sender email address | [Your sender email] |
IMAGEKIT_PRIVATE_KEY |
ImageKit private key for secure uploads | [Your private key] |
Note
By default, frontend API and Socket.io requests are dynamically routed based on the current origin (window.location.origin). No frontend-specific environment variables need to be set in production when hosted together.
- Node.js (v18 or higher)
- MongoDB running locally or in the cloud
-
Clone the repository and navigate to the project directory.
-
Start the Backend Server:
cd Backend npm install npm run devThe server will start on
http://localhost:5000. -
Start the Frontend App:
cd ../Frontend npm install npm run devThe application will be accessible at
http://localhost:5173.
This project is configured as a monorepo setup where the Express backend serves the React frontend assets statically from the Backend/public directory.
Follow these steps to deploy this project to Render:
- Create a new Web Service: Link it to your repository.
- Environment: Select
Nodeas the runtime. - Build Command: Set this command to install dependencies, build the frontend, and copy the assets to the backend's public directory:
# Install & build Frontend npm install --prefix Frontend && npm run build --prefix Frontend # Copy built Frontend bundle to Backend's public folder mkdir -p Backend/public cp -r Frontend/dist/* Backend/public/ # Install Backend dependencies npm install --prefix Backend
- Start Command: Run the Express server:
npm start --prefix Backend
- Environment Variables: Add all the production environment variables listed in the production setup table above.
- Passwords are encrypted using
bcryptjs. - All inputs are schema-validated using
Zodandexpress-validatorto prevent SQL/NoSQL injection and cross-site scripting (XSS). - Cookies are stored with
httpOnly,secure, andsameSite: strictsettings to safeguard against cross-site request forgery (CSRF) and session hijacking.