A modern chat application built with Next.js, featuring real-time communication, user authentication, and AI-powered interactions.
- 🔐 Secure user authentication with JWT and bcrypt
- 💬 Real-time chat functionality
- 🤖 AI integration with OpenAI
- 🎨 Modern UI with Tailwind CSS and Framer Motion
- 📱 Fully responsive design
- 🔍 Syntax highlighting for code snippets
- 🌐 MongoDB database integration
- Frontend: Next.js, React, TypeScript
- Styling: TailwindCSS, Framer Motion
- Backend: Next.js API Routes
- Database: MongoDB with Mongoose
- Authentication: JWT, bcryptjs
- AI Integration: OpenAI API
- Package Manager: npm/bun
-
Clone the repository
git clone https://github.com/Ellipog/chat.git cd chat
-
Install dependencies
bun i
-
Set up environment variables Create a
.env
file in the root directory with the following variables:MONGODB_URI=your_mongodb_uri JWT_SECRET=your_jwt_secret OPENAI_API_KEY=your_openai_api_key OPENAI_MODEL=openai_model_name (e.g. gpt-4o-mini)
-
Run the development server
bun dev
Open http://localhost:3000 in your browser to see the application.
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ ├── layout.tsx # Root layout
│ └── page.tsx # Home page
├── components/ # Reusable React components
├── context/ # React context providers
├── lib/ # Utility functions and configurations
├── models/ # MongoDB models
├── public/ # Static assets
└── types/ # TypeScript type definitions
by Elliot