How hosoo-code/arhat-edit works
Arhat Edit is a browser-based Mobile Legends account showcase editor with sign-in, VIP access, payment, and administration. The main user flow is to enter the editor, arrange account and skin images, optionally detect cards in collection screenshots, preview a template, and download the rendered image. The tree also contains Next.js route components alongside a Vite-style client app; the supplied excerpts show the client editor flow more clearly than the Next.js editor internals. Wire payment sequencing and several admin capabilities are documented in the README, but their implementation details were not sampled.
Main entry points: App.tsx Client app · EditorView.tsx Editor interface · page.tsx Payment page · useEditor.ts Editor state
Components 22
User experience
- Client app
src/App.tsx - Home and plans
src/app/page.tsx
Editing and rendering
- Editor interface
src/components/EditorView.tsx - Editor state
src/state/useEditor.ts - Image processing
src/lib/image.ts - Collection crop detection
src/cv/detect.ts - Local image store
src/lib/db.ts - Live preview
src/components/editor/LivePreview.tsx - Canvas renderer
src/lib/render.ts - Template registry
src/templates/index.ts - Image export
src/lib/export.ts
Identity and access
- Auth state
src/state/useAuth.ts - Access checks
src/lib/access.ts - Supabase
src/lib/supabase/server.ts
Payments and administration
- Payment page
src/app/payment/page.tsx - Create payment
api/wire/create.js - Wire / QPay
- Check payment
api/wire/check.js - Payment webhook
api/wire/webhook.js - Admin management
src/app/admin/page.tsx - Admin actions
src/app/admin/actions.ts
Other components
- User
Connections 24
- User → Client app: opens app
src/App.tsx - Client app → Auth state: loads identity
src/App.tsx - Client app → Editor interface: renders editor
src/App.tsx - Client app → Home and plans: renders home route
- Home and plans → Access checks: loads access and plans
src/app/page.tsx - Access checks → Supabase: reads account data
src/lib/access.ts - Editor interface → Editor state: uses editor state
src/App.tsx - Editor interface → Collection crop detection: detects screenshot cards
src/components/EditorView.tsx - Editor interface → Image processing: processes images
src/components/EditorView.tsx - Editor state → Image processing: hashes and decodes images
src/state/useEditor.ts - Editor state → Local image store: persists image blobs
src/state/useEditor.ts - Live preview → Canvas renderer: renders preview
src/components/editor/LivePreview.tsx - Live preview → Image export: exports image
src/components/editor/LivePreview.tsx - Canvas renderer → Template registry: uses template config
- User → Payment page: starts VIP purchase
README.md - Payment page → Create payment: requests payment
README.md - Create payment → Wire / QPay: creates checkout
README.md - Wire / QPay → Payment page: returns checkout
README.md - Payment page → Check payment: checks payment status
README.md - Check payment → Wire / QPay: reads payment state
README.md - Payment webhook → Supabase: updates premium
- User → Admin management: opens admin
README.md - Admin management → Admin actions: manages settings and users
- Admin actions → Supabase: updates account records