A modern, feature-rich Point of Sale (POS) system built with React, TypeScript, and Supabase. Designed for retail businesses of all sizes with comprehensive inventory management, sales tracking, customer management, and analytics.
- Multi-tab Sales Interface - Handle multiple customers simultaneously with independent sales tabs
- Product Grid - Touch-friendly interface with product search, filtering, and categories
- Shopping Cart - Real-time cart management with discount application
- Multiple Payment Methods - Cash, card, and customer credit support
- Receipt Generation - Automatic receipt printing and email delivery
- Draft Sales - Save incomplete transactions for later completion
- Product Management - Add, edit, and organize products with SKU, barcode, and categories
- Stock Tracking - Real-time inventory tracking with low-stock alerts
- Weight-based Products - Support for products sold by weight (kg, lb, etc.)
- Batch Management - Track manufacturing dates, expiry dates, and supplier information
- Non-stock Items - Option to disable inventory tracking for service items
- Inventory Reports - Track stock levels, value, and movement
- Customer Database - Store customer information and purchase history
- Credit System - Customer credit accounts with spending limits
- Purchase History - Track customer transactions and preferences
- Customer Analytics - Insights into customer behavior and spending patterns
- Discount System - Flexible discount rules with conditions and automatic application
- User Management - Multi-user support with role-based permissions
- Sales Analytics - Comprehensive reporting with charts and insights
- Data Export - Export sales data to CSV for external analysis
- Touch Interface - Optimized for both desktop and touch devices
- Responsive Design - Works seamlessly on tablets, phones, and desktops
- Frontend: React 18, TypeScript, Vite
- Backend: Supabase (PostgreSQL database, Authentication, Real-time)
- Styling: Tailwind CSS
- Charts: Recharts
- Icons: Lucide React
- Date Handling: date-fns
- Build Tool: Vite
- Package Manager: npm
- Node.js (v18 or higher)
- npm or yarn
- Supabase account
-
Clone the repository
git clone https://github.com/iamchandira/nextera-pos-system cd pos
-
Install dependencies
npm install
-
Environment Configuration Create a
.env.local
file in the root directory:VITE_SUPABASE_URL=your_supabase_project_url VITE_SUPABASE_ANON_KEY=your_supabase_anon_key VITE_SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
-
Database Setup
Option A: Complete Database Initialization (Recommended)
Run the complete database setup script in your Supabase SQL editor:
-- Execute the complete initialization script -- Copy and paste the entire content from supabase_complete_init.sql
This script will:
- Create all required tables with proper structure
- Set up indexes for optimal performance
- Configure Row Level Security (RLS) policies
- Insert default data (categories, settings, sample discounts)
- Create necessary functions and triggers
Option B: Manual Database Setup
If you prefer manual setup, run these essential commands in your Supabase SQL editor:
-- Enable required extensions CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; CREATE EXTENSION IF NOT EXISTS "pgcrypto"; -- Create core tables (see supabase_complete_init.sql for full schema) -- Then add required columns and indexes: ALTER TABLE products ADD COLUMN IF NOT EXISTS track_inventory BOOLEAN DEFAULT true; -- Create performance indexes CREATE INDEX IF NOT EXISTS idx_products_active ON products(active); CREATE INDEX IF NOT EXISTS idx_products_category ON products(category); CREATE INDEX IF NOT EXISTS idx_sales_timestamp ON sales(created_at); CREATE INDEX IF NOT EXISTS idx_customers_name ON customers(name);
-
Initial Application Setup
After database setup, configure the application:
# Start the development server npm run dev
Navigate to the application and:
- Create Admin User: Register the first user
- Configure Store Settings: Go to Settings β Store Information
- Add Initial Products: Go to Inventory β Add Product
- Create User Accounts: Go to User Management to add cashiers/managers
-
Build for Production
npm run build
src/
βββ components/ # React components
β βββ auth/ # Authentication components
β βββ customers/ # Customer management
β βββ discounts/ # Discount management
β βββ inventory/ # Product and inventory management
β βββ layout/ # Layout components (Header, etc.)
β βββ pos/ # Core POS interface
β βββ reports/ # Analytics and reporting
β βββ settings/ # Application settings
β βββ transactions/ # Transaction history
βββ context/ # React Context providers
βββ lib/ # Utilities and services
βββ types/ # TypeScript type definitions
βββ main.tsx # Application entry point
βββ supabase_complete_init.sql # Complete database initialization script
supabase_complete_init.sql
- Complete database setup script that creates all tables, indexes, functions, triggers, and default data. Run this in your Supabase SQL editor for complete setup.
The application requires several tables in Supabase:
products
- Product catalog with inventorycustomers
- Customer informationsales
- Transaction recordsdiscounts
- Discount rules and promotionsusers
- User accounts and permissionsapp_settings
- Application configurationsales_tabs
- Multi-tab sales sessionsproduct_batches
- Batch tracking information
VITE_SUPABASE_URL
- Your Supabase project URLVITE_SUPABASE_ANON_KEY
- Your Supabase anonymous keyVITE_SUPABASE_SERVICE_ROLE_KEY
- Your Supabase service role key
- Initial Setup: Configure store information in Settings
- Add Products: Use Inventory Management to add your product catalog
- Create Users: Set up user accounts for cashiers and managers
- Start Selling: Use the POS terminal to process sales
Making a Sale:
- Select products from the product grid
- Adjust quantities in the shopping cart
- Apply discounts if applicable
- Select customer (optional)
- Choose payment method
- Complete transaction
Managing Inventory:
- Navigate to Inventory Management
- Add new products with details
- Set stock levels and minimum thresholds
- Configure weight-based or standard products
- Enable/disable inventory tracking as needed
Viewing Reports:
- Go to Reports & Analytics
- Select date range
- View sales trends, top products, and performance metrics
- Export data for further analysis
- Desktop Mode: Optimized for mouse and keyboard
- Touch Mode: Larger buttons and touch-friendly interface
- Configurable currency symbol and format
- Tax rate configuration
- Invoice number formatting
- Authentication: Handled by Supabase Auth
- Authorization: Role-based access control
- Data Protection: All data encrypted in transit and at rest
- Environment Variables: Sensitive data stored securely
npm run test
- Unit tests for utilities and services
- Component testing with React Testing Library
- Integration tests for key workflows
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature
- Commit changes:
git commit -am 'Add new feature'
- Push to branch:
git push origin feature/new-feature
- Submit a Pull Request
- Use TypeScript for all new code
- Follow ESLint configuration
- Use Prettier for code formatting
- Write tests for new features
- Browser: Modern browser with ES6+ support
- Screen Resolution: Minimum 1024x768 (responsive design)
- Internet: Required for Supabase connectivity
- Touch Screen: For optimal touch interface experience
- Receipt Printer: Thermal printer compatible with web printing
- Barcode Scanner: USB HID scanner for product lookup
Database Connection Errors:
- Verify Supabase URL and API key in environment variables
- Check Supabase project status
- Ensure database tables are created
Build Errors:
- Clear node_modules and reinstall:
rm -rf node_modules && npm install
- Update Node.js to latest LTS version
- Check for TypeScript errors:
npm run type-check
Performance Issues:
- Enable caching in production
- Optimize images and assets
- Check database query performance
For technical support or questions:
- Check the GitHub Issues page
- Review documentation
- Contact developer
License Terms:
This software is provided free of charge for personal, non-commercial use.
Commercial use, including but not limited to use in proprietary software, services for a fee, or redistribution for profit, is not permitted without prior written consent from the author.
To inquire about commercial licensing, please contact: info@iamchandira.com
- Personal learning and development
- Educational purposes
- Non-profit organizations
- Open source projects (with attribution)
- Commercial deployment without license
- Resale or redistribution for profit
- Integration into paid software or services
- Use in proprietary business applications
For questions about licensing terms or to request commercial usage rights, please reach out to info@iamchandira.com.
- Built with React
- Powered by Supabase
- Styled with Tailwind CSS
- Charts by Recharts
- Icons from Lucide
Version: 1.0.0
Last Updated: August 2025
Developed by: Chandira Ekanayaka
Contact: info@iamchandira.com