Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

nhahangzuize (MVP)

Web game: each user owns a restaurant, places furniture on a grid, prestige scales with decor, and logging in runs an offline-style order simulation to earn soft currency.

Screenshots

Overview — restaurant + parking lot + train station (left) + airport (back) + the catalog sidebar:

Overview of the restaurant world

Interior — full set of furniture (kitchen zone, tables, red sofas, L-sofa, TV + arcade machine, aquariums, ceiling fans), with the train pulled up at the platform and the plane parked on the runway behind:

Interior with full furniture set

Front side — restaurant entrance, the 4-row × 10-stall numbered parking lot with cars driving on the right-hand lane, and pedestrians walking the perimeter:

Restaurant front + parking lot + traffic

Local dev

1) Start MySQL

docker compose up -d

2) Backend (FastAPI)

cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt -r requirements-dev.txt
alembic upgrade head   # includes restaurants.operation_mode (edit | ready); idempotent if column already exists
uvicorn app.main:app --reload --host 127.0.0.1 --port 8000

If you skipped Alembic, restart uvicorn once: startup runs a small patch that adds restaurants.operation_mode when the column is missing (avoids MySQL 1054 Unknown column).

3) Frontend (React + Three)

cd frontend
npm install
npm run dev

Open http://localhost:5173.

By default in dev, the frontend calls the API through the Vite proxy at /api → http://127.0.0.1:8000, so you usually do not need VITE_API_BASE. This avoids Failed to fetch when you open the dev server from another device on your LAN (npm run dev -- --host): 127.0.0.1 in that browser would point at the wrong machine if you forced VITE_API_BASE=http://127.0.0.1:8000.

If the proxy target is not 127.0.0.1:8000, set VITE_DEV_PROXY_TARGET (see frontend/.env.example). To bypass the proxy, set VITE_API_BASE (for example http://127.0.0.1:8000).

Notes

  • Place: choose an item in the sidebar → click a grid cell (Place mode).

  • Move: Move mode → click a piece (or “Pick up” in the list) → click a cell to put it down.

  • Stash: Stash mode → click a piece or use “Stash” in the list to remove it from the floor.

  • Rotate: Rotate mode → click a cone arrow on a piece to face its front toward that direction (collision-checked server-side via POST /me/restaurant/rotate).

  • Edit / Ready: POST /me/restaurant/mode with { "mode": "edit" | "ready" }. Ready opens the floor: layout APIs are blocked; simple guest loop sits on chairs only; each finished meal calls POST /me/restaurant/customer_meal (server pays $5–$15 in soft cents). Edit closes and unlocks layout again.

  • Prestige: sum of base_decor for placed catalog items (MVP).

  • Income: calling GET /me/restaurant runs offline order simulation and writes the ledger (MVP).

  • Furniture definitions (frontend): edit frontend/src/game/furniture/fixtures.ts (ids must match the backend catalog). Optional GLBs live under frontend/public/models/.

  • IPv4 API URL: prefer http://127.0.0.1:8000 over http://localhost:8000 if you hit port conflicts / IPv6 issues.

Repo layout

  • backend/: FastAPI
  • frontend/: Vite + React + Three

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages