InsightFlow is a SaaS application designed for business owners to effortlessly collect, analyze, and act on customer feedback using the power of AI. With InsightFlow, you can gain valuable insights into customer sentiments, streamline your feedback processes, and enhance customer satisfaction.
https://www.youtube.com/watch?v=-BkMrIukKYo
- Intuitive Dashboard: Visualize your feedback data with metrics like total feedback, sentiment analysis, and trends.
- AI-Powered Summaries: Get instant summaries of feedback and actionable insights.
- Dual AI Provider Support: Automatically falls back from OpenAI to Gemini for cost-effective AI processing.
- Customizable Widgets: Easily integrate feedback collection into your website with customizable widgets.
- Effortless Integration: Embed InsightFlow with a single line of code, direct links, or QR codes.
- AI Chat: Interact with an AI chatbot to analyze feedback data and get insights.
- Frontend: Next.js
- Backend: TiDB Serverless with Vector Search, OpenAI, Google Gemini
- Styling: Tailwind CSS
- Deployment: Vercel
Make sure you have the following installed:
- Node.js (version 14.x or later) - Download here
- npm (comes with Node.js) or yarn
- A TiDB Serverless account with Vector Search - Sign up here
- AI API Key (choose one):
- OpenAI API key - Get one here (Primary)
- Gemini API key - Get one here (Fallback, generous free tier)
-
Clone the repository:
git clone https://github.com/priyanshuharshbodhi1/InsightFlow.git cd InsightFlow -
Install dependencies:
npm install
-
Environment setup:
# Copy the example environment file cp .env.example .envEdit the
.envfile with your credentials:NEXT_PUBLIC_BASE_URL="http://localhost:4500" AUTH_SECRET=your_random_secret_key_here DATABASE_URL=mysql://username:password@host:port/database_name OPENAI_API_KEY=sk-your_openai_api_key_here
-
Database setup:
# Generate Prisma client npx prisma generate # Run database migrations npx prisma migrate dev
-
Start the development server:
npm run dev
-
Open your browser and navigate to http://localhost:4500
npm run dev- Start development servernpm run build- Build production applicationnpm start- Start production server (requires build first)npm run lint- Run ESLint for code quality checks
# View database in Prisma Studio
npx prisma studio
# Reset database (⚠️ This will delete all data)
npx prisma migrate reset
# Deploy migrations to production
npx prisma migrate deploy| Variable | Description | Required |
|---|---|---|
NEXT_PUBLIC_BASE_URL |
Base URL of your application | ✅ |
AUTH_SECRET |
Secret key for NextAuth.js (generate a random string) | ✅ |
DATABASE_URL |
TiDB Serverless connection string | ✅ |
OPENAI_API_KEY |
OpenAI API key for AI features | ✅ |
Common Issues:
-
Database connection errors:
- Ensure your TiDB Serverless database is running
- Check if the DATABASE_URL is correct
- Verify network connectivity
-
Prisma generate errors:
# Clear Prisma cache and regenerate npx prisma generate --force -
Module not found errors:
# Clear node_modules and reinstall rm -rf node_modules package-lock.json npm install -
Port already in use:
# Run on a different port npm run dev -- -p 3001
- Make changes to your code
- Test locally with
npm run dev - Run linting with
npm run lint - Build for production with
npm run build - Test production build with
npm start
This project is optimized for deployment on Vercel:
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on each push
For other platforms, build the project with npm run build and deploy the .next folder.