Commit Graph

217 Commits

Author SHA1 Message Date
soroush.asadi c452df8988 fix(ci): add --add-host=gitea:host-gateway to all container jobs
github.server_url returns 'http://gitea:3000' (Gitea ROOT_URL using Docker
service name). CI job containers run on an isolated network and can't resolve
the 'gitea' hostname.

host-gateway maps to the Docker bridge IP (172.17.0.1). Gitea publishes
port 3000 on all interfaces, so http://gitea:3000 becomes reachable inside
every job container via the bridge.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 11:59:45 +03:30
soroush.asadi 8ddb427edd fix(ci): replace actions/checkout with shell git for container jobs
actions/checkout@v4 is a JS action executed inside the job container:
- dotnet/sdk:10.0 has no Node.js  → exit 127
- node:20-alpine  has no git      → checkout fails

Fix: manual git clone via shell using http.extraheader for token auth.
Token never appears in process list or git log. deploy job (self-hosted:host)
keeps actions/checkout — the act_runner image has both node and git.

Also removes defaults.run.working-directory from Node.js jobs (the checkout
step must start in workspace root, not web/<app>).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 11:46:34 +03:30
soroush.asadi 6c868f5f30 fix(ci): use docker:// runner mode with pre-built SDK images
Switch CI jobs to container: image: overrides so jobs run inside official
SDK containers (dotnet/sdk:10.0, node:20-alpine) instead of the bare
runner container. This bypasses blocked CDN downloads for dotnet/node.

Deploy job stays on self-hosted:host where Docker CLI is available.
Update workflow comments to explain the required runner label config:
  ubuntu-latest:docker://node:20-alpine (CI jobs)
  self-hosted:host (deploy)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 11:27:49 +03:30
soroush.asadi dcddcf77d6 Fix Gitea CI stuck at setup-dotnet/setup-node due to blocked CDNs
Root cause: actions/setup-dotnet@v4 downloads .NET from
download.visualstudio.microsoft.com and actions/setup-node@v4 downloads
Node from nodejs.org — both CDNs are blocked from Iran so jobs hang at 0s.

Fix:
- All .NET jobs: add container: mcr.microsoft.com/dotnet/sdk:10.0
  so .NET is already inside the image — no download needed.
  Remove actions/setup-dotnet step entirely.
- All Node.js jobs: add container: node:20-alpine
  so Node/npm are already inside the image — no download needed.
  Remove actions/setup-node step entirely.
- api-build: add postgres + redis service containers + env vars so
  dotnet test can actually connect to a database (was silently failing).
- deploy job: change back to runs-on: self-hosted
  ubuntu-latest containers don't have Docker CLI — docker compose
  commands would fail immediately. Deploy MUST run on the server.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 11:08:42 +03:30
soroush.asadi 8f81a62ec9 Redesign menu admin screen with two-panel layout and modal forms
UX improvements:
- Two-panel layout: sticky category sidebar (desktop) + items grid
- Mobile: horizontal scrolling category pills above items
- Category sidebar shows item count badge per category; edit on hover
- Items search bar + instant filter (name, English name, Arabic name)
- Category filter drives items grid (click sidebar = filter items)
- Item cards: image hover reveals Edit button (progressive disclosure)
- Out-of-stock overlay + inline toggle switch (replaces text button)
- Add/Edit item opens in clean modal overlay (no jarring inline expansion)
- Add/Edit category opens in separate modal
- nameEn made optional (was blocking new item creation)
- Consolidated form state with single object per form
- Empty state with illustration and Add CTA
- Skeleton loading grid
- Branch overrides tab wired to branchId from store
- New i18n keys for search, counts, states in en/fa/ar

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 08:10:25 +03:30
soroush.asadi 79deab543a Redesign POS order flow with order type picker and counter/takeaway support
- Add OrderTypePicker screen: Table / Counter / Takeaway cards shown when no
  active session, replacing the old always-visible table board
- Move PosTableBoard into a modal overlay (opens on Table selection or
  "Assign Table" for counter orders)
- Add orderType field + setOrderType action to cart store
- Counter and Takeaway orders no longer require a table to submit
- Add "Assign Table →" button in cart for counter orders with active session
- Rewrite category tabs as horizontal scrollable row (no wrapping)
- Larger product cards with 4:3 thumbnail + quantity badge overlay
- Bigger quantity controls (h-8 w-8) and "New order" back button in header
- Add i18n keys for order types in en/fa/ar

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 00:07:58 +03:30
soroush.asadi 9ed305e5bd ci: change all runners from self-hosted to ubuntu-latest 2026-05-27 23:55:26 +03:30
soroush.asadi 284920544b ci: add missing admin-api and admin-web to full CI/CD pipeline
CI now covers all 6 services:
- api-build: Meezi.API dotnet build + test
- admin-api-build: Meezi.Admin.API dotnet build (was missing)
- dashboard-check: web/dashboard tsc
- admin-web-check: web/admin tsc (was missing)
- website-check: web/website tsc (was missing)
- finder-check: web/finder tsc

Deploy now builds and starts all 8 containers:
- Main: postgres, redis, api, web, website, finder
- Admin: admin-api, admin-web (via docker-compose.admin.yml overlay)
- Health checks for both meezi-api and meezi-admin-api

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-27 23:53:49 +03:30
soroush.asadi 64b488ac89 ci: add Gitea Actions workflow (CI + self-hosted deploy)
.gitea/workflows/ci-cd.yml:
- Triggers on push to main and PRs
- CI jobs: dotnet build/test, dashboard tsc, finder tsc (all self-hosted)
- Deploy job: only on push to main, needs all CI jobs to pass
  - Writes .env from ENV_FILE secret (set in Gitea repo settings)
  - docker compose build --parallel with BuildKit
  - Rolling restart (postgres/redis untouched)
  - Health-check poll: waits up to 2min for meezi-api healthy
  - Auto-prunes old images on success

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-27 23:21:29 +03:30
soroush.asadi ac8a9442e3 ci: proper CI + self-hosted runner deploy workflow
ci.yml — runs on GitHub's servers (free):
- API: dotnet build + test with Postgres/Redis service containers
- Dashboard + Finder: TypeScript typecheck (tsc --noEmit)

deploy.yml — runs on YOUR Linux server (self-hosted runner):
- Triggers on every push to main
- docker compose build --parallel (BuildKit cache)
- Rolling restart with --no-deps --remove-orphans
- Health-check poll: waits up to 2min for API healthy
- Auto-prunes old images after successful deploy

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-27 21:45:39 +03:30
soroush.asadi a85890f30a chore: Flutter mobile app, CI, and dev tooling
- mobile/: Flutter/Dart merchant mobile app skeleton
- .github/: GitHub Actions CI workflows
- .dockerignore: exclude host node_modules from build context
- .cursorrules: Cursor IDE project rules
- .claude/: Claude Code project settings and launch config

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-27 21:35:27 +03:30
soroush.asadi 42d4cb896a feat(finder): AI-powered cafe finder PWA with Next.js 16
Public cafe discovery app:
- SEO-optimised pages: home, /cafe/[slug], /search, /city/[city]
- AI search bar with natural language queries
- Structured data (JSON-LD) for Google rich results
- City browsing, rating/filter sidebar, similar cafes
- Review listing, full menu preview, working-hours card
- Web App Manifest + offline fallback page (PWA)
- Next.js 16: params/searchParams typed as Promise<{}>
- Fix Lucide icon title→aria-label (type removed upstream)
- "use client" on offline page (onClick handler)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-27 21:34:47 +03:30
soroush.asadi d62bb8d3ad feat(website): Next.js 16 marketing website with RTL/Farsi
Marketing website for Meezi platform:
- Server-side rendered pages: home, demo, blog, pricing
- RTL/Farsi layout with Vazirmatn font
- SEO metadata and Open Graph tags
- proxy.ts for Next.js 16 middleware convention
- MEEZI_API_URL internal Docker network routing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-27 21:34:32 +03:30
soroush.asadi 131ecdbbe6 feat(dashboard): Next.js 16 merchant panel with offline POS and PWA
Complete merchant dashboard upgrade:

Next.js 16 compatibility:
- Fix params/searchParams typed as Promise<{}> throughout App Router
- Replace middleware.ts with proxy.ts (Next.js 16 convention)
- Remove unused @ts-expect-error directives caught by stricter TS
- Cast dynamic next-intl t() keys to fix TranslateArgs type errors

Offline POS:
- IndexedDB queue (meezi_pos_offline) for orders created while offline
- Zustand sync store tracking queueCount, isSyncing, isOnline
- useOfflineSync hook: auto-syncs on reconnect/visibility-change
- SyncStatusIndicator chip in topbar (amber=offline, blue=syncing)
- submitOrderToApi falls back to local order on network failure
- Local orders skip payment flow; sync on reconnect

PWA (installable):
- @ducanh2912/next-pwa with Workbox runtime caching rules
- Web App Manifest (manifest.ts) — RTL/Farsi, theme #0F6E56
- PWA icons: 192px, 512px, maskable 512px
- next.config.ts replaces next.config.mjs

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-27 21:34:12 +03:30
soroush.asadi ef15fd6247 feat(api): .NET 10 multi-tenant REST API
Full backend implementation:
- Multi-tenant cafe/restaurant management (menus, orders, tables, staff)
- POS order flow with ZarinPal and Snappfood payment integration
- OTP authentication via Kavenegar SMS
- QR digital menu with public discover/finder endpoints
- Customer loyalty, coupons, CRM
- PostgreSQL via EF Core, Redis for caching/sessions
- Background jobs, webhook handlers
- Full migration history

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-27 21:33:48 +03:30
soroush.asadi 03376b3ea1 feat(docker): multi-stage Dockerfiles with npmmirror registry
Rewrites dashboard and finder Dockerfiles to use a clean multi-stage
build (deps → builder → runner) that installs npm packages inside
Alpine Linux, avoiding the SWC musl binary issue when building from
Windows host. Uses registry.npmmirror.com for reliable installs from
restricted networks (Iran).

- docker/api/Dockerfile: .NET 10 multi-stage build
- docker/web/Dockerfile: Node 20-alpine multi-stage, npmmirror
- docker/finder/Dockerfile: Node 20-alpine multi-stage, npmmirror
- docker/website/Dockerfile: marketing website build
- scripts/: PowerShell helper scripts for local dev

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-27 21:33:29 +03:30
soroush.asadi 45cd028d1c chore: initial project structure and root configuration
Adds root-level config files: solution (.slnx), NuGet, global.json,
Docker Compose files for all services (API, dashboard, website, finder,
admin), environment example, and developer documentation.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-27 21:33:10 +03:30