This is a Next.js project bootstrapped with create-next-app.
npm installCreate a .env file in the root directory (copy from .env.example):
# Required - Neon Database
DATABASE_URL=postgresql://username:password@ep-xxx.neon.tech/routeiq?sslmode=require
# Required - OpenAI for AI Agent
OPENAI_API_KEY=sk-proj-xxxxxxxxxxxxx
# Required - Composio for integrations
COMPOSIO_API_KEY=your_composio_api_key_here
# Optional - Connected accounts (configure after connecting apps)
COMPOSIO_CRM_ACCOUNT_ID=conn_hubspot_xxxxx
COMPOSIO_SLACK_ACCOUNT_ID=conn_slack_xxxxx
COMPOSIO_GMAIL_ACCOUNT_ID=conn_gmail_xxxxx
COMPOSIO_STRIPE_ACCOUNT_ID=conn_stripe_xxxxx
# Optional
NEXT_PUBLIC_APP_URL=http://localhost:3000
SLACK_DEFAULT_CHANNEL=#sales
HUBSPOT_OWNER_MAP={"Alice":"12345","Bob":"67890"}📖 See DATABASE_SETUP.md for detailed database setup instructions.
# Generate and push database schema to Neon
npm run db:push
# (Optional) Seed sample data for testing
npx tsx scripts/seed-sample-data.ts
# (Optional) Open Drizzle Studio to view your data
npm run db:studio📖 Full database setup guide: DATABASE_SETUP.md
npm run devOpen http://localhost:3000 with your browser to see the result.
- Visit http://localhost:3000/apps
- Enter your User ID (email or unique identifier)
- Click Connect for each integration:
- HubSpot (optional for CRM sync)
- Gmail (optional for email sending)
- Slack (optional for notifications)
- Stripe (optional for invoicing)
- DocuSign (optional for contracts)
📖 Full setup guide: ENV_SETUP.md
RouteIQ includes an intelligent AI agent powered by OpenAI GPT-4 with Composio integrations:
- Natural Language Interface: Chat with the agent to manage leads, send emails, create invoices
- Function Calling: Agent can execute actions using Composio tools
- Context Awareness: Maintains conversation history and session state
- Multi-Tool Workflows: Execute complex workflows across multiple apps
Example Usage:
curl -X POST http://localhost:3000/api/agent/chat \
-H "Content-Type: application/json" \
-d '{
"userId": "user123",
"message": "Show me all qualified leads with score above 80"
}'All API endpoints now support pagination:
- Leads:
/api/leads?page=1&limit=20&status=qualified - Activities:
/api/activity?page=1&limit=50&leadId=L-1001 - Responses include pagination metadata (total, totalPages, hasNext, hasPrev)
- Persistent storage for leads, activities, emails
- Efficient indexing for fast queries
- Agent session and message history storage
- Easy to manage with Drizzle ORM and Studio
Database Commands:
npm run db:generate # Generate migrations
npm run db:push # Push schema changes
npm run db:migrate # Run migrations
npm run db:studio # Open visual database browserYou can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
Filter by potential score, date range, and status. Quick actions for email resend and Slack notifications to reduce response times and follow-up delays.
Unified log of all cross-tool actions (emails sent, Slack notifications, invoices created) for complete campaign visibility.
Natural language command interface for instant actions (resend emails, notify Slack, create invoices).
- Admin View: Response times, conversion rates, status distribution
- Marketing View: Email engagement, campaign performance, lead quality
- HubSpot - CRM and contact management
- Gmail - Email viewing and sending
- Slack - Team notifications
- Stripe - Invoicing and payments
- DocuSign - Contract sending
- Frontend: Next.js 15 with App Router, React 19, TailwindCSS
- Backend: Next.js API routes with Composio SDK integration
- Integrations: Composio
proxyExecutefor direct SaaS API calls - State: In-memory activity store (replace with DB for production)
- Auth: Per-user OAuth via Composio connected accounts
routeiq/
├── src/
│ ├── app/
│ │ ├── api/ # API routes (leads, notify, deals, etc.)
│ │ ├── leads/ # Lead management UI
│ │ ├── activity/ # Activity feed
│ │ ├── chat/ # AI assistant
│ │ ├── admin/ # Admin dashboard
│ │ ├── marketing/ # Marketing dashboard
│ │ └── apps/ # App connection manager
│ ├── lib/
│ │ ├── composio.ts # Composio client
│ │ ├── persist.ts # Activity storage
│ │ └── types.ts # TypeScript types
│ └── components/ # Reusable UI components
├── ENV_SETUP.md # Environment setup guide
└── PRD.md # Product requirements