A visual editor for managing the OpenPrintTag Database. Built with TanStack Router, React, and TypeScript.
This editor provides a user-friendly interface for:
- Managing Brands — Add, edit, and view material manufacturers
- Managing Materials — Create materials with detailed properties, colors, and specifications
- Managing Packages — Define physical products with GTINs/barcodes
- Managing Containers — Specify spool dimensions and weights
- Viewing Enums — Browse allowed values for material types, tags, certifications
The editor reads and writes directly to the data/ directory, making it easy to prepare contributions for the main repository.
# From the repository root
make editorThis automatically checks for Node.js 18+, installs pnpm and dependencies if needed, and starts the editor.
Prerequisites:
- Node.js 18+
- pnpm
cd ui-editor
pnpm install
pnpm devOpen http://localhost:3000 in your browser.
The editor has three main sections accessible from the top navigation:
| Section | Description |
|---|---|
| Brands | Browse and manage material manufacturers. Click a brand to see its materials and packages. |
| Containers | View and edit spool/container specifications. |
| Enum | Browse allowed values for fields like material types, tags, and certifications. |
- Navigate to Brands → Click on a brand
- Find the Materials section
- Click "+ Add Material"
- Fill material details
- Click Save
The editor creates data/materials/{brand-slug}/{material-slug}.yaml.
- Navigate to Brands → Click on a brand
- Find the Packages section
- Click "+ Add Package"
- Fill package details
- Click Save
The editor creates data/material-packages/{brand-slug}/{package-slug}.yaml.
Containers can be added in two ways:
Option 1: From the Containers page
- Navigate to Containers in the navigation
- Click "New Container" button
- Fill container details
- Click Save
Option 2: From a Brand page
- Navigate to Brands → Click on a brand
- Find the Containers section
- Click "+ Add Container"
- Fill container details (same as Option 1)
- Click Save
The editor creates data/material-containers/{container-slug}.yaml.
- Navigate to the entity you want to edit
- Click on it to open the detail view
- Click "Edit" to enter edit mode
- Make your changes
- Click Save
ui-editor/
├── src/
│ ├── components/ # UI components
│ │ ├── brand-sheet/ # Brand detail views
│ │ ├── material-sheet/# Material detail views
│ │ ├── package-sheet/ # Package detail views
│ │ ├── container-sheet/# Container detail views
│ │ └── ui/ # Shared UI components (buttons, dialogs)
│ ├── hooks/ # React hooks for data fetching
│ ├── routes/ # TanStack Router routes
│ │ ├── api/ # Server API endpoints
│ │ └── brands/ # Brand-related pages
│ ├── server/ # Server-side utilities
│ └── utils/ # Helper functions
├── public/ # Static assets
└── package.json
pnpm dev # Start development server with hot reload
pnpm build # Build for production
pnpm preview # Preview production build
pnpm typecheck # Run TypeScript type checking
pnpm lint # Run ESLint
pnpm lint:fix # Fix linting issues automatically
pnpm format # Format code with Prettier- TanStack Router — File-based routing with full type safety
- TanStack Query — Data fetching and caching
- React 19 — UI framework
- Tailwind CSS 4 — Styling
- Radix UI — Accessible UI primitives
- Vite — Build tool and dev server
The editor runs as a full-stack application:
- Frontend renders the UI and handles user interactions
- API routes (
src/routes/api/) read and write YAML files in thedata/directory - Schemas are loaded from
openprinttag/schema/to validate and inform the UI
Changes are saved directly to disk, so you can:
- Edit data in the UI
- See the changes reflected in the YAML files
- Commit the changes to Git
- Submit a Pull Request
Make sure you've fetched the schemas from the repository root:
cd ..
make fetch-schemasThe editor validates data against the OpenPrintTag schema. If you see validation errors:
- Check the error message for which field is invalid
- Refer to the Architecture Docs for field requirements
- Fix the invalid field and try saving again
Try refreshing the page. If the issue persists:
- Check the browser console for errors
- Verify the YAML files exist in the
data/directory - Ensure the YAML syntax is valid
See the main CONTRIBUTING.md for guidelines on submitting changes to the database.
For issues specific to the editor UI, please open an issue on GitHub.