Work on the AROYTHAI React frontend and admin dashboard. Use when Codex needs to modify routes, layouts, Redux Toolkit flows, menu management, auth behavior, API integration, or Tailwind UI in this repository. Especially relevant for tasks involving `src/app`, `src/features/menu`, `src/features/auth`, `src/pages/admin`, `src/pages/public`, or shared API/layout code.
Resources
11Install
npx skillscat add witthaya-18/aroythaifood-github-io Install via the SkillsCat registry.
AROYTHAI Frontend Skill
Read AGENTS.md first for the repo-level rules and conventions.
Quick Start
Work from the project root:
npm run dev
npm run build
npm run lint
npm run testUse npm run build as the default verification step after frontend changes.
Repo Shape
src/appcontains bootstrap, router, store, and typed hookssrc/featurescontains Redux slices, feature services, and feature UIsrc/pagescontains route-level pagessrc/sharedcontains layouts, protected routing, and shared API utilities
Import from src with @/.
Preferred Workflow
- Read the route or feature named by the user.
- Read the related page, slice, and service together before editing.
- Extend existing flows instead of creating parallel ones.
- Keep edits narrow when the request is narrow.
- Verify with
npm run build.
Shared Project Contracts
- Use
useAppDispatch()anduseAppSelector()fromsrc/app/hooks.ts - Keep async server logic in Redux thunks and feature service files
- Reuse
src/shared/api/api.tsviaapiRequest()andbuildApiUrl() - Preserve the public/admin route split and current layout structure
Menu Admin Rules
Use these files first:
src/features/menu/ui/AdminMenus.tsxsrc/features/menu/ui/AdminMenuEditModal.tsxsrc/features/menu/model/menuSlice.tssrc/features/menu/api/menuService.ts
Keep these contracts intact unless the task explicitly changes them:
- Create and edit are explicit modal modes
- Menu uploads use
FormData - Upload field name is
image - Menu list refresh should flow through Redux state, not isolated local hacks
Auth Rules
Use src/features/auth/model/authSlice.ts as the source of truth for auth state.
- Preserve token persistence behavior
- Extend existing login/profile bootstrap flow instead of duplicating auth state elsewhere
Routing Rules
- Public pages render inside
AppLayout - Admin pages render inside
AdminLayout - Protected admin routes are gated by
src/shared/routes/ProtectedRoute.tsx
UI Expectations
- Reuse existing admin patterns before inventing a new structure
- Preserve selected-item and modal-open flows unless the task requires changing them
- Keep mixed Thai/English UI copy unless the task explicitly asks for a rewrite