跳到正文
GitHub·· 8 天前AI 评分22

Kaya:面向餐饮业的免费开源自托管管理平台

davronsadullaev2017-sudo/kaya-fnb-free

AI 导读

前新加坡餐饮从业者发布开源餐厅管理平台 Kaya,采用 MIT 许可、可自托管,规划 14 个应用,目前 KayaRadar、KayaMise、KayaShift、KayaBrain 4 个已完整可用,KayaStock 等 4 个部分可用。

正文

Free, open-source restaurant software. Self-hosted. Built by someone who worked the floor.

License: MIT Stars Forks Issues PRs Welcome Contributors


🔥 Why This Exists

I spent 8+ years in Singapore F&B — as a Restaurant Supervisor, Assistant Restaurant Manager, and Floor in Charge. I've worked the pass during dinner rush, handled guest complaints at midnight, and done stock takes at 6 AM.

Here's what I learned the hard way:

  • Recipe costing is broken. Most restaurants track costs in spreadsheets that nobody updates. Food cost creeps up 2-3% and nobody notices until profit disappears.
  • Operations run on paper. Opening checklists get lost. Incident reports go to WhatsApp and vanish. SOPs sit in PDFs nobody opens.
  • Software is too expensive. Enterprise F&B platforms charge $500-$2,000/month. That's more than a full-time staff member's salary. Small operators get nothing.
  • AI is locked behind paywalls. The big platforms charge extra for "AI features." Meanwhile, if you're willing to run a model locally, you can get useful answers without paying anyone.

So I built Kaya. Not as a tech founder who read about restaurants — as someone who lived it.

I'm building it in the open, one app at a time. It is not finished, and I'm not going to pretend otherwise. See Current Status below.


🚀 What is Kaya?

Kaya is an open-source restaurant management platform. 14 applications under one system. Free. Self-hosted — your data stays on your server.

Kaya Traditional SaaS
Price $0 (self-hosted) $500–$2,000/month
Apps 14 planned, 4 working today 3–5 (separate purchases)
AI Built-in query engine; optional local or hosted model Extra cost
Open Source ✅ MIT License ❌ Proprietary
Self-hosted ✅ Free, unlimited ❌ Cloud-only
Data ownership ✅ Your server ❌ Their platform

Be clear-eyed about the trade-off: you get full control and no licence fee, but you host it yourself and it is early software. If you need a mature, supported product today, buy one.


🚦 Current Status (as of October 2026)

Kaya is early. I built the core myself and I'm being straight with you about what that means: some apps are fully working against a real database, and some are UI previews waiting for their backend. Here is exactly where things stand.

  • Fully functional (real backend + frontend + data): KayaRadar, KayaMise, KayaShift, KayaBrain — and limited KayaStock (reads real ingredients; no inventory tables to write to yet).
  • Partial — real reads, no dedicated backend yet.
  • UI preview — pages exist, backend not built.
  • Planned — what comes next.

✅ Fully functional — real backend, real data, real writes

App What actually works
KayaRadar Dashboard over live data: menu margins, open incidents, checklist progress, per-dish margin table
KayaMise Full recipe CRUD. Create/read/update/delete recipes and ingredients, auto-COGS from ingredient costs, menu-engineering classification (Star / Plowhorse / Puzzle / Dog)
KayaShift Real checklist workflow — toggle individual items, log completions, plus incidents and SOPs read from the database
KayaBrain Ask questions in plain language and get answers computed from your own data. Works with no model, or connect Ollama / any OpenAI-compatible API in Settings

🟡 Partial — real reads, no dedicated backend yet

App What works now What's missing
KayaStock Reads your real ingredient list by category with unit costs and suppliers Par levels, stock takes, reorder alerts — no inventory tables yet
KayaCellar Reads real beverage and high-cost ingredients, flags variance risk Bottle/bin-level tracking, by-the-glass reconciliation
KayaFlow Reads real ingredients grouped by supplier with landed cost Purchase orders, RFQs, receiving — no procurement tables yet
KayaBooks Computes real revenue, COGS, gross profit and food-cost % from your menu Period reports, daily sales import, exports

⚪ UI preview — pages exist, no dedicated backend yet

These render and are navigable, but their data is sample/derived rather than from purpose-built tables. They are honest previews of the intended shape.

App Intended purpose
KayaClub Loyalty — tiers, points, reward catalogue
KayaRoster Staff scheduling — shifts, leave, payroll export
KayaVoice Customer feedback and sentiment
KayaBook Table reservations and waitlists
KayaWaste Waste logging with reduction targets
KayaTrain Staff training modules and certifications

🔜 Planned

  • Inventory tables (par levels, stock takes) to complete KayaStock
  • Procurement tables (POs, receiving) to complete KayaFlow
  • Loyalty and reservations tables to lift KayaClub and KayaBook out of preview
  • Multi-outlet reporting

What this repo is not: a finished product. It is a working foundation — real auth, a real API, a real database, real tests — with four apps you can actually use today and a clear path for the rest.


✨ The 14 Applications

Core — Run Your Restaurant

App What It Does Status
KayaRadar Dashboard — margins, incidents, checklist progress ✅ Working
KayaMise Recipe database with auto-COGS and menu engineering ✅ Working
KayaShift Checklists, incident logs, SOP library ✅ Working
KayaBrain Ask plain questions, get answers from your data ✅ Working

Manage — Control Your Operations

App What It Does Status
KayaClub Loyalty — points, stamps, vouchers ⚪ UI preview
KayaCellar Beverage tracking — variance, by-the-glass 🟡 Partial
KayaFlow Procurement — supplier comparison, landed cost 🟡 Partial
KayaStock Inventory — par levels, reorder alerts 🟡 Partial
KayaRoster Staff scheduling — shifts, leave, payroll export ⚪ UI preview

Engage — Grow Your Business

App What It Does Status
KayaVoice Customer feedback — reviews, sentiment ⚪ UI preview
KayaBook Table reservations — waitlist, no-shows ⚪ UI preview
KayaWaste Waste tracking — by type, reduction targets ⚪ UI preview
KayaTrain Staff training — modules, certifications ⚪ UI preview

Finance — Know Your Numbers

App What It Does Status
KayaBooks Financial reports — P&L, daily sales, cost % 🟡 Partial

🎨 Design

  • Dark & Light mode — toggle with one click, persists across sessions
  • Premium gold/espresso color scheme — warm, professional, food-friendly
  • Linear-inspired dark UI with warm accents
  • Fully responsive — works on mobile, tablet, desktop
  • Smooth animations — scroll reveal, hover effects, micro-interactions

🛠 Tech Stack

Layer Technology Why
Frontend React 18 + React Router 7 + Vite 8 + plain CSS Fast, no build complexity, easy to theme
Backend Python + FastAPI Typed, self-documenting API
Database SQLite (one file) Local-first, zero config
AI Keyword + SQL query engine with MCP server; optional Ollama or OpenAI-compatible model Works with no model; plug one in when you want
Auth JWT (PyJWT) + bcrypt Stateless, standard
Deployment Docker or any static host One command, or free static hosting

📦 Quick Start

Before any real use: change the demo password and set a strong JWT_SECRET. The defaults exist so you can try it in 2 minutes — they are not safe for real data. See Security below.

Option 1: Docker (full app — recommended)

git clone https://github.com/davronsadullaev2017-sudo/kaya-fnb-free.git
cd kaya-fnb-free
docker compose up -d

Open http://localhost:8000 — the API and the React app are served together. Demo login: admin@kaya.example / kaya123.

Option 2: Local development

# Setup (once) — run from the repo root
python3 -m venv .venv
.venv/bin/pip install -r backend/requirements.txt

# Backend (terminal 1) — run from the repo root
.venv/bin/python -m uvicorn main:app --app-dir backend --reload
# -> http://localhost:8000  (API docs at /docs)

# Frontend (terminal 2)
cd frontend
npm install
npm run dev
# -> http://localhost:3000  (proxies /api to the backend)

Running the backend from the repo root with --app-dir backend avoids a RuntimeWarning about sys.prefix that a relative ../.venv/bin/python path triggers. The tests are run from the root for the same reason.

The database seeds itself with demo data on first boot, so every app has something to show immediately.

Option 3: Static preview site only

The docs/ folder holds the landing page and a static UI preview. Any static host (Vercel, Cloudflare Pages, GitHub Pages) can serve it:

  • Build command: echo 'Static site'
  • Publish directory: docs

Running the tests

.venv/bin/python -m pytest tests/ -q      # 66 tests

🔐 Security

Read this before putting real data in.

  • Change the demo password. admin@kaya.example / kaya123 exists so you can log in immediately. Change it before anyone else can reach the app.
  • Set a real JWT_SECRET. It must be at least 32 characters. The default in .env.example and docker-compose.yml is a placeholder.
    python3 -c "import secrets; print(secrets.token_urlsafe(48))"
  • Restrict CORS in production. The default allows any origin. Set CORS_ORIGINS to your real domain:
    CORS_ORIGINS=https://kaya.yourdomain.com
  • Put it behind HTTPS if it is reachable from the internet.
  • Passwords are hashed with bcrypt; API keys you enter for an AI provider are stored on your own server and never returned to the browser.
  • Keep SQLite backed up — it is a single file (kaya-fnb.db).

🔌 API

The API is documented automatically at /docs once the backend is running. A service banner is at /api. Endpoints:

Method Path Purpose
POST /api/auth/login Sign in, returns a JWT
GET /api/auth/me Current user
GET/POST /api/recipes/ List / create recipes
GET/PATCH/DELETE /api/recipes/{id} Read / update / delete a recipe
GET /api/recipes/meta/ingredients Ingredient list with suppliers
GET /api/recipes/meta/menu-engineering Star / Plowhorse / Puzzle / Dog classification
GET /api/ops/outlets Outlets
GET/POST /api/ops/checklists Checklists
PATCH /api/ops/checklists/{id}/items/{i} Toggle a checklist item
POST /api/ops/checklists/{id}/complete Log a completion
GET/POST /api/ops/incidents Incidents
GET/POST /api/ops/sops Standard operating procedures
POST /api/ai/ask Ask KayaBrain a question (model or built-in)
GET/PUT /api/ai/config Read / save the AI provider settings
POST /api/ai/test Test the configured model connection
GET /api/ai/tools List the Brain's tools
GET /api/ai/history Your question history

🧠 The AI layer — what it actually is

Two parts, and it's worth being precise about both.

1. The F&B Brain — a keyword + SQL query engine

backend/mcp/fb_brain.py answers questions by matching keywords and running SQL against your own database. No model is involved and none is required. Ask "what are the margins?" and it runs the margin query and returns your real numbers. This is the default and it works offline, for free, forever.

It is not a language model. It understands a defined set of topics — recipes, margins, costs, incidents, checklists, SOPs, alerts, daily digest. Ask it something outside those and it will say so rather than guess.

2. MCP server support

The same file is also a Model Context Protocol server over stdio, so an MCP client (Hermes, Claude, or your own) can call those queries as tools:

Tool Answers questions about
query_recipes margins, costs, dish list
query_ops incidents, checklists, SOPs
query_dashboard a summary of the whole operation
get_alerts low-margin dishes, overdue checklists
get_daily_digest today's activity

Try it directly:

.venv/bin/python backend/mcp/fb_brain.py --selftest

🤖 KayaBrain — optionally connecting a model

You do not need a model. KayaBrain works out of the box using the query engine above. Adding a model makes it more conversational — it can phrase answers naturally and handle looser phrasing — but it is an enhancement, not a requirement.

There is no bundled free model. If you want one, you supply it: either a local model via Ollama, or an API key you already have.

Where to configure it

Open the app → Settings → AI Provider. Editable in the browser, no files and no restart. A Test connection button reports exactly what's wrong.

Three modes

Mode What it is Needs
Built-in (default) Keyword + SQL query engine nothing
Ollama A model running on your own machine Ollama installed
OpenAI-compatible Any /v1/chat/completions endpoint URL + key

Option A — local model with Ollama (private, free)

# 1. Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

# 2. Pull a model
ollama pull llama3.2

# 3. In Kaya: Settings → AI Provider → pick "Ollama (local)" → Test → Save

Nothing leaves your network. Good for restaurants handling guest data.

Option B — hosted API

Pick a preset in Settings → AI Provider (OpenAI, Groq, Together, OpenRouter), paste your key, hit Test connection, then Save.

Any OpenAI-compatible endpoint works — including LM Studio and vLLM presets for running a model locally with the API key field left blank.

How the model is used

The model is given the query tools and chooses which to call. It then reads real figures from your database — it is never handed numbers to invent. If the model is unreachable, KayaBrain falls back to the built-in query engine automatically, so the assistant never stops working.

You can also seed the config with environment variables (see .env.example):

AI_PROVIDER=ollama
AI_BASE_URL=http://localhost:11434
AI_MODEL=llama3.2

The UI overrides the environment once you save.


🤝 Contributing — We Want Your Ideas

This is a community project. Whether you're a developer, designer, restaurant owner, or just have an idea — we want to hear from you.

Ways to Contribute

Contribution How
Code Fork → branch → PR. See CONTRIBUTING.md
Bug reports Open an issue with steps to reproduce
Feature ideas Open a discussion — we'll prioritize together
Design UI/UX improvements, new themes, mobile optimization
Documentation Fix typos, add examples, translate
Testing Manual testing, automated tests, edge cases
Feedback Tell us what works, what doesn't, what's missing

Good First Issues

Look for issues labeled good first issue — these are perfect for new contributors:

  • Add a new Kaya app
  • Improve existing UI components
  • Write tests
  • Add API endpoints
  • Create documentation
  • Fix bugs

Development Guidelines

  • Follow the existing code style
  • Write clear commit messages
  • Add tests for new features
  • Update documentation as needed
  • Keep PRs focused — one feature per PR

🏗 Architecture

kaya-fnb-free/
├── backend/
│   ├── main.py              # FastAPI app, routers, SPA serving
│   ├── db.py                # SQLite connection, schema bootstrap, demo seed
│   ├── security.py          # bcrypt hashing + JWT issue/verify
│   ├── schemas.py           # Pydantic request/response models
│   ├── settings_store.py    # key/value app settings (AI provider config)
│   ├── providers.py         # LLM provider layer (builtin / ollama / openai)
│   ├── requirements.txt
│   ├── api/
│   │   ├── auth.py          # login, /me, current_user + require_role guards
│   │   ├── recipes.py       # recipes CRUD, ingredients, menu engineering
│   │   ├── ops.py           # outlets, checklists, incidents, SOPs
│   │   └── ai.py            # /ask, /config, /test, /tools, /history
│   └── mcp/
│       └── fb_brain.py      # keyword+SQL query engine + MCP server (stdio)
├── frontend/
│   ├── index.html
│   ├── package.json
│   ├── vite.config.js       # dev server proxies /api to the backend
│   ├── public/favicon.svg
│   └── src/
│       ├── main.jsx         # entry, mounts <App/>
│       ├── App.jsx          # routes + auth gate
│       ├── Login.jsx        # sign-in screen
│       ├── styles.css       # theme tokens (dark + light)
│       ├── api/
│       │   ├── client.js    # fetch wrapper, token handling
│       │   └── auth.jsx     # auth context provider
│       ├── components/
│       │   ├── Sidebar.jsx  # nav + theme toggle
│       │   └── ui.jsx       # shared presentational pieces
│       └── pages/           # 14 Kaya apps + WhyKaya + Settings
├── database/migrations/     # 001_initial_schema.sql (13 tables)
├── docs/                    # landing.html, ui-preview.html, index.html, notes
├── tests/                   # pytest suite (66 tests)
├── Dockerfile               # multi-stage: build SPA, serve it with the API
├── docker-compose.yml       # one-command deploy
├── .env.example             # every supported setting, documented
└── CONTRIBUTING.md

Runtime flow: the React app is served by FastAPI in production (or by Vite in development, proxying /api). Every request carries a JWT; api/auth.py resolves it. Data lives in SQLite. KayaBrain answers through mcp/fb_brain.py, optionally via a model configured in providers.py.


📄 License

This project is licensed under the MIT License — see the LICENSE file for details.

You are free to:

  • Use it for any purpose
  • Modify it
  • Distribute it
  • Use it commercially
  • Sublicense it

The only requirement: include the original copyright and license notice.


🌟 Star History

Star History Chart


💬 Community


🙏 Acknowledgments

  • Built with Hermes Agent
  • Design inspired by Linear
  • Icons from Lucide
  • Community of restaurant owners and developers who make this better

If you find Kaya useful, please give it a ⭐ — it helps others discover the project!

If you have an idea, open a discussion. If you can code, open a PR. If you can test, open an issue.

Let's build the future of F&B software together.

来源:GitHub · github.com