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