A comprehensive analytics dashboard for monitoring Stripe payment metrics, featuring Monthly Recurring Revenue (MRR) tracking and key business insights.
- Monthly Recurring Revenue (MRR) tracking with trend visualization
- Customer Metrics: Total customers, new customers, churn rate
- Revenue Breakdown: Subscription vs one-time revenue analysis
- Interactive Charts: Hover tooltips and responsive design
- Real-time Data: API-driven dashboard with automatic updates
- TypeScript + React for type-safe component development
- Tailwind CSS for responsive styling
- shadcn/ui for consistent UI components
- Recharts for interactive data visualization
- Lucide React for modern icons
- Vite for fast development and building
- FastAPI for high-performance API development
- Python with type hints and Pydantic models
- PostgreSQL support with psycopg driver
- uv for fast Python dependency management
- CORS enabled for cross-origin requests
- Automatic API documentation with OpenAPI/Swagger
The application follows a clean separation between frontend and backend:
Kiara-Stripe-Analytics/
├── backend/ # FastAPI backend
│ ├── app/
│ │ ├── __init__.py
│ │ └── main.py # API endpoints and data models
│ ├── tests/ # Backend tests
│ ├── pyproject.toml # Python dependencies (uv)
│ ├── uv.lock # Dependency lock file
│ └── README.md
└── frontend/ # React frontend
├── src/
│ ├── components/ # Reusable UI components
│ │ ├── ui/ # shadcn/ui components
│ │ ├── MetricCard.tsx
│ │ └── MRRChart.tsx
│ ├── services/ # API service layer
│ ├── types/ # TypeScript type definitions
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utility functions
│ └── App.tsx # Main dashboard component
├── package.json # Node.js dependencies
├── components.json # shadcn/ui configuration
└── .env # Environment configuration
- Python 3.12+
- Node.js 18+
- uv (for Python dependency management)
- npm/yarn/pnpm (for Node.js dependencies)
cd backend
uv sync
uv run fastapi dev app/main.py
The backend will be available at http://localhost:8000
cd frontend
npm install
npm run dev
The frontend will be available at http://localhost:5173
GET /api/dashboard
- Complete dashboard dataGET /api/mrr
- Monthly Recurring Revenue historyGET /api/customers
- Customer metricsGET /api/revenue
- Revenue breakdownGET /healthz
- Health check endpoint
Frontend (.env):
VITE_API_URL=http://localhost:8000
Backend: No additional environment variables required for dummy data mode.
Currently uses dummy data for demonstration. To integrate with real Stripe data:
- Replace the
generate_dummy_data()
function inbackend/app/main.py
- Add Stripe API client and authentication
- Implement actual data fetching from Stripe API
- Update data models if needed for real Stripe response format
- MetricCard: Displays key metrics with trend indicators
- MRRChart: Interactive line chart for MRR trends
- Responsive Grid: Adapts to different screen sizes
- Loading States: Smooth user experience during data fetching
The project includes a comprehensive set of pre-built UI components:
- Layout: Cards, Separators, Aspect Ratio, Resizable panels
- Navigation: Breadcrumbs, Command palette, Menubar, Navigation menu, Pagination, Sidebar
- Forms: Input, Textarea, Select, Checkbox, Radio Group, Switch, Slider, Input OTP
- Feedback: Alert, Toast, Progress, Skeleton, Hover Card, Tooltip
- Overlay: Dialog, Alert Dialog, Drawer, Sheet, Popover, Context Menu, Dropdown Menu
- Data Display: Table, Badge, Avatar, Accordion, Collapsible, Tabs, Carousel
- Utility: Button, Toggle, Toggle Group, Scroll Area, Form validation
The application is deployed using:
- Backend: Fly.io with automatic FastAPI deployment
- Frontend: Static hosting with environment-based API configuration
- TypeScript: Full type safety across the entire frontend stack
- React Best Practices: Functional components, custom hooks, and modern patterns
- Component Architecture: Modular design with shadcn/ui for consistency
- API Layer: Clean service abstraction for backend communication
- Styling: Tailwind CSS with custom design system integration
- Development Tools: ESLint, PostCSS, and Vite for optimal DX
- Dependency Management: uv for Python, npm for Node.js
- Database Ready: PostgreSQL integration prepared for production use
- Stripe Integration: Replace dummy data with real Stripe API connections
- Authentication: User login and multi-tenant organization support
- Database Integration: Full PostgreSQL implementation for data persistence
- Advanced Analytics: Custom date ranges, filtering, and drill-down capabilities
- Export Features: PDF reports, CSV downloads, and scheduled reports
- Real-time Updates: WebSocket connections for live dashboard updates
- Enhanced Visualizations: Additional chart types and interactive analytics
- Mobile Optimization: Progressive Web App (PWA) capabilities
- Testing Suite: Comprehensive unit and integration test coverage