ClientX is a scalable multi-tenancy project management system built with the MERN stack (MongoDB, Express, React, Node.js).
It’s designed for real-world B2B collaboration with features like Google Sign-In, workspace management, task tracking, role-based permissions, and analytics.
Perfect for developers looking to build a SaaS project management or team collaboration platform.
- 🔐 Authentication – Google OAuth, Email & Password
- 🏢 Workspaces – Create & manage multiple organizations
- 📊 Projects & Epics – Organize work at scale
- ✅ Tasks – CRUD operations with status, priority & assignees
- 👥 Roles & Permissions – Owner, Admin, Member
- ✉️ Invitations – Invite users to join workspaces
- 🔍 Filters & Search – By status, priority, assignee
- 📈 Analytics Dashboard – Team & project insights
- 🤖 AI Chat Assistant – Powered by Google Gemini with conversation context
- 💬 User-Specific Chat History – Private conversations with database persistence
- 📅 Pagination & Infinite Scroll – Smooth data loading
- 🔒 Secure Sessions – Cookie-based authentication
- 🚪 Logout & Session Termination
- 🌱 Database Seeding – Sample/test data generation
- 💾 Mongoose Transactions – Reliable data integrity
- Backend: Node.js, Express.js, TypeScript
- Frontend: React.js (Vite), TailwindCSS, Shadcn UI
- Database: MongoDB, Mongoose
- Auth: Google OAuth 2.0, Cookie Sessions
- AI: Google Gemini API (gemini-2.0-flash)
- Other Tools:
- Axios for HTTP requests
- Vite.js for frontend build
- ESLint + Prettier for code quality
git clone https://github.com/prajwallshetty/ClientX.git
cd ClientX
npm installCreate a .env file in the root and add:
PORT=8000
NODE_ENV=development
MONGO_URI="mongodb+srv://<username>:<password>@cluster.mongodb.net/teamsync_db"
SESSION_SECRET="your_session_secret"
GOOGLE_CLIENT_ID=<your-google-client-id>
GOOGLE_CLIENT_SECRET=<your-google-client-secret>
GOOGLE_CALLBACK_URL=http://localhost:8000/api/auth/google/callback
FRONTEND_ORIGIN=http://localhost:5173
FRONTEND_GOOGLE_CALLBACK_URL=http://localhost:5173/google/callback
GEMINI_API_KEY=your_gemini_api_key_here- Visit https://aistudio.google.com/app/apikey
- Sign in with your Google account
- Click "Create API key" → "Create API key in new project"
- Copy the API key and add it to your
.envfile - Test your API key (optional):
cd backend node test.js
npm run devBackend runs on: http://localhost:8000
Frontend runs on: http://localhost:5173
The AI Chat Assistant is powered by Google Gemini 2.0 Flash and provides intelligent responses with full conversation context.
It's incredibly easy to connect Gemini AI to this project!
-
Get Free API Key (2 minutes)
- Visit: https://aistudio.google.com/app/apikey
- Click "Create API key" → "Create API key in new project"
- Copy your key (looks like:
AIzaSy...)
-
Add to .env File (30 seconds)
GEMINI_API_KEY=paste_your_key_here
-
Restart Server (Done! ✅)
npm run dev
That's it! Your AI Chat is now live and ready to use. No complex configuration needed!
- ✅ Conversation Context – AI remembers last 10 messages for follow-up questions
- ✅ User-Specific History – Each user has private chat history
- ✅ Database Persistence – Chat survives page refreshes
- ✅ Auto-Scroll – Smooth scrolling while AI responds
- ✅ Clear History – Delete your chat anytime
- Log in to your account
- Click "AI Chat" in the sidebar
- Ask any question – programming, general knowledge, advice, etc.
- AI remembers context, so you can ask follow-up questions!
- POST
/api/ai/chat– Send message to AI - GET
/api/ai/chat/history– Get user's chat history - DELETE
/api/ai/chat/history– Clear chat history
- Model: gemini-2.0-flash (fast, no thinking tokens)
- Max Tokens: 8192 (long detailed responses)
- Context: Last 10 messages sent to AI
- Rate Limits: 15 req/min, 4M tokens/min (free tier)
- API Key Issues: Run
node test.jsin backend folder - No Context: Make sure you're logged in
- Responses Cut Off: Increase
maxOutputTokensinai.service.ts