diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..7871a5c --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,61 @@ +# Reward Project: AI Coding Agent Instructions + +## 🏗️ Architecture & Data Flow + +- **Stack**: Flask (Python, backend) + Vue 3 (TypeScript, frontend) + TinyDB (JSON, thread-safe, see `db/`). +- **API**: RESTful endpoints in `api/`, grouped by entity (child, reward, task, user, image, etc). Each API file maps to a business domain. +- **Models**: Maintain strict 1:1 mapping between Python `@dataclass`es (`models/`) and TypeScript interfaces (`web/vue-app/src/common/models.ts`). +- **Database**: Use TinyDB with `from_dict()`/`to_dict()` for serialization. All logic should operate on model instances, not raw dicts. +- **Events**: Real-time updates via Server-Sent Events (SSE). Every mutation (add/edit/delete/trigger) must call `send_event_for_current_user` (see `events/`). +- **Changes**: Do not use comments to replace code. All changes must be reflected in both backend and frontend files as needed. + +## 🧩 Key Patterns & Conventions + +- **Frontend Styling**: Use only `:root` CSS variables from `global.css` for all colors, spacing, and tokens. Example: `--btn-primary`, `--list-item-bg-good`. +- **Scoped Styles**: All `.vue` files must use ` diff --git a/web/vue-app/src/components/child/ParentView.vue b/web/vue-app/src/components/child/ParentView.vue index 684e162..9301e67 100644 --- a/web/vue-app/src/components/child/ParentView.vue +++ b/web/vue-app/src/components/child/ParentView.vue @@ -1,10 +1,8 @@