Vite + React + Tailwind project of the GLINTEX Inventory app.
apps/frontend– Vite + React clientapps/backend– Express + Prisma API (with WhatsApp automation)docker/– shared infra assets (Postgres init SQL)docs/– architecture notes and plans
npm install --workspaces
npm run dev:backend # starts API on http://localhost:4000
npm run dev:frontend # starts Vite on http://localhost:5173The frontend expects the backend on port 4000 by default. Override VITE_API_BASE if you bind the API elsewhere.
Spin up the entire stack (frontend, backend API, and PostgreSQL) with Docker:
docker compose build # build frontend/backend images
docker compose up -d # start db + backend + frontendServices will be available at:
- Frontend: http://localhost:4173
- Backend API: http://localhost:4001 (set
BACKEND_PORTif you need another host port) - PostgreSQL 17: localhost:5433 (
glintex/glintex) — override host binding viaPOSTGRES_PORT.
Environment knobs:
BARCODE_MATERIAL_CODE– override the defaultMETcode in generated barcodes.VITE_API_BASE– optional build arg that forces a specific API URL in the frontend bundle (defaults tohttp://localhost:4001to matchBACKEND_PORT).POSTGRES_PORT– change the host port that Postgres binds to (container still listens on 5432).BACKEND_PORT– change the backend’s host port (container stays on 4000); setVITE_API_BASEaccordingly if you override it.- When running the
frontend-devservice fromdocker-compose.override.yml, the Vite dev server binds tohttp://localhost:6173. SetHOST_IPto your LAN IP beforedocker compose up(e.g.,HOST_IP=192.168.0.50 docker compose up -d db backend frontend-dev) so other devices can hithttp://<HOST_IP>:6173andhttp://<HOST_IP>:4001.
Persistent data:
- Database storage lives in the
postgres-datanamed volume. - WhatsApp auth sessions persist in the
backend-whatsapp-authvolume so you only need to scan the QR code once per environment.
Use docker compose logs -f backend to watch the API (and WhatsApp) logs, and docker compose down -v if you need to reset all state.
npm run build
npm run preview- Data, theme, and branding are stored in localStorage (
glintex_db_v1,glintex_theme). - Upload your logo from Admin / Data → Branding. A default logo is included at
/public/brand-logo.jpg. - All create/update/delete actions are now captured in the backend
AuditLogtable. After pulling these changes, runcd apps/backend && npx prisma migrate dev(orprisma migrate deployin prod) so the new tables/columns (AuditLog, payload text) exist, then query them directly or vianpx prisma studiofor a full history of changes. - Barcode workflow: every inbound roll now receives a barcode (
INB-MET-<lot>-<piece>). Each issue transaction generates a single barcode (ISM-MET-<lot>-<piece>)—print as many stickers as needed at issue time and apply them to all crates born from that roll. The manual receive screen accepts that barcode to auto-fill the piece/lot and still prints the warehouse label (REC-<lot>-<piece>-C###) for finished goods. Stock rows expose printable barcode links, and/api/barcodes/render?code=...returns the image for any code. - You can override the default material code (
MET) used inside barcodes by settingBARCODE_MATERIAL_CODE=XYZinapps/backend/.envbefore starting the server. - Database migrations added for audit payload text and single-issue barcodes. Apply them with:
(Use
cd apps/backend npx prisma migrate devprisma migrate deployin production.)