SuaXe V2 · Dashboard

Tìm thợ sửa xe,
trên bản đồ.

Single source of truth cho V2 — phân tích nghiệp vụ, design brief, Flutter demo Phase 1, decisions đã chốt. Mọi thứ trong 1 trang.

Phase 1 — Mobile remote API + BE scaffold ready
Stack chốt 2026-04-24
BE scaffold + EF migration · 2026-05-06
Mobile swap mock → Dio remote · 2026-05-18

Trạng thái phân tích

25 done · 11 pending
📋

Tài liệu & Spec nghiệp vụ

6/10
  • V2 Brief tổng hợp
  • User business analysis
  • Phase 1 spec (search shop)
  • Objects & Roles
  • Action Impact Map (v2.0.0)
  • Phase 1 — Shop schema
  • Nghiệp vụ phía Shop (Phase 2+)
  • Nghiệp vụ phía Admin (Phase 6)
  • State machine booking (Phase 2)
  • Notification system (Phase 3)
🎨

Design

1/3
  • Design brief Phase 1 (4 màn, Uber-inspired)
  • Design Phase 2 (auth + booking)
  • Design Phase 3+ (SOS, payment, dashboard)
📱

Frontend — Flutter (mobile + web)

9/9
  • Stack chốt (Flutter + Riverpod + go_router)
  • Scaffold (build web pass ~135s)
  • Splash + Welcome (gate permission, /welcome chỉ show khi chưa grant)
  • Home — search, 10 chip loại, featured rating-based, theme toggle
  • Map Home (flutter_map + OSM, sort distance, filter q/type)
  • Shop Detail (sticky title + actions, gallery, reviews)
  • Theme V2 (palette light/dark + persist SharedPreferences + toggle Home)
  • Page transition iOS-standard (CupertinoPageTransition mọi route, 0 ghost)
  • Tests Rule 8 (23 pass · mapper · repo · provider · usecase · widget smoke)
🖥️

Backend — .NET 10

5/6
  • Stack chốt (.NET 10 + EF Core 10 + Npgsql)
  • Project setup (SuaXe.Api + SuaXe.Core, sharding-ready ShardContext)
  • API Phase 1 (health, shop-types, shops list/detail · PostGIS ST_DWithin + envelope)
  • EF Core entity config + 2 migrations (InitialCreate, UniqueOriginRefPartial)
  • E2E pytest (9 flow pass · health · types · search radius/sort · detail · reviews)
  • Auth/JWT (Phase 2)
💾

Database — PostgreSQL + PostGIS

3/5
  • Stack chốt (Postgres + PostGIS + JSONB)
  • Shop schema chi tiết (UUID v7, JSONB, PostGIS, no FK)
  • DDL phase1_schema.sql + Python CLI import (80→34 shop · 534 review · dedupe place CID)
  • Database schema design tổng (các entity khác)
  • EF Core migration align DDL hiện có
🔌

Data & Integration

1/4
  • Nguồn unverified shops = crawl Google Maps (80 shop mẫu Hoàn Kiếm)
  • OSM tile config (production usage policy)
  • Geocoding strategy (Nominatim vs khác)
  • OSRM self-host (Phase 3 — chỉ đường + ETA realtime cho SOS)

Stack V2 — đã chốt

commit e27ce35 · 2026-04-24

Frontend

Flutter flutter_map OSM tile Riverpod go_router Dio + Retrofit

Mobile iOS/Android + web build cùng codebase. Demo Phase 1 đã chạy với flow Splash → Welcome → Home → Map → Detail.

Backend

.NET 10 ASP.NET Core EF Core 10 Npgsql NetTopologySuite

Anh có base .NET; SignalR sẵn cho Phase 3 real-time (luồng khẩn cấp 3 phút timeout).

Database

PostgreSQL PostGIS JSONB UUID v7

Nhẹ ~150MB RAM. PostGIS chuẩn vàng cho geo query "shop quanh bạn". Free, không vendor lock.

Nguyên tắc data

  • PK + Index trên mọi bảng (UUID v7 cho write-heavy, int IDENTITY cho lookup)
  • Bỏ FK cross-aggregate — write nhanh, sharding-friendly, microservice ready
  • Giữ FK trong cùng aggregate (Booking ↔ BookingItem)
  • Validate ở service layer (FluentValidation)
  • Soft delete thay hard delete để tránh orphan
  • JSONB cho field flexible (shop metadata, custom service attrs)

Tài liệu V2

6 analysis · 1 design · 1 demo · 1 scripts
entry

V2_BRIEF.md

Brief tổng hợp 1 file: actors, 3 luồng user, 2 nhóm dịch vụ, sequence khẩn cấp, quy tắc vàng, stack, lộ trình 6 phase.

begin_analysis/V2_BRIEF.md
🧑
done

User Business Analysis

Pain point cốt lõi từ case study "Hỏng xe giữa đường" + nghiệp vụ phía User chi tiết.

begin_analysis/user_business_analysis.md
📋
đang dùng

Phase 1 Spec

App tìm kiếm shop sửa xe — no auth, no booking. 4 màn: Welcome/GPS, Fallback, Map Home, Shop Detail.

begin_analysis/phase1_search_spec.md
💾
done

Phase 1 — Shop Schema

3 bảng: shops (UUID v7 + JSONB + PostGIS), shop_types, shop_reviews. Mapping JSON crawl → DB, whitelist 10 loại, decision log 9 mục.

begin_analysis/phase1_shop_schema.md
🎭
done

Objects & Roles

3 actors (User · Shop · Admin) + System; vai trò, quan hệ. Base cho DB design sắp tới.

begin_analysis/objects_and_roles_analysis.md
🔄
interactive

Action Impact Map

Visualization map action → impact lên objects + actions khác + reports. Bumped v2.0.0 đồng bộ phân tích V2.

begin_analysis/impact_map.html
🎨
live

Design Brief Phase 1

Uber-inspired: 4 màn mockup, color tokens, typography, components, OSM stack rationale, v1↔v2 diff.

design_brief/index.html
📱
demo live

Flutter Demo Phase 1 (5 màn)

Splash → Welcome (chỉ khi chưa grant) → Home (search · 10 chip · featured · theme toggle) → Map (sort distance) → Detail (sticky title + actions). iOS push transition. Mock 80 shop Hoàn Kiếm.

:41236
⚙️
script

Phase 1 — DB Setup & Import

DDL phase1_schema.sql (3 bảng + indexes + GIST + GIN FTS + seed 10 types) · CLI Python phase1_import.py 4 lệnh (init-schema · import-json · reset · count). Test: 80 → 34 shop + 534 review.

scripts/

Lộ trình 6 Phase

đang ở Phase 1
1

App tìm kiếm shop

Map · search · filter · sort · detail · gọi · chỉ đường — KHÔNG có auth/booking. Đang phân tích + scaffold xong.

Đang làm
2

Auth + Đặt lịch trước

Đăng ký User/Shop, JWT, đặt lịch trước với verified shop. State machine booking cần phân tích trước.

Queue
3

Đặt thợ khẩn cấp + Real-time

Luồng SOS — bán kính 5→10km, 3 phút timeout shop accept. SignalR push vị trí thợ. OSRM self-host tính route + ETA cập nhật khi thợ di chuyển.

Queue
4

Payment + Hóa đơn

Tiền mặt + chuyển khoản, hoá đơn qua app, lịch sử thanh toán.

Queue
5

Shop dashboard

Nhận đơn, báo giá, thống kê doanh thu, quản lý dịch vụ + giá.

Queue
6

Admin tools

Verify shop (UV → V), dispute, moderation, báo cáo hệ thống.

Queue

Next — Phase 1 polish + Phase 2 prep

BE scaffold + tests xong · còn 3 việc trước khi bước sang Phase 2
Demo · 1

E2E smoke BE ↔ Mobile remote (UI)

Chạy BE local (dotnet run) + mobile remote impl (shopRepositoryRemoteProvider) ↔ verify map re-query, district picker, detail reviews modal hoạt động end-to-end với data Postgres thật. Pytest đã verify BE contract — đây là smoke phía UI.

Spec · 2

Nghiệp vụ phía Shop (Phase 2 prep)

Phân tích: đăng ký shop, verify flow, dashboard nhận đơn, báo giá, chuyển trạng thái booking. Là input cho design Phase 2 + state machine booking.

Backend · 3

Auth/JWT design (Phase 2)

Chọn token strategy (access/refresh, role claims user/shop/admin). Thiết kế bảng users + integrate ASP.NET Core Identity hay custom. Không code Phase 1.

Live preview

SSH port-forward để xem