A lightweight full-stack user analytics platform inspired by Google Analytics.
Dashboard is available at https://insightflow-pi.vercel.app/dashboard. API documentation is available at https://insight-flow-zdsk.onrender.com/api-docs/.
InsightFlow consists of:
- Analytics Tracker SDK
- Analytics Ingestion API
- Analytics Dashboard
- Demo E-Commerce Store
The platform captures user behavior in real time, stores events, and visualizes them through a modern analytics dashboard.
Check API documentation at http://localhost:5000/api-docs after running the backend server.
- Session tracking
- Page view tracking
- Click tracking
- Custom event tracking
- Automatic batching
- Retry with exponential backoff
- Persistent offline queue
- SPA route change detection
- Debug mode
- Bulk event ingestion
- Session analytics
- User journey reconstruction
- Heatmap data generation
- Product analytics
- Funnel analytics
- Top events analytics
- Page analytics
- Swagger API documentation
- Rate limiting
- Request validation
- Structured logging
- KPI overview cards
- Session explorer
- Session journey timeline
- Product analytics
- Conversion funnel
- Top events
- Page analytics
- Heatmap visualization
- Pagination
- Search
- Sorting
- CSV export
- Loading states
- Error states
- Product browsing
- Wishlist tracking
- Add to cart tracking
- Purchase tracking
- Search tracking
- Analytics SDK integration
- Next.js 15
- React
- TypeScript
- Tailwind CSS
- Recharts
- Zustand
- Node.js
- Express
- TypeScript
- MongoDB
- Mongoose
- Zod
- Pino
- Jest
- Supertest
- MongoDB Memory Server
insightflow/
├── backend/
│ ├── src/
│ ├── tests/
│ └── docs/
├── tracker-sdk/
│ ├── src/
│ └── dist/
├── dashboard/
│ ├── app/
│ ├── components/
│ └── lib/
└── demo-store/
git clone <repository-url>
cd insightflowcd backend
npm install
npm run devServer:
http://localhost:5000
Swagger:
http://localhost:5000/api-docs
cd tracker-sdk
npm install
npm run buildcd dashboard
npm install
npm run devDashboard:
http://localhost:3000
cd demo-store
npm install
npm run devStore:
http://localhost:3000
PORT=3000
MONGODB_URI=mongodb://localhost:27017/insightflow
NODE_ENV=developmentimport { InsightFlow }
from "@insightflow/sdk";
const analytics =
new InsightFlow({
apiUrl:
"http://localhost:5000/api/events/bulk",
debug: true,
});
analytics.init();
analytics.track(
"purchase_completed",
{
orderId: "123",
total: 299,
},
);POST /api/events/bulkGET /api/analytics/overview
GET /api/analytics/sessions
GET /api/analytics/pages
GET /api/analytics/heatmapGET /api/sessions/:sessionIdRun all tests:
npm run testCoverage:
npm run test -- --coverageEvents are batched before being sent to reduce network requests.
Failed requests use exponential backoff retries.
Pending events are stored in localStorage and restored on reload.
Analytics endpoints use MongoDB aggregation pipelines to efficiently compute metrics.
User journeys are reconstructed from stored event streams ordered by timestamp.
- Real-time analytics
- Live dashboard updates
- User segmentation
- Cohort analysis
- Retention analytics
- Revenue analytics
- Advanced funnel analysis
MIT