forge
Explore
Log in

Don't you dare go Hollow

πŸ“ update README.md with latest features, UI/UX design tokens, and route specifications

Browse files at this commit

efe7cc0d6ff2fa31d7dc53063693a0d73a70a708Burak BoduroğluParent: 61fa710
  • docs
    • πŸ“ update README.md with latest features, UI/UX design tokens, and route specifications
Show full message
docs: πŸ“ update README.md with latest features, UI/UX design tokens, and route specifications
- document Γ‡elebi AI assistant, Question Bank, PDF Note Import Assistant, and .hzdraw live canvas
- document unified sky-blue data-shell container, tab system redesign, and Γ‡elebi primary button styling
- expand route table, role scope matrix, and API layer architecture details
README.mdmodified+103 -107
@@ -1,134 +1,130 @@
1 # Hezarfen Frontend1 # Hezarfen Frontend
2 2
3-SolidJS + TypeScript frontend for the Hezarfen REST API.3+A modern, high-performance **SolidJS + TypeScript** web application for the Hezarfen Campus & Learning Management System. Built with Vite, TanStack Router, Tailwind CSS, and a rich, accessible dark mode design system.
4 4
5-## Stack5+---
6 6
7-- **SolidJS** + Vite7+## πŸš€ Key Highlights & UI/UX Experience
8-- **TanStack Router** (code-based route tree, lazy pages)
9-- **shadcn-solid style** UI primitives under `src/components/ui/`
10-- Session cookie auth via Vite dev proxy (same-origin)
11-- **bun** package manager
12-- i18n with EN/TR locale switching
13 8
14-## Prerequisites9+- **Γ‡elebi AI Assistant**: Top-bar instant AI study and campus guide accessible from every page (`IconSparkles`).
10+- **Smart Notebook & Import Assistant**: Upload PDF, TXT, or MD files and automatically extract clean Markdown notes (OCR warning, split line joining, header stripping).
11+- **Freehand Drawing Canvas (`.hzdraw`)**: Unbounded pannable/zoomable drawing canvas with stroke smoothing, dark mode grid paper, and PNG scene JSON metadata embedding.
12+- **Question Bank & Verified Solutions**: Question repository (`/questions`) supporting written/multiple-choice answers, teacher verification badges, and subject taxonomy.
13+- **Live Exam Room & Real-Time Monitor**: Server-clock-synchronized countdown timer (`GET /time`), WebSocket + REST autosave, teacher SSE live monitoring, and answer sheet grading.
14+- **Unified Sky-Blue Container (`data-shell`)**: Cohesive, elegant dark mode surfaces (`border-sky-500/15 bg-sky-500/[0.025]`) across Courses, Exams, Events, Calendar, and Guide pages.
15+- **Redesigned Tab System**: Stationary tab dimensions (zero layout shifts), glowing dark mode halo rings (`dark:shadow-[0_0_16px_rgba(255,255,255,0.08)]`), dynamic alternating accent lines, and perfectly aligned icon + text triggers.
16+- **Γ‡elebi Primary Button Styling**: Hairline borders, translucent fill (`bg-primary/15`), subtle rings, and clean hover micro-interactions.
15 17
16-- Node.js 20+ (or bun)18+---
17-- Hezarfen backend running at `http://127.0.0.1:8080`
18 19
19-## Setup20+## πŸ› οΈ Stack & Architecture
21+
22+- **Core**: SolidJS 1.8+ & TypeScript 5+ (scaffolded with Vite 6)
23+- **Routing**: TanStack Router (`@tanstack/solid-router`, code-based route tree, route-level code splitting via `lazy()`)
24+- **UI Primitives**: Custom **shadcn-solid** wrappers under `src/components/ui/` styled with Tailwind CSS (using `clsx` + `tailwind-merge` + `cva`)
25+- **API Layer**: Domain-driven `src/api/<domain>/` functions using `fetch` inside SolidJS `createResource` boundaries. Pages never call `fetch` directly.
26+- **Testing**: Vitest with 100% endpoint test coverage (`src/api/__tests__/`) and custom `mockFetch` utilities.
27+- **Runtime Targets**: Under ~70KB gzipped bundle size for lightning-fast loads.
28+
29+---
30+
31+## πŸ“¦ Prerequisites & Setup
32+
33+- **Node.js** 20+ or **bun** (recommended)
34+- Hezarfen backend running at `http://127.0.0.1:8080` (or proxied via Vite)
35+
36+### Installation & Development
20 37
21 ```bash38 ```bash
39+# Install dependencies
22 bun install40 bun install
41+
42+# Start Vite development server
23 bun run dev43 bun run dev
24-```
25 44
26-Open [http://localhost:5173](http://localhost:5173).45+# Run unit tests
46+bun run test
27 47
28-The Vite server proxies `/api/*` to the backend so the HttpOnly session cookie stays same-origin while page URLs like `/notes` remain frontend routes on refresh.48+# Typecheck and build production bundle
49+bun run build
50+```
29 51
30-## Scripts52+Open [http://localhost:5173](http://localhost:5173) in your browser.
31 53
32-| Command | Description |54+> **Proxy Note**: Vite server automatically proxies `/api/*` and WebSocket connections (`/ws/*`) to `http://127.0.0.1:8080`, preserving HttpOnly session cookies across same-origin calls.
33-|---|---|
34-| `bun run dev` | Start Vite dev server |
35-| `bun run build` | Typecheck + production build |
36-| `bun run preview` | Preview production build |
37-| `bun run check` | Typecheck only |
38 55
39-## Roles56+---
40 57
41-`student < teacher < manager < admin` β€” higher roles inherit lower capabilities. Registration always creates a `student`.58+## πŸ‘₯ Role Scope Matrix
42 59
43-Role-based UI rules:60+`student < teacher < manager < admin` β€” Higher roles inherit lower capabilities. Public registration creates a `student`.
44 61
45-- `student`: own/enrolled/related courses, exams, marks, attendance, and notes.62+| Role | Access & Capabilities |
46-- `teacher`: teaching, grading, session, attendance, event, and work-log controls where allowed.63+|---|---|
47-- `manager`: management pages such as settings, terms, reports, and broader school operations.64+| **Student (`student`)** | Personal notebook, PDF import, drawing canvas, enrolled courses, live exam room, question bank, pomodoro focus log, personal report card & attendance history. |
48-- `admin`: global management scope for courses, exams, users, settings, and terms.65+| **Teacher (`teacher`)** | Course/study creation, student enrollment, lesson session roll call, exam question authoring, live exam monitoring, answer sheet grading, and solution verification. |
66+| **Manager (`manager`)** | Academic settings, term definitions, attendance reports, global course/exam oversight, and staff work logs. |
67+| **Admin (`admin`)** | Global management scope across all users, role assignments, system policies, settings, and terms. |
49 68
50-Dashboard and table summaries must use the same role scope as the related page. Admin views global data; non-admin roles should not accidentally see global course/exam scope.69+---
51 70
52-## Pages71+## πŸ—ΊοΈ Page Routes & System Navigation
53 72
54-| Path | Access | Description |73+| Path | Access Scope | Description |
55 |---|---|---|74 |---|---|---|
56-| `/login`, `/register` | Guests | Authentication |75+| `/login`, `/register` | Guests | Authentication with same-origin cookie management. |
57-| `/` | Authenticated | Role-scoped observation dashboard (portal cards + attention/upcoming) |76+| `/` | Authenticated | Read-only observation dashboard with role-scoped portal cards, attention items, and upcoming events. |
58-| `/profile` | Authenticated | Edit personal info (name, email, phone, birth date) |77+| `/guide` | Authenticated | Redesigned product guide featuring role scope matrix, 6 core feature cards, and pro tips. |
59-| `/notes` | Student+ | Personal notebook CRUD with paper-style cards, side-panel create, reader panel, file attachments |78+| `/profile` | Authenticated | User profile management (display name, email, phone, birth date). |
60-| `/events`, `/events/:id` | Student+ | Event list & detail with search, time filters, and lazy attendance roster |79+| `/notes` | Student+ | Personal notebook with paper-style cards, Note Import Assistant (PDF/TXT), reader drawer, file attachments, and `.hzdraw` live canvas. |
61-| `/exams` | Student+ | Exam table with role-scoped course filtering |80+| `/questions`, `/questions/:id` | Student+ | Community Question Bank with solution authoring and teacher verification. |
62-| `/exams/:id` | Student+ | Exam detail, draft/publish state, subject-tagged questions, grading, statistics (teacher+) |81+| `/courses`, `/courses/:id` | Student+ | Course catalog, student enrollment, curriculum subjects, homework assignments, and lesson session roll call. |
63-| `/exams/:id/live` | Teacher+ | Live monitor / final state roster with pagination & sorting |82+| `/exams`, `/exams/:id` | Student+ | Exam list and details, subject-tagged questions, draft/publish controls, and grading statistics. |
64-| `/exam-room/:id` | Student+ | WebSocket-based real-time exam room (auto-save, timer, local expiry close) |83+| `/exam-room/:id` | Student+ | WebSocket real-time exam room with autosave, server timer (`/time`), and automatic turn-in on expiry. |
65-| `/courses` | Student+ | Course table with search and term filters; create/edit flows for teacher+ |84+| `/exams/:id/live` | Teacher+ | Live exam monitor over SSE/polling with answer sheets, auto-score suggestions, and inline grading. |
66-| `/courses/:id` | Student+ | Course/study/club detail, capacity, subjects, exams, roster, lesson sessions, and roll call tools |85+| `/events`, `/events/:id` | Student+ | Campus event list and detail views with search filters and attendance roster. |
67-| `/pomodoro` | Student | Server-stamped student focus log |86+| `/calendar` | Student+ | Full calendar view with sky-blue container, event & exam markers, and day detail inspection. |
68-| `/guide` | Authenticated | App usage guide |87+| `/marks` | Student+ | Report card with weighted exam average calculations and course breakdown. |
69-| `/admin/users` | Admin | User management |88+| `/messages` | Student+ | Messaging portal with folder navigation, unread badges, and micro-animations. |
70-89+| `/pomodoro` | Student | Student focus log with server-stamped session tracking. |
71-## Features90+| `/admin/users` | Admin | User account administration and role assignment. |
72-91+
73-- **Exam lifecycle**: create (scheduled/async/unscheduled), automatic async duration from start/end, subject-tagged questions (multiple-choice / text), real-time WebSocket exam room, auto-close on expiry, teacher grading92+---
74-- **Live monitor**: 2-second polling during active exams, static final state view after exam ends, pagination (10/page), column sorting93+
75-- **Statistics**: graded count, average/min/max marks on exam detail94+## 🎨 UI/UX Design System Tokens
76-- **Answer sheet**: teacher review of student answers with correct/wrong highlighting95+
77-- **Profile editing**: update display name, email, phone, birth date96+- **Data Shell Surface**: Subtle sky-blue background container (`border-sky-500/15 bg-sky-500/[0.025]`) used across data-heavy views for visual cohesion.
78-- **Dense tables**: toolbar search/filter, subtle column separators, narrow centered three-dot row actions97+- **Domain Accent Colors**: Centralized single source of truth (`src/lib/domain-colors.ts`) mapping domain colors exclusively to hairline borders and ring highlights (amber for Notes, violet for Messages, rose for Exams, emerald for Events, sky for Courses, cyan for Questions, teal for Marks).
79-- **Side panels**: quick create/edit workflows without losing list context98+- **Tab Indicators**: Recessed list tracks, stationary pill triggers, halo ring glow outlines, and alternating accent lines.
80-- **Course sessions**: right-panel session creation and paginated roll call panels99+- **Button Styling**: Γ‡elebi-themed translucent fill (`bg-primary/15`), hairline borders, and subtle rings (`ring-1 ring-primary/25`).
81-- **Course subjects**: course/study curriculum topics managed on the detail page; every exam question must pick one100+- **Invisible Scrollbars**: Functional scrolling without visible scrollbar clutter across all browsers (`scrollbar-width: none`).
82-- **Course capacity**: optional roster cap on course/study/club enrollment101+
83-- **Pomodoro**: student-only server-stamped focus sessions with total focus history102+---
84-- **Schedule validation**: event, exam, and lesson-session forms use `GET /time` for server-clock-aware past-date warnings before submit103+
85-- **Notebook**: paper-style note cards; create in `SidePanel`; read in reader panel with attachments; three-dot card actions for edit/delete104+## πŸ“ Project Directory Structure
86-- **Note Import Assistant**: convert uploaded PDF, TXT, or Markdown files into clean, structured notes ready for the notebook. Automatically strips page numbers and header noise, joins split PDF sentences, formats Markdown headings and bullet points, and flags OCR extraction issues
87-- **Freehand Drawing Canvas (`DrawCanvas`)**: unbounded pannable/zoomable drawing canvas with pen, eraser, grid paper ruling, and PNG metadata JSON embedding (`.hzdraw.png`)
88-- **Note files**: per-note upload/list/download/delete via native `FormData`; school `max_file_bytes` from settings
89-- **Events and courses**: event cards with schedule status chips + toolbar search/time filters; courses table with search and term filters
90-- **Attendance UI**: localized status labels with explanatory detail text and semantic colors
91-- **Role-scoped dashboard**: monochrome observation board β€” portal cards (`Title | count`), drag-and-drop & delta move reordering in edit mode, needs-attention and upcoming lists only
92-- **Empty states**: shared `EmptyState` with optional create CTA where the role can mutate
93-- **Mutation feedback**: short auto-clear success flash (`createFlash` + success `Alert`) after create/save/delete; not used for exam-room autosave
94-- **i18n**: full Turkish / English interface
95-
96-## UI Patterns
97-
98-- Durable resources use full detail pages with breadcrumbs.
99-- Short create/edit/filter work uses `SidePanel`.
100-- Destructive actions use confirm dialogs.
101-- Form dialogs dismiss with the header close control (outside click / ESC disabled to avoid click-through races).
102-- Data-heavy views use `DataToolbar`, `DataTableFrame`, `.data-table`, and `TableRowActions`.
103-- Large list pages should use server-side pagination/search/filtering when the backend supports it; client-side slicing is only acceptable for small or temporary datasets.
104-- Date fields use the shared `DatePicker`; date-time flows pair it with an `HH:mm` input.
105-- Start/end date-time rows use equal-width date and time controls.
106-- Disclosure sections either defer hidden content for request savings or preserve mounted content when local state should not reset.
107-- Event detail attendance roster is teacher-only and lazy-loaded when its disclosure opens.
108-- Schedule status chips share `src/lib/schedule-status.ts` tones (active / upcoming / finished / muted).
109-- Note attachments live in the note reader panel. Upload uses native `FormData`; downloads are same-origin links to `/api/notes/{id}/files/{file_id}`. Backend remains authoritative for the 10-file cap and payload validation.
110-- App providers (`PreferencesProvider`, `AuthProvider`) wrap `RouterProvider` so every route and pending shell can use auth/preferences context.
111-
112-## Docs
113-
114-- `docs/frontend-next-steps.md` β€” completed frontend audit summary and backend-dependent follow-ups.
115-- `docs/navigation-patterns.md` β€” interaction, dashboard, role scope, and table action rules.
116-- `docs/ui-redesign-tokens.md` β€” visual density, table, typography, and component conventions.
117-- `docs/backend-ui-alignment-plan.md` β€” completed backend alignment archive.
118-
119-## Project Structure
120 105
121 ```106 ```
122 src/107 src/
123-β”œβ”€β”€ api/ # API client, types, endpoint functions108+β”œβ”€β”€ api/ # Endpoint functions organized by domain (notes, exams, courses, etc.)
124-β”œβ”€β”€ components/ # Reusable UI components109+β”‚ └── __tests__/ # Vitest endpoint tests (100% API coverage)
125-β”‚ β”œβ”€β”€ exams/ # Exam card, form, questions panel, answer sheet, WS room110+β”œβ”€β”€ components/ # Domain & UI components
126-β”‚ β”œβ”€β”€ layout/ # Side nav, page header, role guards111+β”‚ β”œβ”€β”€ exams/ # Exam cards, forms, live monitor, WS room
127-β”‚ β”œβ”€β”€ ui/ # Design system (Button, Badge, Table, SidePanel, row actions, etc.)112+β”‚ β”œβ”€β”€ layout/ # AppShell, PageHeader, Sidebar, RouteGuard
128-β”‚ └── users/ # Profile form, user table113+β”‚ β”œβ”€β”€ notes/ # Note cards, reader panel, file attachment manager
129-β”œβ”€β”€ i18n/ # Message keys + EN/TR dictionaries114+β”‚ β”œβ”€β”€ ui/ # Design system (Button, Badge, DataTable, SidePanel, Tabs, etc.)
130-β”œβ”€β”€ lib/ # Utilities (format, cn, roles, exam-labels, flash, schedule-status)115+β”‚ └── users/ # User search, profile form, admin user table
131-β”œβ”€β”€ pages/ # Route-level page components116+β”œβ”€β”€ i18n/ # Localization dictionaries (TR / EN) and MessageKey types
132-β”œβ”€β”€ routes/ # TanStack Router tree117+β”œβ”€β”€ lib/ # Shared utilities (domain-colors, note-importer, stroke-smoothing, etc.)
133-└── stores/ # Auth, preferences (locale, theme) contexts118+β”œβ”€β”€ pages/ # Lazy-loaded page components for TanStack Router
119+β”œβ”€β”€ routes/ # TanStack Router route tree definition
120+└── stores/ # Cross-cutting contexts (AuthContext, PreferencesContext)
134 ```121 ```
122+
123+---
124+
125+## πŸ“œ Commit & Quality Workflow
126+
127+All contributions adhere to the strict repository rulebook (`AGENTS.md`):
128+
129+1. **Pre-commit Check**: `bun run test` (35 test files, 238 tests) and `bun run build` (`tsc --noEmit && vite build`) must pass green before committing.
130+2. **Conventional Commits**: Format `type: emoji short summary` with technical bullet details written in English.