Skip to content

Repository files navigation

Warehouse In/Out Tracker

A mobile-first web app for tracking warehouse goods in and out using AI-powered document extraction.

Setup

1. Create Supabase Project

  1. Create a new organization in Supabase (free tier allows 2 projects per org)
  2. Create a new project
  3. Note your project URL and anon key

2. Initialize Supabase Locally

npm install -g supabase
supabase link --project-ref YOUR_PROJECT_REF
supabase db pull  # Downloads remote schema

3. Environment Variables

Create .env.local:

VITE_SUPABASE_URL=https://YOUR_PROJECT.supabase.co
VITE_SUPABASE_ANON_KEY=YOUR_ANON_KEY

4. Deploy Edge Functions

supabase functions deploy extract-delivery-note

Set the OPENAI_API_KEY secret in Supabase dashboard:

supabase secrets set OPENAI_API_KEY=sk-...

5. Create Storage Bucket

In Supabase dashboard → Storage, create a bucket named documents with public access disabled.

6. Set Up Authentication

In Supabase dashboard → Auth:

  1. Create a test user (Email/Password)
  2. For production, configure your preferred auth method

7. Install & Run

npm install
npm run dev

Open http://localhost:5173

Project Structure

├── src/
│   ├── components/      # React components (Camera, Confirm, Log, Auth)
│   ├── lib/
│   │   ├── supabase.ts  # Supabase client & functions
│   │   └── auth.ts      # Auth helpers
│   ├── App.tsx          # Main app flow
│   └── main.tsx
├── supabase/
│   ├── migrations/      # Database schema
│   ├── functions/
│   │   └── extract-delivery-note/  # Vision extraction function
│   └── config.toml
└── index.html

How It Works

  1. Capture: User takes a photo of a delivery note
  2. Extract: Edge function calls OpenAI GPT-4V with the image
  3. Match: System searches for matching open "in" records by delivery/order number
  4. Confirm: User reviews extracted data and confirms/edits
  5. Save: Document and items are saved; if it's an "out", it's linked to matching "in"

Features

  • Mobile-first UI: Large buttons, camera integration, simple navigation
  • Bi-lingual documents: Handles Onninen, Ahlsell, and other Finnish supplier formats
  • In/Out matching: Automatic candidate matching with user confirmation
  • Editable extraction: User can fix OCR/extraction errors before saving
  • Document log: Recent in/out events displayed on home screen

Future Enhancements

  • Multi-user roles and permissions
  • Reporting and inventory dashboards
  • CSV export
  • Partial delivery handling
  • Barcode scanning fallback

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages