A powerful AI-powered answer engine built with Next.js that uses Groq for chat functionality and web scraping capabilities to provide accurate, context-aware responses.
- Frontend: Next.js, React, TypeScript
- Backend: Next.js API Routes
- AI Integration: Groq
- Web Scraping: Cheerio, Puppeteer
- Rate Limiting: Redis
- Deployment: Vercel (recommended)
- Node.js 18+
- npm or yarn
- Redis (for rate limiting)
- Clone the repository:
git clone https://github.com/team-headstart/ai-answer-engine.git
cd ai-answer-engine- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env.localThen edit .env.local with your configuration:
GROQ_API_KEY: Your Groq API keyREDIS_URL: Your Redis connection URL
- Run the development server:
npm run dev- Open http://localhost:3000 with your browser to see the result.
The following areas need attention:
-
Frontend (
src/app/page.tsx)- Update the UI components
- Implement API response handling
- Add loading states and error handling
-
Backend (
src/app/api/chat/route.ts)- Implement Groq chat integration
- Set up web scraping with Cheerio and Puppeteer
- Add error handling and validation
-
Middleware (
src/middleware.ts)- Implement Redis-based rate limiting
- Add request validation
- Next.js Documentation - learn about Next.js features and API
- Learn Next.js - an interactive Next.js tutorial
- Groq Documentation - learn about Groq's AI capabilities
- Puppeteer Documentation - learn about web scraping with Puppeteer