Skip to main content
File Transfer Pavan surfaces two AI-powered interfaces. The AI Chat Assistant answers questions and guides users through features, while the Analytics Dashboard visualizes upload and download data with Recharts. This page explains how both systems work and how you can use them.

AI Chat Assistant

The AI Chat Assistant lives in a floating widget on every page. You can ask it about features, troubleshooting steps, file sharing recommendations, and pricing. The widget supports quick replies, markdown rendering, and streaming responses from a Supabase Edge Function.

How It Loads for Performance

The chat widget is not loaded immediately. Instead, it uses requestIdleCallback to defer initialization until the browser is idle, with a 3000 ms fallback timeout.
The chat is also lazy-loaded via React.lazy(), so its JavaScript is fetched in a separate chunk only when the browser signals idle time.
Because the chat loads only when the browser is idle, it adds zero impact to initial page load and keeps your Largest Contentful Paint fast.

Chat Components

The chat lives in src/components/chat/ and is built with Framer Motion, Lucide icons, and shadcn/ui. Quick replies cover uploads, size limits, secure sharing, pricing, file expiration, and PIN access. Responses are streamed token by token from the ai-chat Supabase Edge Function.

Analytics Dashboard

The Analytics Dashboard visualizes your file activity. You can toggle between a 7-day and 30-day view. It tracks views, downloads, and trending patterns.
1

Log in and open the Dashboard

Log in to your account and visit /dashboard. The analytics section loads automatically under the Analytics tab.
2

Review upload statistics

The dashboard shows total files uploaded, total storage used, and categorization by file type and upload date.
3

Check download analytics

Every download increments download_count on the uploaded_files table. Per-file download totals are shown alongside the download trend line.
4

Explore user analytics

Admins can view total users and active users from the admin panel. End users see their own file activity only.
5

Monitor system health

Admins can open the System Health Monitor inside the admin dashboard to review storage usage and database stats.

Recharts Visualizations

The dashboard uses Recharts for data visualization.

Bar Charts

Show uploads over time grouped by day or date range.

Line Charts

Show download trends across the selected 7-day or 30-day window.

Pie Charts

Can be used to break down file types by volume or count.

Stat Cards

Surface totals for views, downloads, and percentage trends at a glance.

File Download Tracking

When someone downloads a file, two things happen:
  1. download_count is incremented on the uploaded_files row.
  2. An event is recorded in the file_analytics table with the event type download, timestamp, IP address, and user agent.
The file_analytics table also records view events, so you can distinguish a page view from an actual download. The get_user_file_analytics RPC function returns this data grouped by date for charting.

Admin Analytics Panel

Admins have access to an extended analytics panel inside AdminDashboard.tsx. It surfaces six management modules.

User Management Stats

Track total signups, active sessions, and user growth over time.

File Moderation Queue

Review and approve or remove files flagged for moderation.

System Health Monitor

Review storage usage, database connection health, and edge function status.

Bulk Notifications

Send notifications to all users or targeted segments.

Payment and Billing

Manage premium plan purchases and refund status inside Razorpay flows.

Audit Logs

Review every admin action stored in the audit_logs table, including action type, target, and details.