FloCafe
FloCafe는 구독 없이 무료로 주문·테이블·주방 디스플레이·로컬 데이터를 관리하는 로컬 퍼스트 레스토랑 POS입니다
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Warehouse stock app for MuscleIQ. Staff count racks, reserve and sell them, track containers coming in, and see the stock items that Shopify orders deduct from.
Shopify order paid
|
n8n "Muscle IQ Stock Automation (Database)" ----> Supabase (Postgres) <---- this app on Vercel
| the master copy staff phones, QR codes
n8n "Muscle IQ Stock Automation" --------------> Google Sheet (overwatch copy, unchanged)
api/db.js.| Path | What it is |
|---|---|
public/index.html | The app: all screens and their logic |
public/backend.js | Connects the app to /api/db, shows the passcode screen |
api/db.js | Server function: checks the passcode, calls the database |
supabase/migrations/ | The database tables and functions, in the order they were applied |
supabase/RUN_ONCE_in_sql_editor.sql | One-off script to paste into Supabase's SQL Editor (see below) |
n8n/ | The n8n workflow that deducts stock in the database |
| Table | Holds | Written by |
|---|---|---|
stock_items | The Shopify stock list: item code, name, count, alert level | n8n |
variant_mapping | Which items each Shopify variant takes off, and how many | You, by hand (keep in step with the sheet) |
processed_orders | Orders already counted, so none is counted twice | n8n |
stock_log | Every deduction with stock before and after | n8n |
app_docs | Rack counts, reserved/sold, containers, spare parts, history (and the retired Other stock tab's notes, kept for reference) | The app |
item_collections | Sections on the Shopify stock page (app only) | The app |
item_incoming | Shopify stock coming in (date, quantity, note) | The app |
alert_outbox | Every low-stock / below-zero alert sent | Database trigger |
app_backups | A full copy taken every night at 02:15 UTC, kept 30 days | Supabase schedule |
All tables are closed to Supabase's public API. Only the app's server function and n8n can reach them.
SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY.APP_PASSCODE under Settings > Environment Variables. Make it long; everyone with the link and passcode can change stock.Until steps 2 and 3 are done the site shows "Stock storage is not set up yet".
Paste supabase/RUN_ONCE_in_sql_editor.sql into Supabase > SQL Editor and run it. It adds the functions that save and remove entries, takes the first backup, and removes the setup-day test order. Until it has run, the app can show data but cannot save changes.
main and Vercel deploys. Other branches get their own preview address.Each item shows its count, any low-stock or coming-in notes, an Open button and a bell, the same as Other stock.
stock_items.stock_threshold, the same alert level n8n uses. "Turn alert off" sets alert_on to false.needs_decision) and the box at the top of the page asks to switch it to pre-order or keep it as stocked. Nothing switches by itself.Items are grouped into sections on the Shopify stock page. This grouping is for the app only: Shopify, n8n, the variant mapping and the sheet never see it.
item_collections and stock_items.collection_id.Remove from list in an item's Open pop-up hides it (stock_items.hidden); nothing is deleted. Hidden items leave the list, sections, search, summary and alerts, but n8n still deducts them if the variant mapping points at them (the confirmation says how many variants do). Removed items at the bottom of the tab brings them back. Permanent deletes are done in Supabase, after the item's mapping rows are removed.
The check runs inside the database (trigger stock_items_watch), so it catches orders from n8n and changes made in the app alike. Each alert is saved in alert_outbox and posted to the n8n workflow "Muscle IQ Stock Alerts (Database)", which emails [email protected]. The webhook address and its shared secret are in app_settings (not in this repo). To add WhatsApp later, add a step to that workflow.
The n8n order flow still sends its own low-stock email as well, kept for now for debugging.
App changes are not copied to the Google Sheet; update the sheet by hand if you want it to match.
Add SUPPLIER_PASSCODE in Vercel (Settings > Environment Variables), different from APP_PASSCODE, then redeploy. Someone who opens the site with it sees only Spare parts and can add, edit and delete parts there. The server sends that passcode no other data and refuses any other change, so hiding the tabs is not the only protection. Every Spare parts change (staff or supplier) adds a History line marked "Staff" or "Supplier". To cut suppliers off, change or delete the variable and redeploy. Leave it unset and nothing changes.
Shopify sends order webhooks straight to the Supabase Edge Function shopify-order-paid (code in supabase/functions/shopify-order-paid); n8n is no longer in the order path. Webhooks: Order payment (orders/paid) and Order creation (orders/create — only acted on when the order is already paid, e.g. TikTok Shop). Both point at the same function link, which includes the key stored in app_settings.shopify_webhook_token. Each order is recorded once in processed_orders, so getting both webhooks for one order never deducts twice. The deduction itself is the database function process_shopify_order.