An intelligent analytics platform that transforms your databases into interactive AI-powered dashboards
- Overview
- Features
- Tech Stack
- Getting Started
- Project Structure
- Key Features Details
- Usage Guide
- Architecture
- API Integration
- Contributing
- License
AI Analytics Client is a modern, cutting-edge web application that revolutionizes data analytics by combining the power of AI with interactive visualizations. Connect your databases, and let AI automatically generate insights, relationships, and beautiful analytics dashboardsβall through a conversational interface.
This is the frontend client built with React, TypeScript, and modern web technologies, designed to provide a seamless, premium user experience with stunning UI/UX.
- π€ AI-Powered Analytics: Automatically generate insights and dashboards from your data
- π¬ Conversational Interface: Chat with your data using natural language
- π Multi-Database Support: Connect to various database systems (PostgreSQL, MySQL, etc.)
- π Interactive Dashboards: Drag-and-drop customizable analytics panels
- π¨ Premium UI/UX: Modern design with smooth animations and dark mode support
- π Secure Authentication: Built with Supabase authentication
-
Datasource Management
- Connect multiple databases (PostgreSQL, MySQL, MongoDB, etc.)
- Auto-generate database schemas
- AI-powered relationship detection
- Semantic layer generation for natural language queries
-
AI-Powered Dashboards
- Automatically generate analytics dashboards from database schemas
- Interactive chart panels (Bar, Line, Pie, Area, Scatter, etc.)
- Drag-and-drop grid layout for customization
- Real-time data querying and visualization
-
Conversational Analytics (Threads)
- Chat with your data using natural language
- AI interprets questions and generates SQL queries
- Streaming responses with real-time updates
- Context-aware conversations about your data
-
Theme Support
- Beautiful light and dark themes
- Smooth transitions and animations
- Premium glassmorphism effects
-
Authentication & Security
- Secure user authentication via Supabase
- Password reset functionality
- Protected routes and session management
- Responsive design for all screen sizes
- Framer Motion animations for smooth interactions
- Skeleton loaders for better perceived performance
- Toast notifications for user feedback
- Interactive modals and dialogs
- Custom scrollbars and hover effects
| Technology | Version | Purpose |
|---|---|---|
| React | 19.1.1 | UI Framework |
| TypeScript | 5.8.3 | Type Safety |
| Vite | 7.1.2 | Build Tool & Dev Server |
| TailwindCSS | 4.1.12 | Styling Framework |
| Redux Toolkit | 2.8.2 | State Management |
| React Router | 7.8.2 | Routing |
- Radix UI - Accessible component primitives
- Framer Motion (12.23.13) - Animation library
- Lucide React - Icon library
- class-variance-authority - Component variants
- tailwind-merge - Utility class merging
- Recharts (3.3.0) - Chart library
- React Grid Layout (1.5.2) - Draggable grid system
- @xyflow/react (12.8.6) - Node-based UI
- ai (5.0.92) - Vercel AI SDK for streaming
- react-markdown (10.1.0) - Markdown rendering
- react-syntax-highlighter - Code syntax highlighting
- shiki - Code highlighting with themes
- katex - Math rendering
- @supabase/supabase-js (2.57.4) - Backend & Auth
- RTK Query - API state management
- react-hook-form (7.62.0) - Form state management
- @rjsf/core - JSON Schema forms
- zod (4.1.8) - Schema validation
- ESLint - Code linting
- @vitejs/plugin-react-swc - Fast refresh with SWC
Before you begin, ensure you have the following installed:
- Node.js: Version 18.x or higher
- npm: Version 9.x or higher (comes with Node.js)
- Git: For cloning the repository
- Clone the repository
git clone <repository-url>
cd ai_analytics_client- Install dependencies
npm installCreate a .env.local file in the root directory with the following variables:
# Supabase Configuration
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_PUBLISHABLE_KEY=your_supabase_anon_key
# Analytics AI API
VITE_ANALYTICS_AI_API_URL=your_backend_api_urlNote: See
.env.examplefor reference. You'll need to set up a Supabase project and the corresponding backend API.
npm run devThe application will be available at http://localhost:5173
npm run buildThis creates an optimized production build in the dist folder.
npm run previewnpm run lintai_analytics_client/
βββ public/ # Static assets
β βββ ai_analytics_illustration.png
β βββ undraw_*.svg # Illustration assets
βββ src/
β βββ assets/ # Images, fonts, etc.
β βββ components/ # React components
β β βββ analytics/ # Dashboard & chart components
β β βββ auth/ # Authentication components
β β βββ chat/ # Chat interface components
β β βββ dashboard/ # Dashboard layout components
β β βββ datasources/ # Datasource management
β β βββ layout/ # App layout components
β β βββ main/ # Main page templates
β β βββ modals/ # Modal dialogs
β β βββ threads/ # Thread/chat components
β β βββ theme/ # Theme toggle components
β β βββ ui/ # Reusable UI components (52 components)
β βββ constants/ # App constants
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utility libraries
β β βββ supbaseClient.ts # Supabase client setup
β βββ pages/ # Page components
β β βββ dashboards/ # Dashboard pages
β β βββ datasources/ # Datasource pages
β β βββ threads/ # Thread pages
β β βββ signin/ # Sign in page
β β βββ signup/ # Sign up page
β β βββ forgot-password/ # Password recovery
β β βββ reset-password/ # Password reset
β β βββ page.tsx # Home page
β βββ providers/ # Context providers
β β βββ AuthProvider.tsx # Authentication provider
β βββ store/ # Redux store
β β βββ auth/ # Auth state & API
β β βββ common/ # Common API configuration
β β βββ dashboards/ # Dashboard state & API
β β βββ datasources/ # Datasource state & API
β β βββ threads/ # Threads state & API
β β βββ store.ts # Redux store configuration
β βββ types/ # TypeScript type definitions
β βββ App.tsx # Main App component
β βββ main.tsx # App entry point
β βββ index.css # Global styles
βββ .env.example # Environment variables template
βββ .gitignore # Git ignore rules
βββ components.json # shadcn/ui configuration
βββ eslint.config.js # ESLint configuration
βββ index.html # HTML entry point
βββ package.json # Dependencies & scripts
βββ tsconfig.json # TypeScript configuration
βββ tsconfig.app.json # App-specific TS config
βββ tsconfig.node.json # Node-specific TS config
βββ vite.config.ts # Vite configuration
βββ README.md # This file
Users can connect to various databases:
- Navigate to the home page
- Click "Add Datasource"
- Select database type (PostgreSQL, MySQL, etc.)
- Enter connection credentials
- AI automatically:
- Fetches database schema
- Generates table relationships
- Creates semantic layer for natural language queries
Key Files:
src/components/datasources/- UI componentssrc/store/datasources/datasources.api.ts- API endpoints
Once a datasource is connected:
- Click "Generate Analytics" on a datasource
- AI analyzes the database schema
- Automatically creates multiple chart panels
- Users can:
- Drag and drop panels to rearrange
- Resize panels
- Delete or refresh individual panels
Chart Types Supported:
- Bar Chart
- Line Chart
- Pie Chart
- Area Chart
- Scatter Plot
- Composed Charts
- And more...
Key Files:
src/components/analytics/charts/- Chart rendererssrc/components/dashboard/DashboardGrid.tsx- Grid layoutsrc/store/dashboards/dashboards.api.ts- Dashboard API
Chat with your data:
- Create a new thread
- Select a datasource
- Ask questions in natural language
- AI:
- Interprets your question
- Generates appropriate SQL queries
- Returns visualizations or data tables
- Maintains conversation context
Key Files:
src/components/threads/- Thread UI componentssrc/components/chat/- Chat interfacesrc/store/threads/threads.api.ts- Threads API
The app uses Redux Toolkit with RTK Query for efficient state management:
- Auth State: User authentication and session
- Datasources: Connected databases
- Dashboards: Dashboard configurations and panels
- Threads: Conversation threads
- Common: Shared API configuration with auto-reauth middleware
Key Files:
src/store/store.ts- Redux store configurationsrc/store/*/*.api.ts` - RTK Query endpoints
-
Sign Up
- Navigate to
/signup - Create an account with email and password
- Confirm email (if required by Supabase settings)
- Navigate to
-
Sign In
- Navigate to
/signin - Enter credentials
- You'll be redirected to the home page
- Navigate to
-
Connect Your First Datasource
- Click "Add Datasource" on the home page
- Fill in the connection form
- Wait for AI to process the schema
-
Generate Your First Dashboard
- Click on a connected datasource
- Click "Generate Analytics"
- Watch as AI creates visualizations!
-
Start a Conversation
- Create a new thread
- Select your datasource
- Ask questions about your data!
- Home (
/): Dashboard overview, datasources, and threads - Dashboard (
/dashboards/:id): View and interact with a specific dashboard - Datasource (
/datasources/:id): Manage a specific datasource - Thread (
/threads/:id): Chat interface for conversational analytics
The application follows a modular component architecture:
Components
βββ Pages (Route-level components)
βββ Templates (Page layouts)
βββ Organisms (Complex components)
βββ Molecules (Composite components)
βββ Atoms (Base UI components in /ui)
User Action β Component β Redux Action/RTK Query
β
API Middleware
β
Backend API
β
Update Redux State
β
Component Re-renders
1. User signs in β Supabase Auth
2. AuthProvider checks session
3. Protected routes validate authentication
4. API calls include auth token via middleware
5. Auto-refresh on token expiration
This frontend expects a backend API with the following endpoints:
POST /datasources/create- Create new datasourceDELETE /datasources/:id- Delete datasourcePOST /datasources/schemas- Fetch database schemaPOST /datasources/generate-relationships- AI relationship generationPOST /datasources/generate-semantics- AI semantic layer generationPOST /datasources/query- Execute database query
POST /chat/analytics- Generate AI analytics dashboard
Handled via Supabase directly from the client.
API base URL is configured in:
.env.localβVITE_ANALYTICS_AI_API_URLsrc/store/common/common.api.ts- RTK Query base configuration
The app supports light and dark themes:
- Theme Toggle: Available in the navigation bar
- Persistence: Theme preference saved to localStorage
- SSR-Safe: Theme applied before React hydration to prevent flash
Theme Implementation:
- Uses
next-themesfor theme management - TailwindCSS dark mode classes
- Custom CSS variables in
src/index.css
- TypeScript: Strict mode enabled
- ESLint: Used for linting
- File Naming:
- Components:
PascalCase.tsx - Utilities:
camelCase.ts - Styles:
kebab-case.css
- Components:
- Use functional components with hooks
- Prefer composition over inheritance
- Keep components small and focused
- Use TypeScript interfaces for props
- Implement proper loading and error states
- Use Redux for global state
- Use RTK Query for server state
- Use React hooks for local component state
- Implement optimistic updates where appropriate
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Ensure all ESLint rules pass:
npm run lint - Test your changes thoroughly
- Update documentation if needed
- Follow the existing code style
This project is currently unlicensed. Please contact the project owner for licensing information.
- Radix UI for accessible component primitives
- shadcn/ui for the component design system
- Vercel for the AI SDK
- Supabase for backend and authentication
- Recharts for beautiful data visualizations
- All open-source contributors
For issues, questions, or suggestions:
- Create an issue in the repository
- Contact the development team
Made with β€οΈ using React, TypeScript, and AI
