velvet-inventory

byTest

Build a complete mobile-first POS + Inventory + QR Label + Serial Tracking system using Expo (React Native). The app must be fully functional, offline-first, and production-ready with real logic (no placeholders). ==================================================== SYSTEM OVERVIEW ==================================================== This system manages SERIAL-LEVEL inventory with QR-based tracking. Each unit is uniquely tracked using a globally continuous serial number. Full flow: QR Label → Purchase (Stock In) → Inventory → Sales → Invoice → Transactions → Reports ==================================================== DATABASE DESIGN (STRICT) ==================================================== products: id name sku (unique) price created_at purchases: id created_at purchase_items: id purchase_id product_id serial_number (UNIQUE GLOBAL) batch price status (AVAILABLE / SOLD) created_at sales: id invoice_number (AUTO GENERATED, UNIQUE) created_at sales_items: id sale_id purchase_item_id price created_at business_details: id name phone address gst logo (image path/base64) signature (image path/base64) qr_settings: id same_fields (boolean) label_fields (JSON) qr_fields (JSON) IMPORTANT RULES: - Inventory is SERIAL-BASED - DO NOT store quantity in products - Quantity = COUNT(purchase_items WHERE status='AVAILABLE') - Serial number must be globally continuous (SN00001, SN00002… no reset per product) - One purchase = one bill - One sale = one bill ==================================================== 1. INVENTORY MODULE (STOCK TAB) ==================================================== - Add / edit / delete products - Auto-create product if not exists during scan or QR generation - SKU: - Auto or manual - Reuse if product exists - Show: - Total products - Available stock (count AVAILABLE serials) - Sold stock - Product detail: - List of serials (available + sold) ---------------------------------------------------- SCAN TO ADD STOCK ---------------------------------------------------- - Scan QR - If product does not exist → AUTO CREATE - Insert new purchase_item - Assign next global serial number ==================================================== 2. PURCHASE SYSTEM (GROUPED BILL) ==================================================== - One purchase = one bill - Multiple products inside Example: Biscuit (5) Honey (10) System must: → create 15 purchase_items → all under ONE purchase_id Each unit: - serial_number - batch - price ==================================================== 3. QR LABEL GENERATOR (CORE FEATURE) ==================================================== MULTI-PRODUCT INPUT: User can add multiple products in one batch: Example: Biscuit (5) Honey (10) FIELDS: - product_name - sku (auto/manual) - price - batch - starting_serial (optional) - quantity ---------------------------------------------------- SERIAL NUMBER LOGIC ---------------------------------------------------- - Format: SN00001, SN00002... - MUST be globally continuous across ALL products - Example: Biscuit 5 → SN00001–SN00005 Honey 10 → SN00006–SN00015 ---------------------------------------------------- QR DATA FORMAT (DYNAMIC JSON) ---------------------------------------------------- Example: { product_name, sku, price, batch, serial_number } Fields must be dynamically controlled by settings ---------------------------------------------------- LABEL DESIGN ---------------------------------------------------- Each label contains: - QR code - Selected text fields (dynamic) ---------------------------------------------------- A4 PDF GENERATION ---------------------------------------------------- - Grid layout (e.g., 24 labels/page) - Fill left → right → top → bottom - Combine multiple products in same pages - No empty spaces - Multi-page support ---------------------------------------------------- PREVIEW ---------------------------------------------------- - Show total labels - Show total pages ---------------------------------------------------- INVENTORY INTEGRATION ---------------------------------------------------- Toggle: [✓] Add to Inventory If enabled: → Create ONE purchase → Insert ALL units into purchase_items ==================================================== 4. SALES MODULE (CORE ENGINE) ==================================================== - Create ONE sale (bill) - Add items via: - QR scan (auto add) - Manual serial entry ---------------------------------------------------- SCAN FLOW ---------------------------------------------------- - Scan QR → extract serial_number - Find purchase_item IF: - AVAILABLE → add to cart - SOLD → show error ---------------------------------------------------- CART SYSTEM ---------------------------------------------------- - Each item = 1 serial - No quantity field ---------------------------------------------------- CHECKOUT ---------------------------------------------------- - Create ONE sale - Generate invoice_number automatically (e.g., INV-0001) - Insert multiple sales_items - Update: purchase_items.status = SOLD ---------------------------------------------------- IMPORTANT ---------------------------------------------------- - Invoice must be auto-created and saved silently - DO NOT show popup to generate invoice ==================================================== 5. INVOICE SYSTEM ==================================================== - Invoice is auto-created at checkout - Stored in system ---------------------------------------------------- ACCESS INVOICE ---------------------------------------------------- - Only accessible from Transactions tab ---------------------------------------------------- INVOICE DESIGN ---------------------------------------------------- Professional PDF: - Business logo - Business details - Customer placeholder (optional) - Product list - Serial numbers - Price per unit - Total amount - Invoice number - Date - Signature / stamp ==================================================== 6. TRANSACTIONS TAB (SALES LOG) ==================================================== - Unified system: - Sales - Purchases ---------------------------------------------------- FEATURES ---------------------------------------------------- - Filter: - Date range - Type (sale/purchase) - Search: - Invoice number - Product - Serial number ---------------------------------------------------- SCAN TO FIND SALE ---------------------------------------------------- - Scan QR - Show: - Product details - Purchase info - Sale invoice (if sold) ---------------------------------------------------- EXPORT ---------------------------------------------------- - Export Sales PDF - Export Purchase PDF - Based on selected date range ==================================================== 7. DASHBOARD (HOME TAB) ==================================================== Show: - Total sales amount - Total transactions - Total products - Available stock - Sold items - Recent sales preview ==================================================== 8. SETTINGS TAB ==================================================== ----------------------------------- 1. BUSINESS INFORMATION ----------------------------------- - Name - Phone - Address - GST - Upload: - Logo - Signature / Stamp ----------------------------------- 2. DATA MANAGEMENT ----------------------------------- - Export full database (JSON) - Import JSON backup - Reset data (optional) ----------------------------------- 3. QR CODE GENERATE SETTINGS ----------------------------------- FIELD TOGGLES: [✓] Product Name (required) [✓] SKU [✓] Price [✓] Batch [✓] Serial Number [ ] Variant [ ] MFG Date [ ] EXP Date ----------------------------------- MODE: ----------------------------------- (•) Same fields for Label & QR ( ) Separate configuration If separate: - Label fields - QR fields ----------------------------------- BEHAVIOR: ----------------------------------- - QR generator must read settings - Only selected fields: → encoded in QR → printed on label - Settings must persist ==================================================== TECH REQUIREMENTS ==================================================== - Expo (React Native) - expo-sqlite (database) - expo-camera (QR scanner) - expo-print (PDF) - expo-sharing - expo-file-system UI: - Bottom Tabs: Home | Sales | Stock | Sales Log | Settings - Mobile-first design - Fast scanning experience ==================================================== OUTPUT REQUIREMENTS ==================================================== - Full folder structure - All screens implemented - Database setup - Fully working logic (NOT pseudo code) - Ready to run in Expo ==================================================== STRICT RULES ==================================================== - Do NOT skip any module - Do NOT store quantity directly - Do NOT break serial sequence - Do NOT hardcode QR fields - Maintain full data consistency - Ensure complete flow from QR → Sale → Invoice → Report

No preview

Comments (0)

No comments yet. Be the first!

System Requirements

System Requirement Document

System Requirements Document (SRD) for Velvet-Inventory

1. Introduction

The Velvet-Inventory project is a mobile-first, offline-capable Point of Sale (POS) and inventory management system designed for personal use. It integrates QR-based tracking, serial-level inventory management, and a robust purchase-to-sale workflow. The app is built using Expo (React Native) and is tailored for single-user operation, with all settings applied globally. The system is designed to function entirely offline, ensuring seamless operation without requiring internet connectivity.

This document outlines the system's requirements, features, and design principles to guide its development.

Page 1 of 8

2. System Overview

The Velvet-Inventory system is a comprehensive solution for managing inventory at the serial number level. It enables users to track individual units of products through QR codes, from purchase to sale. The app is designed to be offline-first, ensuring all features, including QR/barcode scanning, inventory management, sales, and purchases, work without internet connectivity.

Key features include:

  • QR label generation for serial-level tracking.
  • Purchase and sales modules with automatic serial number assignment.
  • Real-time inventory updates based on serial status (available/sold).
  • Professional invoice generation and transaction logging.
  • A dashboard for quick insights into sales, stock, and transactions.

The system is optimized for personal use, with no user login or multi-user functionality. All settings are global and persist across sessions.

3. Functional Requirements

Page 2 of 8

Inventory Module (Stock Tab)

  • As a User, I should be able to add, edit, and delete products.
  • As a User, I should be able to auto-create products during QR generation or scanning if they do not exist.
  • As a User, I should be able to view total products, available stock, and sold stock.
  • As a User, I should be able to view product details, including a list of serials (available and sold).
  • As a User, I should be able to scan QR codes to add stock and assign globally continuous serial numbers.

Purchase System

  • As a User, I should be able to create a single purchase bill containing multiple products.
  • As a User, I should be able to assign serial numbers, batch numbers, and prices to each unit in a purchase.

QR Label Generator

  • As a User, I should be able to generate QR labels for multiple products in one batch.
  • As a User, I should be able to configure QR data fields dynamically.
  • As a User, I should be able to preview labels and pages before generating a PDF.
  • As a User, I should be able to generate A4 PDFs with grid layouts for QR labels.
Page 3 of 8

Sales Module

  • As a User, I should be able to create a single sale bill containing multiple items.
  • As a User, I should be able to add items to the cart via QR scanning or manual serial entry.
  • As a User, I should be able to automatically generate an invoice at checkout.
  • As a User, I should be able to update the status of sold items in the inventory.

Invoice System

  • As a User, I should be able to access invoices from the Transactions tab.
  • As a User, I should be able to generate professional PDF invoices with business details, product lists, and serial numbers.

Transactions Tab

  • As a User, I should be able to view and filter transactions by date range and type (sale/purchase).
  • As a User, I should be able to search transactions by invoice number, product, or serial number.
  • As a User, I should be able to export sales and purchase reports as PDFs.

Dashboard (Home Tab)

  • As a User, I should be able to view total sales, total transactions, total products, available stock, and sold items.
  • As a User, I should be able to view a preview of recent sales.
Page 4 of 8

Settings Tab

  • As a User, I should be able to configure business information (name, phone, address, GST, logo, and signature).
  • As a User, I should be able to export and import the database as JSON.
  • As a User, I should be able to reset all data.
  • As a User, I should be able to configure QR code generation settings globally.

4. User Personas

  1. User (Single User)
    • Role: The sole operator of the app.
    • Needs: Manage inventory, generate QR labels, track purchases and sales, and access reports.
    • Characteristics: Tech-savvy, operates in a small-scale business or personal capacity, values offline functionality.

5. Visuals Colors and Theme

Color Palette

The Velvet-Inventory app will feature a sleek, professional, and modern color scheme to enhance usability and visual appeal:

  • Background: #F4F4F9 (soft light gray)
  • Surface: #FFFFFF (pure white)
  • Text: #333333 (deep charcoal)
  • Accent: #FF6F61 (vibrant coral)
  • Muted: #B0BEC5 (soft blue-gray)
Page 5 of 8

6. Signature Design Concept

Interactive QR Universe Landing Page

The home screen will feature an interactive QR universe design. Users will see a dynamic grid of QR codes floating in a 3D space. Each QR code represents a product or transaction.

  • Interactions: Users can tap on a QR code to zoom in and view details about the product or transaction it represents.
  • Animations: The QR codes will gently rotate and pulse, creating a futuristic and engaging effect.
  • Transitions: Smooth transitions will guide users from the QR universe to specific modules like inventory or sales.
  • Color Shifts: The background will subtly shift between shades of the accent color (#FF6F61) and muted tones (#B0BEC5) to create a calming yet dynamic experience.

This design will make the app feel modern and unique, leaving a lasting impression on users.

7. Non-Functional Requirements

  • The app must be fully functional offline.
  • All data must persist locally using expo-sqlite.
  • The app must load within 2 seconds on mid-range devices.
  • QR scanning must process codes within 1 second.
  • PDFs must generate within 5 seconds for up to 100 labels or transactions.

8. Tech Stack

Page 6 of 8

Frontend

  • React Native (Expo)

Backend

  • Python (for any future backend needs)
  • FastAPI (optional for local API handling)

Database

  • SQLite (via expo-sqlite)

AI Tools

  • Not applicable for this project.

Local Orchestration

  • Docker (for development environment setup)

9. Assumptions and Constraints

  • The app is designed for single-user, personal use.
  • No internet connectivity is required; all features must work offline.
  • No user login or multi-user functionality is needed.
  • All settings are global and persist across sessions.
  • Serial numbers must remain globally continuous.
Page 7 of 8

10. Glossary

  • QR Code: A machine-readable code containing product or transaction data.
  • Serial Number: A unique identifier for each unit of a product.
  • SKU: Stock Keeping Unit, a unique identifier for products.
  • Offline-First: A design principle where the app functions fully without internet connectivity.

This document provides a comprehensive guide for developing the Velvet-Inventory system. Let me know if there are any additional details you'd like to include, Test!

Page 8 of 8

No completed page designs yet.

Completed design pages will appear here when they are ready to preview.

No user flows yet.

The User Flow Agent will generate per-persona navigation diagrams after SRD updates.

No completed page designs yet.

Completed design pages will appear here when they are ready to preview.

No user flows yet.

The User Flow Agent will generate per-persona navigation diagrams after SRD updates.