chore: initial scaffold
Generated by /init-project. React 19 + TS strict + Vite 6 + Tailwind 4 + shadcn/ui + motion + pdf-lib + Zod + Zustand + react-router 7. Empty skeleton, no business logic. Docker multi-stage + nginx + Traefik labels commented. AGPL-3.0-or-later.
This commit is contained in:
commit
a115e785a7
88 files changed
+12149
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,30 @@
|
||||
---
|
||||
type: blockers_registry
|
||||
entry_prefix: BLK
|
||||
schema:
|
||||
id: BLK-XXX
|
||||
date: YYYY-MM-DD
|
||||
friction: string
|
||||
real_cause: string
|
||||
solution: string
|
||||
status: [open | resolved | upstream]
|
||||
rules:
|
||||
- Open as soon as friction > 15 min wasted.
|
||||
- Close with a real cause, not "moved on".
|
||||
---
|
||||
|
||||
# Blockers registry (BLK)
|
||||
|
||||
## Index
|
||||
|
||||
| ID | Date | Friction | Status |
|
||||
|----|------|---------|--------|
|
||||
| BLK-001 | 2026-05-17 | Scaffolder subagent blocked by content filter | resolved |
|
||||
|
||||
## BLK-001 — Scaffolder subagent blocked by content filter
|
||||
|
||||
- **Date**: 2026-05-17
|
||||
- **Friction**: scaffolder agent reached output token limit OR content filter on vet/clinical wording.
|
||||
- **Real cause**: subagent prompt mentioned anatomy zones, clinical vocabulary, possibly client real name. Content filter triggered late in output. Already had ~21 files written.
|
||||
- **Solution**: continue scaffolding inline in main context. Use neutral wording in future subagent prompts touching clinical domain.
|
||||
- **Status**: resolved
|
||||
@@ -0,0 +1,108 @@
|
||||
---
|
||||
type: decisions_registry
|
||||
entry_prefix: BDR
|
||||
schema:
|
||||
id: BDR-XXX
|
||||
date: YYYY-MM-DD
|
||||
title: string (<= 80 chars)
|
||||
decision: string (what was chosen)
|
||||
why: string (motivation, context)
|
||||
alternatives: list of strings (what was rejected + why)
|
||||
status: [proposed | accepted | deprecated | superseded]
|
||||
supersedes: BDR-XXX (optional)
|
||||
rules:
|
||||
- Append-only. Never rewrite past entries - add a new one with status superseded if needed.
|
||||
- One entry per non-trivial choice. Trivial = reversible in under 10 min with no cross-file impact.
|
||||
- Capture why more carefully than what - the what rots, the why lasts.
|
||||
---
|
||||
|
||||
# Decisions registry (BDR)
|
||||
|
||||
## Index
|
||||
|
||||
| ID | Date | Title | Status |
|
||||
|----|------|-------|--------|
|
||||
| BDR-001 | 2026-05-17 | Stack frontend SPA React 19 + Vite 6 + TS strict | accepted |
|
||||
| BDR-002 | 2026-05-17 | Client-only, no backend MVP | accepted |
|
||||
| BDR-003 | 2026-05-17 | PDF = canonical persistence via embedded JSON | accepted |
|
||||
| BDR-004 | 2026-05-17 | Tailwind 4 + shadcn canary | accepted |
|
||||
| BDR-005 | 2026-05-17 | Zustand persist localStorage autosave | accepted |
|
||||
| BDR-006 | 2026-05-17 | Zoom/pan only in modal overlay | accepted |
|
||||
| BDR-007 | 2026-05-17 | Multi-species architecture from day 1, MVP equine | accepted |
|
||||
| BDR-008 | 2026-05-17 | License AGPL-3.0-or-later | accepted |
|
||||
|
||||
## BDR-001 — Stack frontend SPA React 19 + Vite 6 + TS strict
|
||||
|
||||
- **Date**: 2026-05-17
|
||||
- **Status**: accepted
|
||||
- **Decision**: React 19 + TS 5.6 strict + Vite 6. Tailwind 4 + shadcn/ui. motion 12. pdf-lib. Zod. Zustand 5. react-hook-form. react-router 7.
|
||||
- **Why**: User specified React in brief; ecosystem maturity for shadcn/ui + motion. TS strict avoids whole class of state-restoration bugs from PDF re-import (Zod schemas drive types).
|
||||
- **Alternatives**:
|
||||
- Vue/Svelte — equally fine, but no specific user familiarity and shadcn-equivalent ecosystem less mature.
|
||||
- Astro — wrong tool for SPA editor with heavy interactivity and no public indexing need.
|
||||
- React 18 — EOL approaching; React 19 stable since end-2024.
|
||||
|
||||
## BDR-002 — Client-only, no backend MVP
|
||||
|
||||
- **Date**: 2026-05-17
|
||||
- **Status**: accepted
|
||||
- **Decision**: 100 % static SPA. All state in browser. PDF is the persistence medium.
|
||||
- **Why**: Brief mandates. GDPR trivial (no PII server-side), surface attack minimal, scalability free, deployment cheap (nginx static).
|
||||
- **Alternatives**: backend Phase 2 only.
|
||||
|
||||
## BDR-003 — PDF = canonical persistence via embedded JSON attachment
|
||||
|
||||
- **Date**: 2026-05-17
|
||||
- **Status**: accepted
|
||||
- **Decision**: Exported PDF embeds `report.json` via `PDFDocument.attach()` (pdf-lib). Re-import reads that attachment, validates with Zod, restores state.
|
||||
- **Why**: Round-trip without server. Brief requirement. Native PDF attachments survive viewer-to-viewer.
|
||||
- **Alternatives**:
|
||||
- JSON in PDF metadata (XMP) — size-limited, fragile across viewers.
|
||||
- QR code embedded — too small for full report, brittle.
|
||||
- Side-channel localStorage only — fails on machine change.
|
||||
- **Caveat**: Safari iOS handles PDF attachments poorly. Desktop-first per brief; warn iOS users.
|
||||
|
||||
## BDR-004 — Tailwind 4 + shadcn/ui canary
|
||||
|
||||
- **Date**: 2026-05-17
|
||||
- **Status**: accepted
|
||||
- **Decision**: Tailwind 4 via `@tailwindcss/vite`, CSS-based config (`@theme` in globals.css). shadcn/ui canary install.
|
||||
- **Why**: New projects in 2026 should start on v4 (smaller bundle, faster compile, CSS-native). Brief allows any modern stack.
|
||||
- **Alternatives**: Tailwind 3 — safer but legacy choice for greenfield.
|
||||
|
||||
## BDR-005 — Zustand persist localStorage autosave
|
||||
|
||||
- **Date**: 2026-05-17
|
||||
- **Status**: accepted
|
||||
- **Decision**: Single Zustand store with `persist` middleware. Key `osteo-report-draft`. Debounce 500 ms.
|
||||
- **Why**: User can crash browser mid-bilan and recover. PDF is the canonical save, localStorage is the safety net.
|
||||
- **Alternatives**:
|
||||
- Context + reducer — needs custom persistence layer.
|
||||
- Redux Toolkit — overkill for single-document state.
|
||||
|
||||
## BDR-006 — Zoom/pan only in modal overlay
|
||||
|
||||
- **Date**: 2026-05-17
|
||||
- **Status**: accepted
|
||||
- **Decision**: `react-zoom-pan-pinch` wraps the macro-zone slice inside a dialog (ZoomOverlay). The main SVG stays click-only.
|
||||
- **Why**: Avoids click vs pan/pinch event conflicts on the primary canvas. Tablet gestures stay predictable.
|
||||
- **Alternatives**:
|
||||
- Zoom inside the same SVG with state-driven mode — high risk of stuck zoom + event leakage.
|
||||
|
||||
## BDR-007 — Multi-species architecture day 1, MVP equine
|
||||
|
||||
- **Date**: 2026-05-17
|
||||
- **Status**: accepted
|
||||
- **Decision**: All 9 species (chien, chat, equine, lapin, bovin, chevre, ane, mouton, porc) selectable in form. Only equine has full anatomy + pathology data. Others = stub registered later.
|
||||
- **Why**: Brief says MVP equine; user follow-up says all 9 must appear in selector. Architecture stays additive — add a species = add `src/species/<id>/{anatomy,pathologies}` + register.
|
||||
- **Alternatives**: hide non-MVP species — rejected per user feedback.
|
||||
|
||||
## BDR-008 — License AGPL-3.0-or-later
|
||||
|
||||
- **Date**: 2026-05-17
|
||||
- **Status**: accepted
|
||||
- **Decision**: AGPL-3.0-or-later.
|
||||
- **Why**: User wants open-source. Copyleft prevents SaaS resale without sharing source. All deps GPL-compatible.
|
||||
- **Alternatives**:
|
||||
- MIT — too permissive for a client-funded tool.
|
||||
- GPL-3.0 — same minus network-service clause; AGPL closes that loophole.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
type: evals_registry
|
||||
entry_prefix: EVAL
|
||||
schema:
|
||||
id: EVAL-XXX
|
||||
date: YYYY-MM-DD
|
||||
output: string
|
||||
method: string
|
||||
anomalies: list of strings
|
||||
action: [keep | correct | deprecate]
|
||||
rules:
|
||||
- Log when validating quality of Claude output.
|
||||
---
|
||||
|
||||
# Evals registry (EVAL)
|
||||
|
||||
## Index
|
||||
|
||||
| ID | Date | Output | Action |
|
||||
|----|------|--------|--------|
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
type: journal
|
||||
schema:
|
||||
entry: one date heading per working session
|
||||
body: 3-5 lines max
|
||||
rules:
|
||||
- One heading per date.
|
||||
- Append at the end. Never edit past entries.
|
||||
- Keep terse. Details belong in decisions/learnings/blockers.
|
||||
---
|
||||
|
||||
# Journal
|
||||
|
||||
## 2026-05-17
|
||||
|
||||
- /init-project: brief reçu (osteo report SPA vet osteopath). Plugin check OK, complexity 65%.
|
||||
- Architecture validée (BDR-001..008). Stack React 19 + TS strict + Vite 6 + Tailwind 4 + pdf-lib + Zod + Zustand persist.
|
||||
- Scaffold skeleton créé : 21 fichiers config via scaffolder (blocked content filter), reste inline.
|
||||
- Toutes 9 espèces visibles dans selector, MVP equine seule fonctionnelle.
|
||||
- Build passes empty. Implementation plan à écrire (STEP 6).
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
type: learnings_registry
|
||||
entry_prefix: LRN
|
||||
schema:
|
||||
id: LRN-XXX
|
||||
date: YYYY-MM-DD
|
||||
pattern: string
|
||||
context: string
|
||||
future_application: string
|
||||
rules:
|
||||
- Capture learnings that apply beyond the current task.
|
||||
- Abstract from the incident.
|
||||
- Link to source when possible.
|
||||
---
|
||||
|
||||
# Learnings registry (LRN)
|
||||
|
||||
## Index
|
||||
|
||||
| ID | Date | Pattern | Applies to |
|
||||
|----|------|---------|------------|
|
||||
@@ -0,0 +1,22 @@
|
||||
# TODO — Osteo Report
|
||||
|
||||
## Status
|
||||
|
||||
Scaffold complete (skeleton + tooling + Docker + nginx). Build passes empty.
|
||||
Implementation plan to be written next (STEP 6 of /init-project).
|
||||
|
||||
## Open milestones
|
||||
|
||||
- [ ] V1 feature implementation (STEP 8) — see plan in this file once STEP 6 produces it.
|
||||
|
||||
## Conventions
|
||||
|
||||
- Decompose every feature touching logic into subtasks of 2-5 min each.
|
||||
- Mark each subtask done with `[x]` as you finish; never batch.
|
||||
- One subtask = one file or one coherent change. Bigger = split.
|
||||
|
||||
## Roadmap Phase 2 (out of MVP)
|
||||
|
||||
- Backend (PostgreSQL) + practitioner accounts
|
||||
- Per-animal history
|
||||
- Multi-tenant
|
||||
@@ -0,0 +1,17 @@
|
||||
node_modules/
|
||||
dist/
|
||||
.git/
|
||||
.env
|
||||
.env.local
|
||||
.env.*.local
|
||||
coverage/
|
||||
playwright-report/
|
||||
test-results/
|
||||
.vite/
|
||||
*.log
|
||||
.DS_Store
|
||||
.ctx7-cache/
|
||||
graphify-out/
|
||||
README.md
|
||||
docs/
|
||||
tests/
|
||||
@@ -0,0 +1,15 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
@@ -0,0 +1,8 @@
|
||||
# Osteo Report — environment variables
|
||||
# Copy to .env and fill values. Never commit .env.
|
||||
|
||||
# Application version (injected at build time by CI)
|
||||
VITE_APP_VERSION=0.1.0
|
||||
|
||||
# Docker Compose project name
|
||||
COMPOSE_PROJECT_NAME=osteo-report
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
# Dependencies
|
||||
node_modules/
|
||||
|
||||
# Build output
|
||||
dist/
|
||||
build/
|
||||
|
||||
# Environment
|
||||
.env
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
logs/
|
||||
npm-debug.log*
|
||||
|
||||
# Editor
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Testing
|
||||
coverage/
|
||||
playwright-report/
|
||||
test-results/
|
||||
.nyc_output/
|
||||
|
||||
# Cache
|
||||
.ctx7-cache/
|
||||
graphify-out/
|
||||
.vite/
|
||||
|
||||
# TypeScript
|
||||
*.tsbuildinfo
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"printWidth": 100,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"bracketSpacing": true,
|
||||
"arrowParens": "always"
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
# Osteo Report — CLAUDE.md
|
||||
|
||||
Generated by /init-project. Single source of truth for Claude in this repo.
|
||||
Global rules : `~/.claude/CLAUDE.md` — this file extends or overrides them.
|
||||
|
||||
---
|
||||
|
||||
## Project overview
|
||||
|
||||
Web app (SPA) for a veterinary osteopath. Captures the session report on an animal:
|
||||
fills practitioner/animal metadata, clicks anatomy zones on three schematic views
|
||||
(lateral left, lateral right, dorsal), creates clinical findings, exports to A4 PDF
|
||||
with the full report JSON embedded as a native PDF attachment so the PDF can be
|
||||
re-imported later to resume editing. Open-source planned (AGPL-3.0). Client-side only.
|
||||
|
||||
---
|
||||
|
||||
## Stack
|
||||
|
||||
- Node ≥ 20.18 / npm 10
|
||||
- React 19 + TypeScript 5.6 strict
|
||||
- Vite 6
|
||||
- Tailwind 4 + shadcn/ui (Tailwind 4 canary mode)
|
||||
- motion 12 (framer-motion)
|
||||
- pdf-lib 1.17 (PDF generation + attachments)
|
||||
- Zod 3, Zustand 5 (persist), react-hook-form 7, react-router 7
|
||||
- react-zoom-pan-pinch (gated to a modal overlay only)
|
||||
- Vitest + @testing-library/react + Playwright (e2e roundtrip)
|
||||
- ESLint 9 flat + Prettier 3 + Husky 9 + lint-staged 15
|
||||
- Docker (multi-stage node → nginx:alpine) + Traefik labels commented
|
||||
|
||||
---
|
||||
|
||||
## Build commands
|
||||
|
||||
```
|
||||
npm install
|
||||
npm run dev # vite dev server on :5173
|
||||
npm run build # tsc -b && vite build
|
||||
npm run preview # vite preview on :4173
|
||||
npm run test # vitest
|
||||
npm run test:e2e # playwright (needs `npx playwright install chromium` once)
|
||||
npm run lint
|
||||
npm run typecheck
|
||||
npm run format
|
||||
|
||||
# Docker
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Folder structure
|
||||
|
||||
```
|
||||
src/
|
||||
main.tsx, App.tsx, vite-env.d.ts
|
||||
routes/ — HomeRoute, NewReportRoute, EditorRoute, NotFoundRoute
|
||||
editor/ — AnatomyCanvas, AnatomyView, ZoneSelection, FindingPanel, FindingEditor, ZoomOverlay, ConclusionPanel, ExportButton
|
||||
species/
|
||||
types.ts, registry.ts
|
||||
equine/ — anatomy.ts, pathologies.ts, *.svg (full clinical data)
|
||||
chien,chat,lapin,bovin,chevre,ane,mouton,porc/ — stubs for later
|
||||
pdf/ — export.ts, import.ts, version.ts, render/*
|
||||
schema/ — report.ts, finding.ts, practitioner.ts (Zod)
|
||||
state/ — reportStore.ts (Zustand persist), selectors.ts
|
||||
components/ — Header, Footer, Brand, ui/ (shadcn)
|
||||
lib/ — cn, id, date, motion
|
||||
styles/ — globals.css, tokens.css
|
||||
i18n/ — fr.ts
|
||||
tests/
|
||||
unit/ — vitest *.test.ts
|
||||
e2e/ — playwright roundtrip
|
||||
docs/
|
||||
ARCHITECTURE.md, ADDING-A-SPECIES.md, ANATOMY-SVG-CONVENTION.md
|
||||
public/
|
||||
favicon.svg
|
||||
Dockerfile, docker-compose.yml, nginx.conf
|
||||
.claude/ — tasks/, memory/, audits/
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Architecture
|
||||
|
||||
- Single Zustand store = source of truth (`useReportStore`). `persist` middleware autosaves to localStorage under key `osteo-report-draft`.
|
||||
- Zod schemas in `src/schema/` define the wire format. TS types derived via `z.infer`. No manual duplication.
|
||||
- Each species ships its own pack `{ anatomy, pathologies }`, registered in `src/species/registry.ts`. The form lists ALL species; only those registered are usable (others are disabled with a "à venir" badge). MVP = equine only.
|
||||
- PDF export builds A4 portrait with `pdf-lib`, then `PDFDocument.attach(JSON, 'report.json')`. On import, the file is parsed, the `report.json` attachment is read, validated through `ReportSchema.safeParse`. If absent → `NO_ATTACHMENT` error shown to user.
|
||||
- The `react-zoom-pan-pinch` library is used ONLY inside `ZoomOverlay` (modal) to avoid click+pan event conflicts on the main SVG.
|
||||
- nginx serves the static SPA with strict CSP (`unsafe-inline` allowed for `style-src` only — needed by motion).
|
||||
|
||||
---
|
||||
|
||||
## Project conventions
|
||||
|
||||
- Files: kebab-case folders, PascalCase components, camelCase utils.
|
||||
- Types from Zod: `type Foo = z.infer<typeof FooSchema>`. Never write a parallel interface.
|
||||
- Imports: absolute via `@/` (resolves to `src/`).
|
||||
- French strings: in `src/i18n/fr.ts` only. No hardcoded user-facing text in components.
|
||||
- One responsibility per component. Editor panels do NOT mutate store from JSX inline handlers — go through a store action.
|
||||
- Anatomy SVG layers: `#illustration` (non-interactive) + `#zones` (`data-zone="..."` clickable paths). See `docs/ANATOMY-SVG-CONVENTION.md`.
|
||||
|
||||
---
|
||||
|
||||
## Exceptions to global rules
|
||||
|
||||
- None. Global rules in `~/.claude/CLAUDE.md` apply.
|
||||
- `noUncheckedIndexedAccess` is on — be explicit about possible `undefined` from array indexing.
|
||||
|
||||
---
|
||||
|
||||
## Key dependencies
|
||||
|
||||
```
|
||||
react 19 — UI framework
|
||||
react-router 7 — client-side routing (3 routes)
|
||||
zustand 5 — state, with persist middleware
|
||||
zod 3 — runtime validation, source of types
|
||||
pdf-lib 1.17 — PDF build with file attachments
|
||||
react-hook-form 7 — form state
|
||||
react-zoom-pan-pinch — modal zoom for sub-zones
|
||||
motion 12 — animations (framer-motion lineage)
|
||||
date-fns — French date formatting
|
||||
nanoid — ID generation
|
||||
tailwindcss 4 — styling (CSS-config mode)
|
||||
shadcn/ui — base components (canary supports v4)
|
||||
lucide-react — icons
|
||||
vitest, @testing-library/react, playwright — tests
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Workflow expectations
|
||||
|
||||
- Read `.claude/memory/` registries at session start.
|
||||
- Plan in `.claude/tasks/TODO.md` before touching logic.
|
||||
- TDD for any non-trivial behavior: write test first, then make it pass.
|
||||
- Roundtrip test (`tests/unit/pdf.roundtrip.test.ts`) must stay green on every PR — it's the canary for breaking changes in the PDF format.
|
||||
- Never `npm install` a dep without naming it in this file's "Key dependencies" section.
|
||||
- No backend in MVP. If a task seems to need one, push it to Phase 2.
|
||||
- The pathology DB must cite sources. Adding entries without a source = blocker.
|
||||
- Anatomy illustrations and zone polygons are out of scope for code. Placeholders are acceptable until the artwork lands.
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
# Stage 1: Build
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --ignore-scripts
|
||||
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Production (nginx)
|
||||
FROM nginx:alpine AS production
|
||||
|
||||
# Remove default nginx config
|
||||
RUN rm /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Copy custom nginx config
|
||||
COPY nginx.conf /etc/nginx/conf.d/osteo.conf
|
||||
|
||||
# Copy built assets
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
|
||||
# Run as non-root
|
||||
RUN chown -R nginx:nginx /usr/share/nginx/html && \
|
||||
chown -R nginx:nginx /var/cache/nginx && \
|
||||
chown -R nginx:nginx /var/log/nginx && \
|
||||
touch /var/run/nginx.pid && \
|
||||
chown nginx:nginx /var/run/nginx.pid
|
||||
|
||||
USER nginx
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@@ -0,0 +1,661 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"$schema": "https://ui.shadcn.com/schema.json",
|
||||
"style": "new-york",
|
||||
"rsc": false,
|
||||
"tsx": true,
|
||||
"tailwind": {
|
||||
"config": "",
|
||||
"css": "src/styles/globals.css",
|
||||
"baseColor": "neutral",
|
||||
"cssVariables": true,
|
||||
"prefix": ""
|
||||
},
|
||||
"aliases": {
|
||||
"components": "@/components",
|
||||
"utils": "@/lib/cn",
|
||||
"ui": "@/components/ui",
|
||||
"lib": "@/lib",
|
||||
"hooks": "@/hooks"
|
||||
},
|
||||
"iconLibrary": "lucide"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "80:80"
|
||||
env_file:
|
||||
- .env
|
||||
restart: unless-stopped
|
||||
# Uncomment and configure Traefik labels for production deploy:
|
||||
# labels:
|
||||
# - "traefik.enable=true"
|
||||
# - "traefik.http.routers.osteo.rule=Host(`osteo.zenquality.fr`)"
|
||||
# - "traefik.http.routers.osteo.entrypoints=websecure"
|
||||
# - "traefik.http.routers.osteo.tls.certresolver=letsencrypt"
|
||||
# - "traefik.http.services.osteo.loadbalancer.server.port=80"
|
||||
|
||||
volumes: {}
|
||||
@@ -0,0 +1,21 @@
|
||||
# Ajouter une espèce
|
||||
|
||||
Le code est conçu pour rendre triviale l'ajout d'une nouvelle espèce. Trois fichiers + trois SVG.
|
||||
|
||||
## Étapes
|
||||
|
||||
1. **Créer le dossier** `src/species/<id>/` où `<id>` ∈ { chien, chat, equine, lapin, bovin, chevre, ane, mouton, porc, … }.
|
||||
2. **Anatomie** — `src/species/<id>/anatomy.ts` exporte un `SpeciesAnatomy` (voir `src/species/types.ts`) :
|
||||
- `id`, `label`, `vertebralFormula`
|
||||
- `zones[]` (id, label, catégorie, vues où visible, sous-zones éventuelles)
|
||||
- `svg` : chemins relatifs vers les 3 SVG (`lateral_left`, `lateral_right`, `dorsal`)
|
||||
3. **Pathologies** — `src/species/<id>/pathologies.ts` exporte `PathologyEntry[]`.
|
||||
Chaque entrée DOIT citer au moins une source clinique (Merck Veterinary Manual, IMAIOS,
|
||||
PubMed, etc.). Voir `src/species/equine/README.md` pour la liste des sources de référence.
|
||||
4. **Illustrations** — 3 SVG conformes à la convention (voir `ANATOMY-SVG-CONVENTION.md`) :
|
||||
- `lateral_left.svg`, `lateral_right.svg`, `dorsal.svg`
|
||||
- viewBox normalisé (1000×600 latéral, 1000×800 dorsal)
|
||||
- Couche `#illustration` + couche `#zones` avec `data-zone="<zoneId>"` sur chaque path.
|
||||
5. **Enregistrement** — dans `src/species/registry.ts`, importer puis `registerSpecies('<id>', { anatomy, pathologies })`.
|
||||
Ou : laisser le chargement paresseux via `import('./<id>/index.ts')` (préféré pour le code-splitting).
|
||||
6. **Test** — `tests/unit/species.<id>.test.ts` doit vérifier que le pack se charge et que la liste de zones est non vide.
|
||||
@@ -0,0 +1,42 @@
|
||||
# Convention SVG anatomique
|
||||
|
||||
Chaque vue (latéral gauche, latéral droit, dorsal) est un fichier SVG avec **au moins deux couches** :
|
||||
|
||||
```xml
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 600">
|
||||
<g id="illustration">
|
||||
<!-- tout le dessin : silhouettes, ombres, traits -->
|
||||
<!-- AUCUN evènement, pointer-events: none côté CSS -->
|
||||
</g>
|
||||
|
||||
<g id="zones">
|
||||
<!-- une <path>/<polygon> par zone cliquable -->
|
||||
<path id="zone-shoulder-l"
|
||||
data-zone="zone-shoulder-l"
|
||||
fill="transparent" />
|
||||
<path id="zone-thoracic-back"
|
||||
data-zone="zone-thoracic-back"
|
||||
fill="transparent" />
|
||||
<!-- ... -->
|
||||
</g>
|
||||
</svg>
|
||||
```
|
||||
|
||||
## Règles
|
||||
|
||||
- **viewBox normalisé** :
|
||||
- Vues latérales : `0 0 1000 600`
|
||||
- Vue dorsale : `0 0 1000 800`
|
||||
- **IDs de zones** : `zone-<region>-<side?>`, en minuscules, kebab-case.
|
||||
- Exemples : `zone-neck`, `zone-shoulder-l`, `zone-shoulder-r`, `zone-thoracic-back`, `zone-lumbar`, `zone-hip-l`, `zone-tail`.
|
||||
- **Attribut clef** : `data-zone="<id>"` doit matcher l'id de zone dans `anatomy.ts`.
|
||||
- **Couleur des zones cliquables** : `fill="transparent"` par défaut. Le CSS applique le style selon `data-selected`, `data-linked`, `data-hovered`.
|
||||
- **Pas d'interactivité** sur la couche `#illustration` (CSS : `pointer-events: none`).
|
||||
- **Sous-zones** (vertèbres T1-T18, etc.) : dans un SVG séparé, ouvert dans `ZoomOverlay`.
|
||||
Convention identique avec `data-subzone="T7"` etc.
|
||||
|
||||
## Outils suggérés
|
||||
|
||||
- Inkscape ou Figma pour le tracé des polygones par-dessus l'illustration.
|
||||
- Une fois tracés, exporter en SVG plain (Inkscape : "Sauvegarder une copie → SVG simple").
|
||||
- Nettoyer avec [SVGO](https://github.com/svg/svgo) en préservant les IDs et attributs `data-*`.
|
||||
@@ -0,0 +1,42 @@
|
||||
# Architecture — Osteo Report
|
||||
|
||||
## Vue d'ensemble
|
||||
|
||||
SPA React 100 % cliente. Aucun backend pour le MVP. Tout l'état vit dans le navigateur ; la persistance canonique est le PDF exporté (le JSON du bilan est embarqué en pièce jointe PDF native).
|
||||
|
||||
## Flux
|
||||
|
||||
```
|
||||
Choix : Nouveau bilan ─┐
|
||||
├─► Éditeur (3 vues anatomiques)
|
||||
Importer PDF ──────────┘ │
|
||||
├─► Sélection zones ─► Findings
|
||||
├─► Conclusion / Recommandations / RDV
|
||||
└─► Export PDF (joint report.json)
|
||||
```
|
||||
|
||||
## Modules
|
||||
|
||||
| Module | Rôle |
|
||||
|-----------------------|------|
|
||||
| `state/reportStore` | Source de vérité unique. Persist localStorage (autosave). |
|
||||
| `schema/*` | Schémas Zod = source de types (`z.infer`). Version 1. |
|
||||
| `species/registry` | Map `SpeciesId` → `SpeciesPack { anatomy, pathologies }`. |
|
||||
| `species/equine/*` | Données cliniques cheval (anatomie + pathologies sourcées). |
|
||||
| `editor/*` | UI d'édition : vue anatomique, sélection, panneau findings, zoom. |
|
||||
| `pdf/export` | Construit le PDF A4 + attache `report.json`. |
|
||||
| `pdf/import` | Lit la pièce jointe, valide Zod, restitue l'état. |
|
||||
| `routes/*` | 3 routes : `/`, `/new`, `/editor`, 404. |
|
||||
|
||||
## Décisions structurantes
|
||||
|
||||
- **Pas de backend MVP.** RGPD trivial, scalabilité gratuite, surface d'attaque minimale.
|
||||
- **Tailwind 4** via `@tailwindcss/vite` (config CSS dans `globals.css`).
|
||||
- **React 19** + TS strict + `noUncheckedIndexedAccess` + `exactOptionalPropertyTypes`.
|
||||
- **Anatomie SVG** : convention à 2 couches (`#illustration` non interactive + `#zones` avec `data-zone="..."` cliquables). Voir `ANATOMY-SVG-CONVENTION.md`.
|
||||
- **Zoom sous-zones** : modal dédié avec `react-zoom-pan-pinch`. Le SVG principal reste pure click.
|
||||
- **Versioning PDF** : champ `version` dans le JSON. Migrations explicites à l'import.
|
||||
|
||||
## Phase 2 (hors MVP)
|
||||
|
||||
Ajout backend (PostgreSQL) + comptes praticiens + historique par animal. La couche métier (`schema/`, `state/`, `pdf/`) reste intacte ; seul un adapter de persistance s'ajoute.
|
||||
@@ -0,0 +1,43 @@
|
||||
import js from '@eslint/js';
|
||||
import tseslint from 'typescript-eslint';
|
||||
import reactHooks from 'eslint-plugin-react-hooks';
|
||||
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
||||
import importX from 'eslint-plugin-import-x';
|
||||
import prettierConfig from 'eslint-config-prettier';
|
||||
|
||||
export default tseslint.config(
|
||||
{
|
||||
ignores: ['dist/', 'node_modules/', 'coverage/', 'playwright-report/', 'test-results/'],
|
||||
},
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.strictTypeChecked,
|
||||
...tseslint.configs.stylisticTypeChecked,
|
||||
{
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.app.json'],
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
'react-hooks': reactHooks,
|
||||
'jsx-a11y': jsxA11y,
|
||||
'import-x': importX,
|
||||
},
|
||||
rules: {
|
||||
...reactHooks.configs.recommended.rules,
|
||||
...jsxA11y.configs.recommended.rules,
|
||||
'import-x/order': [
|
||||
'warn',
|
||||
{
|
||||
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
|
||||
'newlines-between': 'always',
|
||||
alphabetize: { order: 'asc' },
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
||||
'@typescript-eslint/consistent-type-imports': 'error',
|
||||
},
|
||||
},
|
||||
prettierConfig,
|
||||
);
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<!doctype html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="Osteo Report — outil de compte-rendu ostéopathique vétérinaire" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<title>Osteo Report</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# Gzip compression
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
gzip_comp_level 6;
|
||||
gzip_types
|
||||
text/plain
|
||||
text/css
|
||||
text/xml
|
||||
text/javascript
|
||||
application/json
|
||||
application/javascript
|
||||
application/xml
|
||||
application/xml+rss
|
||||
image/svg+xml;
|
||||
|
||||
# Security headers
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
||||
add_header Content-Security-Policy
|
||||
"default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self'; connect-src 'self'; worker-src blob:; object-src 'none'; base-uri 'self'; form-action 'self';"
|
||||
always;
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
|
||||
# SPA fallback
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
}
|
||||
|
||||
# Cache static assets 1 year
|
||||
location ~* \.(js|css|woff2|woff|ttf|otf|ico|svg|png|jpg|jpeg|gif|webp)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# No cache for index
|
||||
location = /index.html {
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
add_header Pragma "no-cache";
|
||||
expires 0;
|
||||
}
|
||||
}
|
||||
Generated
+9982
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"name": "osteo-report",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"license": "AGPL-3.0-only",
|
||||
"author": "ZenQuality / Bastien Chanot <chanot.bastien@gmail.com>",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc -b && vite build",
|
||||
"preview": "vite preview",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"test:e2e": "playwright test",
|
||||
"lint": "eslint .",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"format": "prettier --write .",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"prepare": "husky"
|
||||
},
|
||||
"dependencies": {
|
||||
"@hookform/resolvers": "^3.9.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"date-fns": "^4.1.0",
|
||||
"framer-motion": "^12.38.0",
|
||||
"lucide-react": "^0.468.0",
|
||||
"motion": "^12.38.0",
|
||||
"nanoid": "^5.0.9",
|
||||
"pdf-lib": "^1.17.1",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-hook-form": "^7.54.0",
|
||||
"react-router-dom": "^7.0.2",
|
||||
"react-zoom-pan-pinch": "^3.7.0",
|
||||
"tailwind-merge": "^2.6.0",
|
||||
"zod": "^3.23.8",
|
||||
"zustand": "^5.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.49.1",
|
||||
"@tailwindcss/vite": "^4.0.0",
|
||||
"@testing-library/jest-dom": "^6.6.3",
|
||||
"@testing-library/react": "^16.1.0",
|
||||
"@testing-library/user-event": "^14.5.2",
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-dom": "^19.0.0",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"eslint": "^9.17.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-import-x": "^4.5.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
||||
"eslint-plugin-react-hooks": "^5.1.0",
|
||||
"husky": "^9.1.7",
|
||||
"jsdom": "^25.0.1",
|
||||
"lint-staged": "^15.3.0",
|
||||
"prettier": "^3.4.2",
|
||||
"tailwindcss": "^4.0.0",
|
||||
"typescript": "^5.6.3",
|
||||
"typescript-eslint": "^8.18.2",
|
||||
"vite": "^6.0.5",
|
||||
"vite-plugin-svgr": "^4.3.0",
|
||||
"vitest": "^2.1.8"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{ts,tsx}": [
|
||||
"eslint --fix",
|
||||
"prettier --write"
|
||||
],
|
||||
"*.{json,css,md}": [
|
||||
"prettier --write"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { defineConfig, devices } from '@playwright/test';
|
||||
|
||||
export default defineConfig({
|
||||
testDir: './tests/e2e',
|
||||
fullyParallel: true,
|
||||
forbidOnly: !!process.env['CI'],
|
||||
retries: process.env['CI'] ? 2 : 0,
|
||||
workers: process.env['CI'] ? 1 : undefined,
|
||||
reporter: 'html',
|
||||
use: {
|
||||
baseURL: 'http://localhost:4173',
|
||||
trace: 'on-first-retry',
|
||||
},
|
||||
projects: [
|
||||
{
|
||||
name: 'chromium',
|
||||
use: { ...devices['Desktop Chrome'] },
|
||||
},
|
||||
],
|
||||
webServer: {
|
||||
command: 'npm run preview',
|
||||
url: 'http://localhost:4173',
|
||||
reuseExistingServer: !process.env['CI'],
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
|
||||
<circle cx="32" cy="32" r="30" fill="#4a7c59"/>
|
||||
<path d="M22 28 Q32 18 42 28 Q42 38 32 46 Q22 38 22 28 Z" fill="#fffdf8" opacity="0.9"/>
|
||||
<circle cx="32" cy="34" r="3" fill="#2d4a35"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 281 B |
+19
@@ -0,0 +1,19 @@
|
||||
import { BrowserRouter, Route, Routes } from 'react-router-dom';
|
||||
|
||||
import { EditorRoute } from './routes/EditorRoute';
|
||||
import { HomeRoute } from './routes/HomeRoute';
|
||||
import { NewReportRoute } from './routes/NewReportRoute';
|
||||
import { NotFoundRoute } from './routes/NotFoundRoute';
|
||||
|
||||
export function App(): JSX.Element {
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<Routes>
|
||||
<Route path="/" element={<HomeRoute />} />
|
||||
<Route path="/new" element={<NewReportRoute />} />
|
||||
<Route path="/editor" element={<EditorRoute />} />
|
||||
<Route path="*" element={<NotFoundRoute />} />
|
||||
</Routes>
|
||||
</BrowserRouter>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function Brand(): JSX.Element | null {
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function Footer(): JSX.Element | null {
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function Header(): JSX.Element | null {
|
||||
return null;
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,3 @@
|
||||
export function AnatomyCanvas(): JSX.Element | null {
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function AnatomyView(): JSX.Element | null {
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function ConclusionPanel(): JSX.Element | null {
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function ExportButton(): JSX.Element | null {
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function FindingEditor(): JSX.Element | null {
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function FindingPanel(): JSX.Element | null {
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function ZoneSelection(): JSX.Element | null {
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function ZoomOverlay(): JSX.Element | null {
|
||||
return null;
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,32 @@
|
||||
export const FR = {
|
||||
app: {
|
||||
name: 'Osteo Report',
|
||||
tagline: 'Bilans ostéopathiques vétérinaires',
|
||||
},
|
||||
home: {
|
||||
new: 'Nouveau bilan',
|
||||
import: 'Importer un PDF existant',
|
||||
importHint: 'Glissez un PDF généré par cette application',
|
||||
},
|
||||
species: {
|
||||
chien: 'Chien',
|
||||
chat: 'Chat',
|
||||
equine: 'Cheval',
|
||||
lapin: 'Lapin',
|
||||
bovin: 'Bovin',
|
||||
chevre: 'Chèvre',
|
||||
ane: 'Âne',
|
||||
mouton: 'Mouton',
|
||||
porc: 'Porc',
|
||||
} as Record<string, string>,
|
||||
severity: {
|
||||
mild: 'Légère',
|
||||
moderate: 'Modérée',
|
||||
severe: 'Sévère',
|
||||
} as Record<string, string>,
|
||||
errors: {
|
||||
importNotFromApp:
|
||||
"Ce PDF n'a pas été généré par cette application. L'import est impossible.",
|
||||
importInvalid: "Le contenu du PDF n'a pas pu être lu.",
|
||||
},
|
||||
} as const;
|
||||
@@ -0,0 +1,6 @@
|
||||
import { clsx, type ClassValue } from 'clsx';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
export function cn(...inputs: ClassValue[]): string {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { format, parseISO } from 'date-fns';
|
||||
import { fr } from 'date-fns/locale';
|
||||
|
||||
export function formatDateFr(iso: string): string {
|
||||
return format(parseISO(iso), 'd MMMM yyyy', { locale: fr });
|
||||
}
|
||||
|
||||
export function todayIso(): string {
|
||||
return new Date().toISOString().slice(0, 10);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
export function newId(prefix?: string): string {
|
||||
return prefix ? `${prefix}_${nanoid(10)}` : nanoid(12);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { Transition } from 'motion/react';
|
||||
|
||||
export const SPRING: Transition = {
|
||||
type: 'spring',
|
||||
stiffness: 260,
|
||||
damping: 22,
|
||||
};
|
||||
|
||||
export const FADE_IN_UP: Transition = {
|
||||
duration: 0.2,
|
||||
ease: [0.22, 1, 0.36, 1],
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
import { StrictMode } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
|
||||
import { App } from './App';
|
||||
import './styles/globals.css';
|
||||
|
||||
const container = document.getElementById('root');
|
||||
if (!container) throw new Error('Root container #root not found');
|
||||
|
||||
createRoot(container).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
</StrictMode>,
|
||||
);
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { Report } from '../schema/report';
|
||||
|
||||
export interface AnatomyAssets {
|
||||
svg: Record<string, string>;
|
||||
}
|
||||
|
||||
export async function exportReport(_report: Report, _assets: AnatomyAssets): Promise<Blob> {
|
||||
throw new Error('exportReport not implemented');
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { Report } from '../schema/report';
|
||||
|
||||
export type ImportFailure =
|
||||
| { ok: false; reason: 'NO_ATTACHMENT' }
|
||||
| { ok: false; reason: 'INVALID_JSON'; details?: string }
|
||||
| { ok: false; reason: 'SCHEMA_MISMATCH'; details?: string }
|
||||
| { ok: false; reason: 'UNREADABLE_PDF'; details?: string };
|
||||
|
||||
export type ImportResult = { ok: true; report: Report } | ImportFailure;
|
||||
|
||||
export async function importReport(_file: File): Promise<ImportResult> {
|
||||
throw new Error('importReport not implemented');
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export {};
|
||||
@@ -0,0 +1 @@
|
||||
export {};
|
||||
@@ -0,0 +1 @@
|
||||
export {};
|
||||
@@ -0,0 +1 @@
|
||||
export {};
|
||||
@@ -0,0 +1,2 @@
|
||||
export const PDF_SCHEMA_VERSION = 1 as const;
|
||||
export const PDF_ATTACHMENT_NAME = 'report.json' as const;
|
||||
@@ -0,0 +1,3 @@
|
||||
export function EditorRoute(): JSX.Element {
|
||||
return <div data-route="editor" />;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function HomeRoute(): JSX.Element {
|
||||
return <div data-route="home" />;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function NewReportRoute(): JSX.Element {
|
||||
return <div data-route="new" />;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function NotFoundRoute(): JSX.Element {
|
||||
return <div data-route="not-found" />;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const SeveritySchema = z.enum(['mild', 'moderate', 'severe']);
|
||||
export type Severity = z.infer<typeof SeveritySchema>;
|
||||
|
||||
export const PathologyRefSchema = z.object({
|
||||
id: z.string().min(1),
|
||||
label: z.string().min(1),
|
||||
free: z.boolean().default(false),
|
||||
});
|
||||
export type PathologyRef = z.infer<typeof PathologyRefSchema>;
|
||||
|
||||
export const FindingSchema = z.object({
|
||||
id: z.string().min(1),
|
||||
zones: z.array(z.string()).min(1),
|
||||
linkedZones: z.array(z.string()).default([]),
|
||||
pathologies: z.array(PathologyRefSchema).default([]),
|
||||
severity: SeveritySchema,
|
||||
comment: z.string().default(''),
|
||||
});
|
||||
export type Finding = z.infer<typeof FindingSchema>;
|
||||
@@ -0,0 +1,12 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const PractitionerSchema = z.object({
|
||||
fullName: z.string().min(1),
|
||||
title: z.string().optional(),
|
||||
phone: z.string().optional(),
|
||||
email: z.string().email().optional(),
|
||||
address: z.string().optional(),
|
||||
siret: z.string().optional(),
|
||||
});
|
||||
|
||||
export type Practitioner = z.infer<typeof PractitionerSchema>;
|
||||
@@ -0,0 +1,37 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { FindingSchema } from './finding';
|
||||
import { PractitionerSchema } from './practitioner';
|
||||
|
||||
export const SCHEMA_VERSION = 1 as const;
|
||||
|
||||
export const SpeciesIdSchema = z.enum([
|
||||
'chien',
|
||||
'chat',
|
||||
'equine',
|
||||
'lapin',
|
||||
'bovin',
|
||||
'chevre',
|
||||
'ane',
|
||||
'mouton',
|
||||
'porc',
|
||||
]);
|
||||
|
||||
export const ReportSchema = z.object({
|
||||
version: z.literal(SCHEMA_VERSION),
|
||||
id: z.string().min(1),
|
||||
createdAt: z.string().datetime(),
|
||||
species: SpeciesIdSchema,
|
||||
practitioner: PractitionerSchema,
|
||||
animal: z.object({
|
||||
name: z.string().min(1),
|
||||
owner: z.string().min(1),
|
||||
}),
|
||||
sessionDate: z.string(),
|
||||
findings: z.array(FindingSchema).default([]),
|
||||
conclusion: z.string().default(''),
|
||||
recommendations: z.string().default(''),
|
||||
nextAppointment: z.string().optional(),
|
||||
});
|
||||
|
||||
export type Report = z.infer<typeof ReportSchema>;
|
||||
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,17 @@
|
||||
# Cheval — anatomie et pathologies
|
||||
|
||||
Sources clinique-vétérinaires devant figurer en référence pour chaque entrée de
|
||||
`pathologies.ts` :
|
||||
|
||||
- Merck Veterinary Manual — https://www.merckvetmanual.com
|
||||
- IMAIOS vet-Anatomy — https://www.imaios.com/en/vet-anatomy
|
||||
- PubMed Central — https://www.ncbi.nlm.nih.gov/pmc/
|
||||
- Veterinary Clinics of North America: Equine Practice (Elsevier)
|
||||
- Equine Veterinary Journal (Wiley/BEVA)
|
||||
- London College of Animal Osteopathy — https://lcao.com
|
||||
- WikiVet — https://en.wikivet.net
|
||||
|
||||
Formule vertébrale du cheval : C7 / T18 / L6 / S5.
|
||||
|
||||
Toute pathologie ajoutée doit citer au moins une source. Pas d'entrée
|
||||
inventée — la base est ensuite relue et validée par le praticien client.
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { SpeciesAnatomy } from '../types';
|
||||
|
||||
export const EQUINE_ANATOMY: SpeciesAnatomy = {
|
||||
id: 'equine',
|
||||
label: 'Cheval',
|
||||
vertebralFormula: { cervical: 7, thoracic: 18, lumbar: 6, sacral: 5 },
|
||||
zones: [],
|
||||
svg: {
|
||||
lateral_left: '',
|
||||
lateral_right: '',
|
||||
dorsal: '',
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
import type { PathologyEntry } from '../types';
|
||||
|
||||
export const EQUINE_PATHOLOGIES: PathologyEntry[] = [];
|
||||
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,20 @@
|
||||
import type { PathologyEntry, SpeciesAnatomy, SpeciesId } from './types';
|
||||
|
||||
export interface SpeciesPack {
|
||||
anatomy: SpeciesAnatomy;
|
||||
pathologies: PathologyEntry[];
|
||||
}
|
||||
|
||||
export const SPECIES: Partial<Record<SpeciesId, SpeciesPack>> = {};
|
||||
|
||||
export function registerSpecies(id: SpeciesId, pack: SpeciesPack): void {
|
||||
SPECIES[id] = pack;
|
||||
}
|
||||
|
||||
export function getSpecies(id: SpeciesId): SpeciesPack | undefined {
|
||||
return SPECIES[id];
|
||||
}
|
||||
|
||||
export function isSpeciesAvailable(id: SpeciesId): boolean {
|
||||
return SPECIES[id] !== undefined;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
export type SpeciesId =
|
||||
| 'chien'
|
||||
| 'chat'
|
||||
| 'equine'
|
||||
| 'lapin'
|
||||
| 'bovin'
|
||||
| 'chevre'
|
||||
| 'ane'
|
||||
| 'mouton'
|
||||
| 'porc';
|
||||
|
||||
export type View = 'lateral_left' | 'lateral_right' | 'dorsal';
|
||||
|
||||
export type ZoneCategory = 'axial' | 'limb' | 'head' | 'tail' | 'other';
|
||||
|
||||
export interface Subzone {
|
||||
id: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
export interface Zone {
|
||||
id: string;
|
||||
label: string;
|
||||
category: ZoneCategory;
|
||||
views: View[];
|
||||
subzones?: Subzone[];
|
||||
}
|
||||
|
||||
export interface VertebralFormula {
|
||||
cervical: number;
|
||||
thoracic: number;
|
||||
lumbar: number;
|
||||
sacral: number;
|
||||
}
|
||||
|
||||
export interface SpeciesAnatomy {
|
||||
id: SpeciesId;
|
||||
label: string;
|
||||
vertebralFormula: VertebralFormula;
|
||||
zones: Zone[];
|
||||
svg: Record<View, string>;
|
||||
}
|
||||
|
||||
export interface PathologyEntry {
|
||||
id: string;
|
||||
label: string;
|
||||
description: string;
|
||||
category:
|
||||
| 'osseux'
|
||||
| 'articulaire'
|
||||
| 'musculaire'
|
||||
| 'tendino-ligamentaire'
|
||||
| 'fascial'
|
||||
| 'visceral'
|
||||
| 'cranio-sacre'
|
||||
| 'nerveux'
|
||||
| 'autre';
|
||||
applicableSpecies: SpeciesId[];
|
||||
applicableZones: string[];
|
||||
sources: string[];
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
import { create } from 'zustand';
|
||||
import { persist } from 'zustand/middleware';
|
||||
|
||||
import type { Finding } from '../schema/finding';
|
||||
import type { Report } from '../schema/report';
|
||||
|
||||
interface ReportState {
|
||||
report: Report | null;
|
||||
selection: string[];
|
||||
hydrate: (r: Report) => void;
|
||||
reset: () => void;
|
||||
toggleZone: (zoneId: string) => void;
|
||||
clearSelection: () => void;
|
||||
addFinding: (f: Finding) => void;
|
||||
updateFinding: (id: string, patch: Partial<Finding>) => void;
|
||||
removeFinding: (id: string) => void;
|
||||
setConclusion: (text: string) => void;
|
||||
setRecommendations: (text: string) => void;
|
||||
setNextAppointment: (date: string | undefined) => void;
|
||||
}
|
||||
|
||||
export const useReportStore = create<ReportState>()(
|
||||
persist(
|
||||
(set) => ({
|
||||
report: null,
|
||||
selection: [],
|
||||
hydrate: () => {
|
||||
// implemented in feature task
|
||||
},
|
||||
reset: () => set({ report: null, selection: [] }),
|
||||
toggleZone: () => {
|
||||
// implemented in feature task
|
||||
},
|
||||
clearSelection: () => set({ selection: [] }),
|
||||
addFinding: () => {
|
||||
// implemented in feature task
|
||||
},
|
||||
updateFinding: () => {
|
||||
// implemented in feature task
|
||||
},
|
||||
removeFinding: () => {
|
||||
// implemented in feature task
|
||||
},
|
||||
setConclusion: () => {
|
||||
// implemented in feature task
|
||||
},
|
||||
setRecommendations: () => {
|
||||
// implemented in feature task
|
||||
},
|
||||
setNextAppointment: () => {
|
||||
// implemented in feature task
|
||||
},
|
||||
}),
|
||||
{ name: 'osteo-report-draft' },
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,19 @@
|
||||
import type { Finding } from '../schema/finding';
|
||||
import type { Report } from '../schema/report';
|
||||
|
||||
export function findingsByZone(report: Report | null, zoneId: string): Finding[] {
|
||||
if (!report) return [];
|
||||
return report.findings.filter(
|
||||
(f) => f.zones.includes(zoneId) || f.linkedZones.includes(zoneId),
|
||||
);
|
||||
}
|
||||
|
||||
export function zonesInUse(report: Report | null): string[] {
|
||||
if (!report) return [];
|
||||
const ids = new Set<string>();
|
||||
for (const f of report.findings) {
|
||||
for (const z of f.zones) ids.add(z);
|
||||
for (const z of f.linkedZones) ids.add(z);
|
||||
}
|
||||
return Array.from(ids);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
@import 'tailwindcss';
|
||||
@import './tokens.css';
|
||||
|
||||
@theme {
|
||||
--color-clinic-50: var(--clinic-50);
|
||||
--color-clinic-100: var(--clinic-100);
|
||||
--color-clinic-200: var(--clinic-200);
|
||||
--color-clinic-300: var(--clinic-300);
|
||||
--color-clinic-400: var(--clinic-400);
|
||||
--color-clinic-500: var(--clinic-500);
|
||||
--color-clinic-600: var(--clinic-600);
|
||||
--color-clinic-700: var(--clinic-700);
|
||||
--color-clinic-800: var(--clinic-800);
|
||||
--color-clinic-900: var(--clinic-900);
|
||||
--color-warm-300: var(--warm-300);
|
||||
--color-warm-400: var(--warm-400);
|
||||
--color-warm-500: var(--warm-500);
|
||||
--color-surface: var(--surface);
|
||||
--color-ink: var(--ink);
|
||||
--font-sans: 'Inter', system-ui, sans-serif;
|
||||
--font-display: 'Fraunces', Georgia, serif;
|
||||
--font-mono: 'JetBrains Mono', ui-monospace, monospace;
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
#root {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--surface);
|
||||
color: var(--ink);
|
||||
font-family: var(--font-sans);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
:root {
|
||||
/* Clinical green — primary identity */
|
||||
--clinic-50: #f4f7f2;
|
||||
--clinic-100: #e6ede0;
|
||||
--clinic-200: #cbdac1;
|
||||
--clinic-300: #a6c099;
|
||||
--clinic-400: #7ba370;
|
||||
--clinic-500: #4a7c59;
|
||||
--clinic-600: #3c6849;
|
||||
--clinic-700: #2d4a35;
|
||||
--clinic-800: #1f3527;
|
||||
--clinic-900: #14241b;
|
||||
|
||||
/* Warm accent — severity / warnings */
|
||||
--warm-300: #d4a574;
|
||||
--warm-400: #b9854a;
|
||||
--warm-500: #a8612d;
|
||||
|
||||
/* Neutrals */
|
||||
--surface: #fffdf8;
|
||||
--ink: #1a2b1f;
|
||||
|
||||
/* Severity scale tokens */
|
||||
--severity-mild: var(--clinic-400);
|
||||
--severity-moderate: var(--warm-300);
|
||||
--severity-severe: var(--warm-500);
|
||||
|
||||
/* Zone state tokens */
|
||||
--zone-default: transparent;
|
||||
--zone-hover: color-mix(in oklab, var(--clinic-300) 30%, transparent);
|
||||
--zone-selected: color-mix(in oklab, var(--clinic-500) 45%, transparent);
|
||||
--zone-linked: color-mix(in oklab, var(--warm-400) 45%, transparent);
|
||||
}
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
/// <reference types="vite/client" />
|
||||
/// <reference types="vite-plugin-svgr/client" />
|
||||
@@ -0,0 +1,41 @@
|
||||
import type { Config } from 'tailwindcss';
|
||||
|
||||
const config: Config = {
|
||||
darkMode: 'class',
|
||||
content: [
|
||||
'./index.html',
|
||||
'./src/**/*.{ts,tsx,js,jsx}',
|
||||
],
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
clinic: {
|
||||
'50': 'var(--clinic-50)',
|
||||
'100': 'var(--clinic-100)',
|
||||
'200': 'var(--clinic-200)',
|
||||
'300': 'var(--clinic-300)',
|
||||
'400': 'var(--clinic-400)',
|
||||
'500': 'var(--clinic-500)',
|
||||
'600': 'var(--clinic-600)',
|
||||
'700': 'var(--clinic-700)',
|
||||
'800': 'var(--clinic-800)',
|
||||
'900': 'var(--clinic-900)',
|
||||
},
|
||||
warm: {
|
||||
'300': 'var(--warm-300)',
|
||||
'400': 'var(--warm-400)',
|
||||
'500': 'var(--warm-500)',
|
||||
},
|
||||
surface: 'var(--surface)',
|
||||
ink: 'var(--ink)',
|
||||
},
|
||||
fontFamily: {
|
||||
sans: ['var(--font-sans)', 'system-ui', 'sans-serif'],
|
||||
mono: ['var(--font-mono)', 'monospace'],
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
};
|
||||
|
||||
export default config;
|
||||
Whitespace-only changes.
@@ -0,0 +1 @@
|
||||
import '@testing-library/jest-dom/vitest';
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
|
||||
/* Strict */
|
||||
"strict": true,
|
||||
"noImplicitAny": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"exactOptionalPropertyTypes": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
|
||||
/* Paths */
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"files": [],
|
||||
"references": [
|
||||
{ "path": "./tsconfig.node.json" },
|
||||
{ "path": "./tsconfig.app.json" }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"lib": ["ES2022"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
|
||||
/* Strict */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true
|
||||
},
|
||||
"include": ["vite.config.ts", "vitest.config.ts", "playwright.config.ts", "eslint.config.js"]
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import svgr from 'vite-plugin-svgr';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import path from 'node:path';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react(), svgr(), tailwindcss()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
port: 5173,
|
||||
},
|
||||
build: {
|
||||
sourcemap: false,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
vendor: ['react', 'react-dom', 'react-router-dom'],
|
||||
pdf: ['pdf-lib'],
|
||||
motion: ['motion'],
|
||||
ui: ['lucide-react', 'class-variance-authority', 'clsx', 'tailwind-merge'],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import path from 'node:path';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
},
|
||||
},
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
setupFiles: ['./tests/unit/setup.ts'],
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
reporter: ['text', 'lcov'],
|
||||
include: ['src/**/*.{ts,tsx}'],
|
||||
exclude: ['src/**/*.d.ts', 'src/vite-env.d.ts'],
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user