A high-performance, premium AI chat client featuring real-time streaming, secure server proxying, and cloud-synced conversation history.
- 🎨 Premium Dark Aesthetics — Sleek glassmorphic components, fluid violet-to-cyan neon gradient accents, and responsive micro-animations.
- 🔐 Dual Auth Flow — Secure user authentication powered by Firebase Client, with support for standard Email/Password and One-Click Google Sign-In.
- ☁️ Cloud Persisted Syncing — Real-time Firestore sync binds conversations and message histories under private, user-specific partitions.
- 🔄 Token-by-Token Streaming — Leverages Server-Sent Events (SSE) to stream responses from NVIDIA's API instantly.
- ⚡ Intelligent Keep-Alive — Integrated cache-busting, zero-cache health monitors keep Render server instances awake on user mount/login.
- 📝 Rich Markdown Support — Built-in rendering of code blocks (complete with copy-to-clipboard actions), standard formatting, links, and lists.
- 🛡️ Backend Token Protection — Secure request proxy hides the NVIDIA API keys entirely from client access.
- ⌨️ Power-User Shortcuts — Navigation shortcuts like
Ctrl+N(New Chat),Ctrl+B(Toggle Sidebar), andEsc(Close Modals) for a desktop-class experience.
NexChat/
├── backend/ # Express API
│ ├── server.js # Main server entry with Firebase Admin
│ ├── middleware/auth.js # Firebase ID token verification middleware
│ ├── routes/completions.js # Upstream NVIDIA NIM streaming proxy
│ └── package.json # Backend dependencies
│
├── frontend/ # React Frontend (Vite)
│ ├── src/
│ │ ├── main.jsx # React application entry
│ │ ├── App.jsx # Layout & State orchestration
│ │ ├── firebase.js # Firebase Client initialization
│ │ ├── contexts/AuthContext.jsx # Context providing Auth actions & State
│ │ ├── hooks/
│ │ │ ├── useChats.js # Firestore subscription & CRUD hook
│ │ │ └── useStream.js # SSE completions streaming hook
│ │ ├── components/ # Subcomponents (Auth, Sidebar, Chat, Settings)
│ │ └── index.css # Global stylesheets & design tokens
│ └── package.json # Frontend dependencies
│
├── package.json # Monorepo controller config
└── README.md # This file
Create a .env file in the backend/ directory:
PORT=3000
NVIDIA_API_KEY=your_nvidia_api_key_here
# Firebase Admin Credentials
FIREBASE_PROJECT_ID=your_firebase_project_id
FIREBASE_CLIENT_EMAIL=your_service_account_email
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
# Allowed CORS Origin
FRONTEND_URL=http://localhost:5173The Firebase configuration is hardcoded in frontend/src/firebase.js using your web app credentials. Ensure VITE_BACKEND_URL is set:
VITE_BACKEND_URL=http://localhost:3000Install all dependencies for both directories and run the application concurrently using the monorepo scripts in the root directory:
# Install all dependencies across the project
npm run install:all
# Run both frontend & backend concurrently
npm run dev- Frontend: Runs on http://localhost:5173
- Backend: Runs on http://localhost:3000
- Add a new Web Service on Render.
- Set Root Directory to
backend. - Set Build Command to
npm install. - Set Start Command to
node server.js. - Add the necessary backend environment variables.
- Import repository to Vercel.
- Select Root Directory as
frontend. - Use the Vite preset (Vercel autodetects it).
- Set the
VITE_BACKEND_URLenvironment variable pointing to your deployed backend URL.