Metromart is an enterprise-grade supermarket management solution designed to streamline fast, reliable, and scalable handling of all major retail processes. This project emphasizes robust database architecture to ensure integrity, normalization, and efficient data operations for large-scale supermarket chains and hypermarkets.
MetroMart aims to provide features such as:
- Secure user authentication and profile management
- Comprehensive entity-relationship (ER) modeling for full retail workflows
- Multi-entity design for products, inventory, customers, suppliers, staff, sales, returns, and procurement
- Efficient query and transaction support for thousands of daily operations
- Data integrity and referential integrity through enforced foreign keys
- User-friendly shopping cart and seamless checkout process
- Comprehensive product catalog with categories and detailed information
- Efficient inventory management system
Before using the application, you need to create the database tables. The application connects to Supabase Postgres.
- Open your Supabase project dashboard
- Go to the SQL Editor
- Copy and paste the contents of
schema.sql - Execute the script to create all tables, triggers, and constraints
- (Optional) Run the contents of
ddl.sqlto load sample data
Alternatively, if you have a local Postgres database configured, you can use:
npm run init-dbA ready-to-run Supabase/Postgres seeding script lives at scripts/sample_sales_seed.sql. To load sample invoices:
- Ensure at least one employee and one active product exist (customers are optional).
- Open the Supabase SQL editor and paste the file contents.
- Execute the script; it inserts three invoices plus associated line items, automatically calculating totals.
- (Optional) Run the commented
SELECTat the bottom to inspect the newly inserted rows.
The script is idempotent per execution (it always creates fresh invoices) and keeps the logic lightweight while demonstrating end-to-end sales data.
A simple seed script for suppliers is available at scripts/sample_suppliers_seed.sql. To populate test suppliers:
- Open the Supabase SQL editor and paste the file contents.
- Execute the script; it inserts five sample suppliers with contact information.
- Run the verification query at the bottom to confirm insertion.
This provides a foundation for testing supplier-related features and supply order management.