CodeMate is a full-stack AI chat application built with React, Vite, Node.js, Express, and MongoDB. It allows users to start conversations, manage chat threads, and receive AI-generated responses through a clean and responsive interface.
- Modern chat UI with a polished experience
- Thread-based conversation history
- AI-powered responses using Google Gemini
- Copy assistant replies to the clipboard
- Auto-scroll for new messages
- Clear chat option for a fresh conversation
- Backend fallback support when MongoDB is unavailable
- React
- Vite
- CSS
- React Markdown
- Node.js
- Express
- MongoDB / Mongoose
- Google GenAI SDK
CodeMate/
├── Backend/
│ ├── models/
│ ├── routes/
│ ├── utils/
│ ├── package.json
│ └── server.js
├── frontend/
│ ├── src/
│ ├── package.json
│ └── vite.config.js
└── README.mdBefore running the project, make sure you have:
- Node.js installed
- npm installed
- A Google API key
- A MongoDB connection string (optional for local testing if fallback mode is used)
git clone https://github.com/your-username/CodeMate.git
cd CodeMatecd Backend
npm installCreate a .env file inside the Backend folder with:
PORT=8080
GOOGLE_API_KEY=your_google_api_key
MONGODB_URI=your_mongodb_connection_stringStart the backend:
npm startcd ../frontend
npm installStart the frontend:
npm run dev- Open the frontend in your browser.
- Start a new chat.
- Enter a message and receive an AI response.
- Use the clear chat option or copy replies as needed.
Possible upgrades for the project include:
- User authentication
- Message streaming
- Dark/light mode toggle
- Export chat history
- Better AI prompt handling
Payel Mallick