|
|
||
|---|---|---|
| .forgejo/workflows | ||
| server | ||
| shared | ||
| src | ||
| .dockerignore | ||
| .editorconfig | ||
| .gitignore | ||
| db.ts | ||
| docker-compose.yml | ||
| Dockerfile | ||
| eslint.config.js | ||
| index.html | ||
| metadata.json | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| server.ts | ||
| tsconfig.json | ||
| vite.config.ts | ||
| vitest.config.ts | ||
Our Cafe
our-cafe is a small real-time cafe operations app built with React, Vite, Express, Socket.IO, and DuckDB.
It lets a team:
- set a local nickname for the current device
- browse the drink menu and place orders
- watch the live queue update in real time
- claim and advance orders through the prep flow
- adjust ingredient inventory and basic cafe settings
How It Works
The project runs a single Node server in development:
server.tsstarts Express, mounts the JSON API, serves the Vite app, and broadcasts live updates over Socket.IOdb.tscreates and seeds a localcafe.duckdbdatabase on first runsrc/contains the mobile-first React client
Order and inventory changes are pushed to all connected clients, so multiple devices can act like a shared cafe counter.
Main Screens
Today: dashboard with active orders and quick actionsMenu: drink list, modifiers, notes, and order placementOrders: live queue with claim / brew / ready / complete transitionsManage: inventory adjustment, cafe name, and local nickname settings
Local Development
Prerequisites:
- Node.js 20+ recommended
- npm
Install dependencies:
npm install
Start the app:
npm run dev
The server listens on http://localhost:3000.
Run with Docker Compose:
docker compose up --build
This also serves the app on http://localhost:3000.
On first launch, the app creates a local DuckDB file in the project root and seeds default data for:
- cafe settings
- ingredients
- recipes
- recipe ingredients
- recipe modifiers
- orders
Scripts
npm run dev # start the Express + Vite development server
npm run build # build the frontend for production
npm run start # run the server entrypoint
npm run lint # TypeScript type-check
Docker Notes
docker-compose.ymlbuilds a single production container for the Express server and Vite client- DuckDB data is persisted in the named Docker volume
cafe_data - The container stores the database at
/app/data/cafe.duckdb
CI/CD
Workflow files live in .github/workflows, which Gitea Actions can consume, and cover validation plus container publishing.
ci.ymlruns on pushes tomainand pull requestspublish-edge.ymlruns on pushes tomainand publishes rolling imagesrelease.ymlruns on tags matchingv*and publishes versioned release images
Required repository secrets:
REGISTRY_URL: registry host, for exampleprojects.caleb-brown.devREGISTRY_USERNAME: registry account with package write accessREGISTRY_PASSWORD: token or password for that account
Published image name:
<REGISTRY_URL>/caleb-brown/our-cafe
Published tags:
- pushes to
main:edge,main, andsha-<shortsha> - stable release tag
v1.2.3:v1.2.3,1.2.3,1.2,1, andlatest - prerelease tag
v1.2.3-rc.1:v1.2.3-rc.1and1.2.3-rc.1
Create a release by pushing a git tag such as:
git tag v0.1.0
git push origin v0.1.0
Data Notes
- The runtime database is stored locally as
cafe.duckdb - DuckDB artifacts are ignored in git
- The seeded menu currently includes unified drinks like latte and vanilla latte with optional temperature selection, plus cappuccino, honey cinnamon, and mocha
Current Stack
- React 19
- Vite
- Express
- Socket.IO
- DuckDB
- TypeScript
- Tailwind CSS
- Framer Motion