A full-stack AI chat application built with Node.js, Express, React, and TypeScript, featuring real-time conversations with AI models and project management capabilities .
https://deepwiki.com/mohamednaji7/ai-chat-nodejs-react
- AI Chat Interface: Interactive chat with AI models using OpenAI integration
- Authentication: JWT-based authentication system
- Project Management: Create and manage chat projects
- Chat History: Persistent conversation history
- Real-time Streaming: Stream AI responses in real-time
- Security: Helmet and CORS protection
- Node.js with Express.js framework
- Supabase for database and authentication
- OpenAI API for AI chat functionality
- JWT for authentication
- Zod for LLM tool validation
- React with
- Vite for build tooling
- ESLint for code quality
- Node.js (v16 or higher)
- npm or yarn
- Supabase account
- at least one of these
- Gemini API key
- Azure
- AI foundry account
- AZURE OPENAI DEPLOYMENT - API key, and endpoint link
-
Clone the repository
git clone https://github.com/mohamednaji7/ai-chat-nodejs-react.git cd ai-chat-nodejs-react -
Install server dependencies
cd server npm install -
Install client dependencies
cd ../client npm install
rename .env-azure-tmp or .env-gemini-tmp file (in server/src/) to .env and fill it
rename .env-tmp file (in client/) to .env and fill it
Backend (runs on port 3000):
cd server
npm run devFrontend (runs on port 5173):
cd client
npm run devnpm run dev- Start development server with nodemonnpm start- Start production servernpm run dev-prod- Start server in production modenpm test- Run tests with Vitestnpm run build- Build both client and server
npm run dev- Start Vite development servernpm run build- Build for productionnpm run preview- Preview production build
ai-chat-nodejs-react/
├── server/ # Backend Express.js application
│ ├── src/
│ │ ├── index.js # Server entry point
│ │ ├── app.js # Express app configuration
│ │ ├── routes/ # API routes
│ │ └── middleware/ # Custom middleware
│ └── package.json
├── client/ # Frontend React application
│ ├── src/
│ ├── vite.config.ts # Vite configuration
│ └── package.json
└── LICENSE # Apache 2.0 License
The application uses JWT-based authentication with Supabase as the backend service. Authentication tokens are managed via cookies .
Run the test suite using Vitest :
cd server
npm testBuild the entire application:
cd server
npm run buildThis will install dependencies and build the server and the client application.
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests
- Submit a pull request
For support and questions, please open an issue in the GitHub repository.
- Make sure to configure your environment variables properly before running the application.
- The server serves the built React client as static files for production deployment. as static files, enabling single-page application routing.
- The application uses ES modules throughout the codebase.

