DigiFlow is a monorepo of business-management applications built with a Spec-Driven Development (SDD) workflow. Each app lives in its own directory, shares a common Supabase backend, and follows a consistent spec → plan → tasks → implementation cycle.
Repository Structure
DigiFlow/
├── warehouse-inventory/ # App 001 — StockFlow (Inventory + PoS)
│ ├── src/
│ │ ├── app/ # Next.js 14 App Router pages & API routes
│ │ ├── components/ # Shared UI components
│ │ ├── lib/ # Supabase clients, utilities
│ │ └── types/ # TypeScript interfaces
│ ├── supabase/
│ │ ├── migrations/ # SQL schema migrations
│ │ └── seeds/ # Sample / demo data
│ └── public/
├── specs/ # Feature specifications
│ ├── 001-warehouse-inventory/
│ └── 002-pos/
├── history/ # Prompt History Records (PHRs)
│ └── prompts/
├── .specify/ # SpecKit templates & scripts
├── CLAUDE.md # AI agent rules (Spec-Driven Dev)
└── README.md
Apps
001 · StockFlow — Warehouse Inventory Manager
warehouse-inventory/
A full-featured inventory management system for warehouse operations.
| Feature | Description |
|---|---|
| Dashboard | Live KPIs — total products, inventory value, low-stock alerts, recent transactions |
| Products | CRUD with category, location, barcode, supplier, cost & unit price |
| Transactions | Stock IN / OUT / ADJUSTMENT with full audit history |
| Categories | Hierarchical product categories |
| Locations | Zone → Aisle → Shelf → Bin warehouse mapping |
| Reports | Inventory valuation & low-stock reports with CSV export |
002 · PoS — Point of Sale
warehouse-inventory/(integrated into the same Next.js app)
A checkout and sales management system for shop-floor staff.
| Feature | Description |
|---|---|
| Checkout | Two-panel UI — product autocomplete search, cart management |
| Stock sync | Auto-decrements inventory and logs an OUT transaction on every sale |
| Discounts | Fixed (₨) or percentage (%) discount per bill |
| Customers | Optional customer selection per sale with full CRUD management |
| Receipts | A5 print-ready receipt with auto-print on bill posting |
| Sales history | Paginated sales list with discount, total, and customer details |
| Dashboard | PoS sales appear in the main dashboard's Recent Transactions |
Tech Stack
| Layer | Technology |
|---|---|
| Framework | Next.js 14 (App Router, Server Components) |
| Language | TypeScript |
| Styling | Tailwind CSS + shadcn/ui |
| Database | Supabase (PostgreSQL + Row Level Security) |
| Auth | Supabase Auth (service-role admin client for server ops) |
| Icons | Lucide React |
| Currency | PKR — Pakistani Rupees (₨) |
Getting Started
Prerequisites
- Node.js 18+
- A Supabase project with the migrations applied
1. Clone the repo
git clone https://github.com/tayyabfayyaz/DigiFlow.git
cd DigiFlow
2. Set up the Inventory app
cd warehouse-inventory
npm install
3. Configure environment
Create warehouse-inventory/.env.local:
NEXT_PUBLIC_SUPABASE_URL=https://<your-project>.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=<anon-key>
SUPABASE_SERVICE_ROLE_KEY=<service-role-key>
4. Run database migrations
In your Supabase SQL Editor, run these files in order:
| File | Purpose |
|---|---|
warehouse-inventory/supabase/migrations/002_pos_schema.sql |
PoS tables (customers, sales, sale_items) |
warehouse-inventory/supabase/seeds/001_sample_products.sql |
205 sample products (optional) |
5. Start the development server
cd warehouse-inventory
npm run dev
Open http://localhost:3000.
Feature Specs
Each feature follows the SDD lifecycle. Specs live under specs/<feature>/.
| ID | Feature | Spec | Plan | Tasks |
|---|---|---|---|---|
| 001 | Warehouse Inventory | spec | plan | tasks |
| 002 | Point of Sale | spec | plan | tasks |
Development Workflow
This project follows Spec-Driven Development (SDD):
- Spec — define user stories and acceptance criteria (
/sp.spec) - Plan — architecture decisions, file map, DB schema (
/sp.plan) - Tasks — testable implementation steps (
/sp.tasks) - Red — write failing tests
- Green — implement until tests pass
- Refactor — clean up without breaking tests
Every user prompt is recorded as a Prompt History Record (PHR) under history/prompts/.
Roadmap
| ID | Feature | Status |
|---|---|---|
| 001 | Warehouse Inventory Manager | ✅ Complete |
| 002 | Point of Sale (PoS) | ✅ Complete |
| 003 | Purchase Orders | 🔜 Planned |
| 004 | Supplier Management | 🔜 Planned |
| 005 | Staff & Roles | 🔜 Planned |
Author
Tayyab Fayyaz — tayyabfayyaz
Built with Claude Code using Spec-Driven Development.