AI-powered voice stock entry app for construction sites.
- Worker taps the mic and says e.g. "Sika Boom, job 2847, 3 cans, taken by Dave"
- OpenAI matches the product, extracts job/qty/name
- If ambiguous (e.g. "Sikadur UA" could be 4L or 8L) the worker taps the right one
- Worker reviews and confirms — entry saves to PostgreSQL
- Admin exports to CSV in the stock book import format
Item Code | Date | Job | Supplier | Description | Cost Quantity | Unit | Comments
cd stockbook
git init
git add .
git commit -m "Initial commit"
# Create a new repo on github.com, then:
git remote add origin https://github.com/YOUR_USERNAME/sansom-stockbook.git
git push -u origin main- Go to railway.app and click New Project
- Select Deploy from GitHub repo → choose your new repo
- Railway will detect the Dockerfile and start building
- In your Railway project, click + New → Database → PostgreSQL
- Railway will auto-inject the
DATABASE_URLenvironment variable
In Railway → your web service → Variables, add:
| Variable | Value |
|---|---|
OPENAI_API_KEY |
Your OpenAI API key (from platform.openai.com) |
DATABASE_URL |
Auto-injected by Railway PostgreSQL plugin |
Railway auto-deploys on every push to main. Your app will be live at the Railway-provided URL (e.g. sansom-stockbook.up.railway.app).
cd backend
pip install -r requirements.txt
export DATABASE_URL="postgresql://user:pass@localhost/stockbook"
export OPENAI_API_KEY="sk-..."
uvicorn main:app --reloadcd frontend
npm install
npm run dev
# Runs on http://localhost:5173 with API proxy to :8000The product catalogue is embedded in backend/main.py in the PRODUCTS list.
To add or update products, edit that list and redeploy (just push to GitHub).
- Voice uses the browser's built-in Web Speech API — works best in Chrome on Android or desktop
- Safari on iOS has limited support; recommend Chrome
- The
en-NZlocale is set for New Zealand English recognition