Modern AI Chat Platform — Real-time, full-stack, production-ready chat app with advanced features, beautiful UI, and robust backend. Powered by Node.js, Express, React, Socket.IO, Gemini API, MongoDB, and Pinecone.
Zen-AI is a full-stack conversational AI platform designed for modern web users and teams. It features real-time chat, persistent conversations, semantic memory, and a rich set of user actions. The backend leverages Node.js, Express, MongoDB, and Pinecone for scalable, secure, and fast operations. The frontend is built with React, Vite, Redux Toolkit, and TailwindCSS for a beautiful, responsive, and interactive experience.
Why Zen-AI stands out:
- Real-time, low-latency chat with AI (Socket.IO + Gemini API)
- Semantic memory: context-aware replies using Pinecone vector search
- Secure JWT authentication with cookie-based sessions
- Advanced message actions: love, share, screenshot, read-aloud, copy
- Sandbox mode for guest/temporary chats
- Pagination, optimistic UI, and accessibility features
- Clean codebase, modular structure, and production-grade logging
- Register & Login: Secure JWT auth, cookie-based sessions, password hashing
- Home & Sidebar: Persistent chat history, quick navigation, user info
- Sandbox Chat: Temporary, non-persistent chat for guests and quick tests
- Real-time Messaging: Socket.IO for instant send/receive, streaming AI responses
- Message Actions:
- Love (like) messages
- Share chat/messages
- Screenshot any message (styled, dark/light)
- Read aloud (browser TTS)
- Copy message text
- Markdown & Code Highlighting: Beautiful rendering of AI/code responses
- Pagination & Infinite Scroll: Efficient loading for long chats
- Optimistic UI: Fast, responsive user experience
- Accessibility: Dark mode, keyboard navigation, toast notifications
- Node.js, Express, MongoDB (Mongoose)
- Gemini API (Google GenAI)
- Pinecone (vector DB)
- Socket.IO (WebSockets)
- JWT, bcrypt, cookie-parser
- Pino (logging), rotating-file-stream
- Express-rate-limit, express-validator
- RESTful APIs for auth, chat, message management
- Socket.IO namespaces for
/user(auth) and/sandbox(guest) - Gemini API for AI responses and auto-title generation
- Pinecone vector search for semantic context and memory
- MongoDB for persistent storage (users, chats, messages)
- JWT authentication via cookies, secure middleware
- Rate limiting (API + socket)
- Request validation and error handling
- Structured logging (Pino, rotating logs in production)
@google/genai— Gemini/GenAI client for AI responses@pinecone-database/pinecone— Pinecone vector DB clientbcrypt— Password hashingcookie,cookie-parser— Cookie managementcors— Cross-origin resource sharingdotenv— Environment variable managementexpress— HTTP server frameworkexpress-rate-limit— API rate limitingexpress-validator— Request validationjsonwebtoken— JWT creation/verificationmongoose— MongoDB ODMnanoid— Unique ID generation (sandbox)pino,pino-http,pino-pretty— Loggingrotating-file-stream— Log rotationsocket.io— WebSocket servernodemon— Dev server reloader
server.js— Entry point, sets up Express, Socket.IO, DBsrc/app.js— Express app, middleware, routers, error handlingsrc/controllers/— Auth & chat logic, Gemini integrationsrc/models/— Mongoose models: User, Chat, Message, SandboxLog, DeleteLogsrc/routes/— Auth & chat route definitionssrc/services/— Gemini, Pinecone, DB helperssrc/sockets/— Socket.IO namespaces, message handlingsrc/middlewares/— Auth, rate limit, validation, loggingsrc/utils/— JWT, token extraction, error helpers, loggersrc/validators/— Request validation schemas
cd backend
copy .env.example .env
# Edit .env for MongoDB, Gemini, Pinecone, JWT_SECRET
npm install
npm run dev
# API: http://localhost:3000/api/v1- React 19, Vite, Redux Toolkit
- TailwindCSS, Framer Motion
- Socket.IO client, Axios
- React Toastify, Markdown/Code highlighting
- Auth flows: register, login, logout
- Home page: chat list, sidebar, user info
- Chat UI: message list, input, top bar
- Real-time messaging: Socket.IO client
- Message actions: love, share, screenshot, read-aloud, copy
- Sandbox mode: guest/temporary chat
- Markdown/code rendering, syntax highlight
- Pagination, infinite scroll, optimistic UI
- Accessibility: dark mode, keyboard, toasts
react,react-dom— UI frameworkredux,@reduxjs/toolkit— State managementaxios— API requestssocket.io-client— Real-time messagingtailwindcss— Stylingframer-motion— Animationsreact-toastify— Notificationsreact-markdown,remark-gfm,rehype-highlight— Markdown/code renderinghtml-to-image— Screenshot utility
src/App.jsx— App root, theme, toastssrc/main.jsx— Entry, Redux providersrc/routes/App.routes.jsx— Routingsrc/services/axios.service.js— Central Axios instancesrc/sockets/client.socket.js— Socket.IO client setupsrc/features/— Redux slices: chats, messages, ui, usersrc/components/— UI: AuthPage, Chat, Home, MessagesList, ResponseActions, etc.src/utils/— Screenshot, auto-scroll, markdown helpers
cd frontend
npm install
npm run dev
# App: http://localhost:5173MIT License — see LICENSE file.

