An AI-powered chat application for intelligent conversations and knowledge discovery.
Clarity is a modern web application that combines conversational AI with powerful search capabilities. It enables users to engage in threaded conversations with AI assistants, perform intelligent searches, and save favorite responses for quick access. The application solves the problem of fragmented AI interactions by providing a unified platform for knowledge discovery and conversation management, targeted at developers, researchers, and knowledge workers.
- User Authentication: Secure login, registration, email verification, and password reset
- Threaded Conversations: Organize AI interactions into persistent conversation threads
- AI-Powered Search: Real-time streaming search responses using Google Generative AI
- Favorites System: Save and manage favorite prompts and responses
- Responsive UI: Modern React interface with dark/light theme support
- Real-time Streaming: Live response streaming for enhanced user experience
clarity/
├── client/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Route components
│ │ ├── services/ # API service functions
│ │ └── context/ # React context providers
│ ├── public/ # Static assets
│ └── package.json # Frontend dependencies
├── server/ # Express backend API
│ ├── src/
│ │ ├── controllers/ # Route handlers
│ │ ├── models/ # MongoDB schemas
│ │ ├── services/ # Business logic
│ │ └── middlewares/ # Express middlewares
│ ├── config/ # Database and cache config
│ └── package.json # Backend dependencies
└── README.md # This file
- Node.js 18+
- MongoDB instance
- Redis instance (optional, for caching)
# Clone the repository
git clone <repository-url>
cd clarity
# Install client dependencies
cd client
npm install
# Install server dependencies
cd ../server
npm install# Start the backend server
cd server
npm run dev
# In a new terminal, start the frontend
cd ../client
npm run devThe application will be available at http://localhost:5173 with the backend running on port 3000.
| Variable | Description | Required |
|---|---|---|
MONGO_URL |
MongoDB connection string | Yes |
JWT_SECRET |
Secret key for JWT tokens | Yes |
FRONTEND_URL |
Frontend application URL | Yes |
EXA_API_KEY |
API key for Exa search service | Yes |
GOOGLE_USER |
Gmail address for email service | Yes |
GOOGLE_CLIENT_ID |
Google OAuth client ID | Yes |
GOOGLE_CLIENT_SECRET |
Google OAuth client secret | Yes |
GOOGLE_REFRESH_TOKEN |
Google OAuth refresh token | Yes |
REDIS_HOST |
Redis host (optional) | No |
REDIS_PORT |
Redis port (optional) | No |
REDIS_PASSWORD |
Redis password (optional) | No |
PORT |
Server port (default: 3000) | No |
NODE_ENV |
Environment mode | No |