A modern AI-powered chatbot application built with Next.js, TailwindCSS, and @ai-sdk/react, featuring real-time weather forecasting, file uploads, and a sleek chat interface.
- 🤖 AI Chat Assistant: Powered by OpenAI for intelligent and contextual conversations.
- 🌦️ Real-Time Weather Forecasting: Integrated with WeatherAPI.com to fetch live weather updates.
- 📎 File and Image Uploads: Supports file attachments and image previews in chat.
- 📬 Markdown Support: Chat messages support Markdown for rich text formatting.
- 🛠️ Tool Execution: Built-in tool execution using
tool()fromaiwithzodschema validation. - 🎨 Responsive Design: Fully responsive UI built with TailwindCSS.
- Framework: Next.js
- Styling: TailwindCSS
- AI SDK: @ai-sdk/react
- Weather API: WeatherAPI.com
- Validation: Zod
├── src/ │ ├── app/ │ │ ├── api/ │ │ │ └── chat/ │ │ │ └── route.ts # API route for chat functionality │ │ ├── layout.tsx # Root layout for the app │ │ └── page.tsx # Main chat page │ ├── lib/ │ │ └── tools.ts # Weather tool integration │ └── styles/ │ └── globals.css # Global styles ├── public/ # Static assets ├── .env # Environment variables ├── README.md # Project documentation └── package.json # Project dependencies
Follow these steps to set up and run the project locally.
Make sure you have the following installed:
Clone the repository and install the required packages:
git clone https://github.com/your-username/ai-weather-chat.git
cd ai-weather-chat
pnpm installCreate a .env file in the root of the project:
touch .envAdd your WeatherAPI key:
WEATHER_API_KEY=your_weatherapi_key_here🔑 You can get a free API key from https://www.weatherapi.com
Start the development server:
pnpm devThe app should now be running at:
http://localhost:3000
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch: git checkout -b feature-name.
- Commit your changes: git commit -m 'Add feature'.
- Push to the branch: git push origin feature-name.
- Open a pull request.
For questions or support, please contact ganapathipriyadharsani@gmail.com
