Skip to content

mayurk224/clarity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 

Repository files navigation

Clarity

An AI-powered chat application for intelligent conversations and knowledge discovery.

React Node.js Express MongoDB Vite

Overview

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.

Key Features

  • 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

Architecture & Structure

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

Getting Started

Prerequisites

  • Node.js 18+
  • MongoDB instance
  • Redis instance (optional, for caching)

Installation

# Clone the repository
git clone <repository-url>
cd clarity

# Install client dependencies
cd client
npm install

# Install server dependencies
cd ../server
npm install

Running the App

# Start the backend server
cd server
npm run dev

# In a new terminal, start the frontend
cd ../client
npm run dev

The application will be available at http://localhost:5173 with the backend running on port 3000.

Environment Variables

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

About

Clarity is a modern web app that combines conversational AI with powerful search, enabling threaded chats, intelligent queries, and saved responses in one unified platform for developers, researchers, and knowledge workers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors