Overview
The dashboard displays four key metrics in real-time:- Today’s Sales: Total revenue generated today
- Total Sales: Cumulative revenue across all time
- Transactions: Total number of completed sales
- Products: Number of products in your inventory
Real-time Metrics
Sales data updates automatically as transactions are completed
Quick Actions
Navigate to POS, Products, or Reports with one click
Recent Activity
View the last 5 transactions instantly
Offline Ready
All data loads from IndexedDB even without internet
Key Features
Statistics Cards
The dashboard calculates and displays metrics by querying the local IndexedDB database:js/dashboard.js
The dashboard uses the
money() utility function to format currency values to 2 decimal places consistently throughout the app.Recent Transactions
The dashboard shows the 5 most recent transactions in reverse chronological order:js/dashboard.js
Quick Actions
Three prominent action buttons provide quick navigation to:- New Sale - Open the POS interface to process a transaction
- Add Product - Navigate to product management to add new items
- View Reports - Access sales reports and analytics
User Workflow
Typical Dashboard Usage
Typical Dashboard Usage
- User opens the app and lands on the dashboard
- Dashboard loads sales and product data from IndexedDB
- Metrics are calculated and displayed within milliseconds
- User can:
- Review today’s performance vs total sales
- Check recent transaction details
- Navigate to other sections via quick actions
- Data refreshes automatically when returning from other pages
Data Sources
The dashboard retrieves data from two IndexedDB stores:- products store: Provides the total product count
- sales store: Provides all transaction data for metrics and recent activity
All database operations are asynchronous and use Promises, ensuring the UI remains responsive even with large datasets.
Performance Considerations
- Fast Loading: IndexedDB queries are optimized to load only necessary data
- No Network Dependency: All data is local, eliminating network latency
- Efficient Filtering: Today’s sales are filtered in-memory using JavaScript Date objects
- Minimal Re-renders: The dashboard only updates when explicitly loaded
Related Pages
- Database API - Learn about data storage and retrieval
- POS Interface - Process sales transactions
- Sales Reports - Detailed analytics and exports