Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
9ebeab5
Update profiles
github-actions[bot] Dec 23, 2025
22356c5
Update profiles
github-actions[bot] Dec 30, 2025
377c058
Update profiles
github-actions[bot] Jan 3, 2026
8e63bcb
Update profiles
github-actions[bot] Jan 6, 2026
df950b0
Update profiles
github-actions[bot] Jan 7, 2026
2adfc97
Update profiles
github-actions[bot] Jan 8, 2026
e689df3
Move old webui and init new one
coffandro Jan 8, 2026
06f4d95
Initial implementation with new API
coffandro Jan 8, 2026
d07efae
Update profiles
github-actions[bot] Jan 10, 2026
1c87a96
Update profiles
github-actions[bot] Jan 15, 2026
5b4299a
Update a lot of things to allow for cloud local stores and brands
coffandro Jan 16, 2026
133907a
Merge branch 'main' into webui_overhaul
coffandro Jan 16, 2026
5745983
Reorganise and add materials
coffandro Jan 16, 2026
329d7c8
Move to shadcn
coffandro Jan 16, 2026
b9e2053
Merge main into webui_overhaul, keeping webui changes
coffandro Jan 17, 2026
1be873f
Cleanup webui
coffandro Jan 17, 2026
38fd5d4
Merge branch 'main' into webui_overhaul
coffandro Jan 17, 2026
5dce2ae
Mostly just cleaning up, generalising and making everything work a bi…
coffandro Jan 17, 2026
dc13025
Cleanup
coffandro Jan 22, 2026
841246d
Even more overhauling
coffandro Jan 22, 2026
2cff7d8
Begin move to dynamic building of forms
coffandro Jan 23, 2026
75c3eca
Merge branch 'main' into webui_overhaul
coffandro Jan 23, 2026
00b1724
Caching
coffandro Jan 23, 2026
b7d30a0
Tests
coffandro Jan 23, 2026
56f7ca1
update packages
coffandro Jan 23, 2026
e979c65
Begin total move to schema forms
coffandro Jan 29, 2026
c21a976
Fix image deletion
coffandro Feb 8, 2026
3805d5e
Update linking
coffandro Feb 8, 2026
27f3c8b
Update ids
coffandro Feb 8, 2026
244ce64
Cleanup
coffandro Feb 8, 2026
a897de2
Delete old webui
coffandro Feb 8, 2026
7fcd751
More form stability
coffandro Feb 8, 2026
c9d7c68
Add logo
coffandro Feb 10, 2026
9835628
Achieve crud and QOL
coffandro Feb 10, 2026
d688959
Implement Github OAuth flow
coffandro Feb 10, 2026
3d271e3
Merge branch 'main' into webui_overhaul
coffandro Feb 10, 2026
192a669
Add github oath workflow
coffandro Feb 10, 2026
1265e1f
Invalidate secret
coffandro Feb 10, 2026
9975d3f
Merge branch 'webui_overhaul' of https://github.com/OpenFilamentColle…
coffandro Feb 10, 2026
83e4640
Revamp builder api
coffandro Feb 12, 2026
6e24d4d
Env overhaul
coffandro Feb 12, 2026
2b0fd4a
Finish gh flow and generalise
coffandro Feb 12, 2026
9ef70d3
Create gterf
coffandro Feb 17, 2026
e61d68f
overhaul for local mode support
coffandro Feb 21, 2026
019905b
Prepare for merge, fix crud and exit
coffandro Feb 21, 2026
3251af2
Fix test issue
coffandro Feb 21, 2026
208f274
Fix bugs and bump
coffandro Feb 21, 2026
7e37464
Return versioning and implement suggestions
coffandro Feb 22, 2026
b7d2110
Avoid depth
coffandro Feb 22, 2026
ff368a5
Require hex pattern in schema
coffandro Feb 22, 2026
ffe7cbb
Maintainability
coffandro Feb 22, 2026
2e9033c
Make boot more resilient
coffandro Feb 22, 2026
3845084
Create general readlogo code and stability
coffandro Feb 22, 2026
77af667
Fix api paths in test
coffandro Feb 22, 2026
109e47f
Include a # to fit new in new schema
coffandro Feb 22, 2026
8e0f4d2
more test fixes
coffandro Feb 22, 2026
17b257a
Make sure no files get userd that don't need to and make styling more…
coffandro Feb 22, 2026
8b11d71
generalize detail functions
coffandro Feb 22, 2026
be8cf84
Add general save utils
coffandro Feb 24, 2026
20d0e05
Add docker files for webui
coffandro Feb 24, 2026
1fe37d6
Package lock update
coffandro Feb 24, 2026
321cedb
dotenv overhaul
coffandro Feb 24, 2026
7b70a7b
dotenv overhaul
coffandro Feb 24, 2026
cae454f
Merge branch 'webui_overhaul' of https://github.com/OpenFilamentColle…
coffandro Feb 24, 2026
690983d
Logo fixes
coffandro Feb 24, 2026
440aa79
Stability code review and fixes
coffandro Feb 24, 2026
3fff28d
Overhaul validator SSE
coffandro Feb 24, 2026
5b875ae
Implement cross checking and fix id gen
coffandro Feb 24, 2026
67cb7d5
Add logo validation and naming fixes
coffandro Feb 24, 2026
8838e7f
Add comprehensive webui documentation and builder docs exporter
coffandro Feb 24, 2026
829c023
Overhaul store editing
coffandro Feb 24, 2026
a2df94d
Add OFD anon pr bot
coffandro Feb 24, 2026
aaa3498
Only warn on webhook
coffandro Feb 24, 2026
92d9d9c
Clarity and allow for wrapper naming
coffandro Feb 24, 2026
1deba4f
Add better wrapper name config stuff
coffandro Feb 24, 2026
0f2d361
Merge remote-tracking branch 'remote/main' into webui_overhaul
coffandro Mar 2, 2026
2c1984d
More merge
coffandro Mar 2, 2026
eac386c
Fix double commits
coffandro Mar 2, 2026
4f8bed3
style data workflow
coffandro Mar 2, 2026
202417a
Merge remote-tracking branch 'remote/main' into webui_overhaul
coffandro Mar 2, 2026
240068d
Merge remote-tracking branch 'remote/main' into webui_overhaul
coffandro Mar 2, 2026
c70b49b
Begin feedback implementation with flow overhaul
coffandro Mar 2, 2026
46dd293
Move to use indexeddb for local image storage
coffandro Mar 7, 2026
98a09f4
image cropping modal overhaul
coffandro Mar 7, 2026
fdae4d5
Fix images not loading from indexedDB and allow for UK coutnry
coffandro Mar 7, 2026
c40eae8
Overhaul anon submission flow to not allow for partner access
coffandro Mar 7, 2026
ddfeee4
Style submission menu better
coffandro Mar 7, 2026
8abb2e7
Return to submission wizard upon github oauth
coffandro Mar 7, 2026
6c5d24c
Better titles and flow for requesting changes in anon mode
coffandro Mar 7, 2026
1110383
More fixes to image editor
coffandro Mar 7, 2026
7415d13
Add DB for emails
coffandro Mar 7, 2026
45fa1a6
Move to using SP for backend instead of anon flow
coffandro Mar 7, 2026
20de88d
Add option to change SP base domain
coffandro Mar 7, 2026
c9e9dc5
Update SP auth flow
coffandro Mar 7, 2026
303163a
More fixes
coffandro Mar 7, 2026
e971324
Allow SP API URI
coffandro Mar 7, 2026
196a581
Better logging
coffandro Mar 7, 2026
8878195
Data fixing
coffandro Mar 7, 2026
7eeb7c2
Allow access to see PFP
coffandro Mar 7, 2026
29ee03c
better loading
coffandro Mar 7, 2026
4ff2885
Reintroduce email flow, now with SP reliance
coffandro Mar 7, 2026
80ca0cc
Update icon rendering and PR messaging
coffandro Mar 7, 2026
59bb2f8
Fallback stuff for email
coffandro Mar 7, 2026
64fafdb
Port to use zeptomail
coffandro Mar 7, 2026
24655c0
Resolve issues with schema compliance and improve logging in email flow
coffandro Mar 7, 2026
97544f4
Update script URL
coffandro Mar 7, 2026
dbdf20e
Update zoho scripts
coffandro Mar 7, 2026
f992633
dont show validatiion while it's in progress
coffandro Mar 7, 2026
cf66332
Update validation flow among other things
coffandro Mar 13, 2026
128ef91
Add search bar and commit version
coffandro Mar 13, 2026
6657cd5
Generalise
coffandro Mar 13, 2026
5067c0e
Move docs to webui
coffandro Mar 20, 2026
62a0e42
update docs
coffandro Mar 20, 2026
fc31e40
Fix load crashes
coffandro Mar 21, 2026
bf74246
Add debug panel
coffandro Mar 21, 2026
fc65ae3
Update logging to be server lifetime based
coffandro Mar 21, 2026
f6bb658
implement suggestions partially
coffandro Mar 24, 2026
f593d6b
Merge remote-tracking branch 'origin/main' into webui_overhaul
coffandro Mar 31, 2026
b208650
Merge remote-tracking branch 'remote/main' into webui_overhaul
coffandro Mar 31, 2026
31bb929
Cleanup changes tracking
coffandro Mar 31, 2026
e09ca0c
Filtering code
coffandro Mar 31, 2026
602dda8
Use slug when available
coffandro Apr 2, 2026
8c295c8
Remove trash file and add dropdowns with copy, paste and duplicate ac…
coffandro Apr 5, 2026
61bbd18
Fix missing slicer keys
coffandro Apr 5, 2026
25ed496
Add initial "submitted changes" entries
coffandro Apr 5, 2026
44edc04
Fix copy paste issues
coffandro Apr 5, 2026
7a868a2
Fix other replication issues
coffandro Apr 5, 2026
0fa15bd
Fix crash bug with submission versioning
coffandro Apr 10, 2026
ad68ad6
FIX Store id issues
coffandro Apr 16, 2026
1ba241e
Persist forms while on page
coffandro May 9, 2026
a35864e
Debounce modal exiting
coffandro May 9, 2026
b6da1bb
Add color standards
coffandro May 9, 2026
b1ea3bb
Fix store validation links
coffandro May 9, 2026
df37433
Better displaying of data migrations
coffandro May 16, 2026
110dcc3
Merge remote-tracking branch 'remote/main' into webui_overhaul
coffandro May 23, 2026
fd8089a
Update docs to prepare for webui launch
coffandro May 23, 2026
2a1d471
Improve documentation
coffandro May 23, 2026
b3977e9
Improve test coverage
coffandro May 23, 2026
aad8d5c
Attempt fix for tests
coffandro May 23, 2026
682cbca
Stop tracking playwright-report/index.html (already gitignored)
coffandro May 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
77 changes: 75 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,79 @@ The repository runs these workflows:
- Ensure all required JSON files exist at each hierarchy level
- Use illegal character list: `#%&{}\\<>*?/$!'":@+\`|=` (see `ofd/validation/validators.py`)

## WebUI Architecture Patterns

### Entity Actions (Copy/Duplicate/Paste/Delete)

All entity actions (copy, duplicate, paste, delete) are centralized through **shared composables** in `webui/src/lib/utils/useEntityActions.svelte.ts`. These ensure that both detail-page dropdowns AND list-view card menus go through the exact same code path.

**Key composables:**
- `createCopyAction(entityType, loadChildrenFn?)` - Handles copy with optional "with/without children" modal
- `createDuplicateAction(entityType, hasChildren, openFormFn)` - Handles duplicate with optional children modal
- `createPasteHandler(entityType, openFormFn, hasConflict?)` - Handles paste with conflict-aware name suffixing

**Critical rule:** Never create inline copy/duplicate/paste handlers directly in page components. Always use these composables to avoid action inconsistencies between detail-page dropdowns and list-view card menus.

**Clipboard service** (`webui/src/lib/services/clipboardService.ts`):
- Uses localStorage as primary store, system clipboard as secondary
- `ClipboardEntry` includes optional `children` field for nested data
- `prepareDuplicateData()` clears identity fields and appends "(Copy)" to names
- Uses `JSON.parse(JSON.stringify())` instead of `structuredClone` (Svelte 5 proxies can't be structuredCloned)

**Duplicate service** (`webui/src/lib/services/duplicateService.ts`):
- `loadXxxChildren()` - loads nested children into clipboard-compatible structure
- `pasteXxxChildren()` - creates children from clipboard data under a new parent
- `duplicateXxxChildren()` - duplicates children from one parent to another via DB

### Schema Filtering & Supplementary Keys

The change store (`webui/src/lib/stores/changes.ts`) filters entity data through JSON schemas via `filterToSchema()`. Fields not in the schema are stripped. For fields that are needed for change tracking but aren't in the schema (like `materialType` for materials, `sizes` for variants), add them to `SUPPLEMENTARY_KEYS`:

```typescript
const SUPPLEMENTARY_KEYS: Partial<Record<EntityType, string[]>> = {
variant: ['sizes'],
material: ['id', 'materialType']
};
```

**Warning:** If you add a field to entity data that needs to survive change tracking but isn't in the JSON schema, you MUST add it to `SUPPLEMENTARY_KEYS` or it will be silently stripped.

### Submitted Changes Buffer (Pending Merge)

When a user submits changes (creating a PR), the changes are archived into a **submitted buffer** (`webui/src/lib/stores/submitted.ts`) before being cleared from the pending change store. This keeps submitted entities visible in the UI with a purple "Submitted" badge until the buffer entries expire (7-day TTL).

**Key files:**
- `webui/src/lib/stores/submitted.ts` - Submitted store (localStorage-backed, key `ofd_submitted_changes`)
- `webui/src/lib/types/changes.ts` - `SubmittedEntry` and `SubmittedBuffer` types

**Data layering precedence:** pending changes > submitted changes > API data. The `DatabaseService` applies submitted changes via `layerSubmittedChanges()` before `layerChanges()`.

**Visual indicators:** Submitted entities show `border-l-4 border-l-purple-500` border and a purple "Submitted" badge on EntityCards. Detail pages show a "Submitted - awaiting merge" info banner.

**Integration points:** The `getChildChangeProps()` function in `deletedStubs.ts` accepts an optional `submitted` parameter. All list pages pass `submittedStore` to this function and to `withDeletedStubs()`. The `entityState` composable exposes `hasSubmittedChanges` for detail pages.

### Entity Detail Page Structure

Each entity detail page follows this pattern:
1. **Shared action composables** at the top (via `createCopyAction`, `createDuplicateAction`, `createPasteHandler`)
2. **Data loading** via `$effect` watching route params
3. **Edit/Delete/Duplicate/Paste handlers** as async functions
4. **Template** with `EntityDetails` (showing fields + Edit button + `EntityActionDropdown`) and `ChildListPanel` (showing child cards with actions)
5. **Modals** at the bottom: Edit, Delete, DuplicateOptions, CopyOptions, Duplicate form, Paste form, CloudCompare

### UI Components

- `DropdownMenu.svelte` - Reusable kebab dropdown (auto-strips empty separators)
- `ContextMenu.svelte` - Right-click menu positioned at pointer
- `EntityActionDropdown.svelte` - Entity-specific dropdown with Duplicate/Copy/Paste/View/Delete
- `DuplicateOptionsModal.svelte` - "With children" / "Without children" / "Cancel" chooser
- `CloudCompareModal.svelte` - Side-by-side JSON diff (cloud mode only)
- `EntityCard.svelte` - Cards with inline dropdown + right-click context menu

### Form Create vs Update Detection

Forms determine their submit button label ("Create X" vs "Update X") by checking `entity?.id`. Since `prepareDuplicateData()` strips `id`, duplicate/paste forms correctly show "Create". If you add a new form, use `?.id` for this check, not just truthiness of the entity prop.

## Critical Configuration Files

**Root Level:**
Expand All @@ -219,8 +292,8 @@ The repository runs these workflows:
**WebUI Configuration:**
- `webui/package.json` - npm scripts and dependencies
- `webui/svelte.config.js` - SvelteKit configuration
- `webui/vite.config.js` - Vite build configuration (Tailwind 4 is configured here via `@tailwindcss/vite`, no separate `tailwind.config.js`)
- `webui/playwright.config.js` - Test configuration (baseURL: localhost:4173)
- `webui/vite.config.ts` - Vite build configuration (Tailwind 4 is configured here via `@tailwindcss/vite`, no separate `tailwind.config.js`)
- `webui/playwright.config.ts` - E2E test configuration (baseURL: localhost:4173)

**Validation Schemas:**
- `schemas/brand_schema.json` - Brand metadata validation
Expand Down
176 changes: 60 additions & 116 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,119 +8,63 @@
</div>

# Open Filament Database
The Open Filament Database, hosted by the new "Open Filament Collective" group, currently facilitated by SimplyPrint.

## ✅ Contributing: how to add to the database
The beautiful thing about the database is that it's open source so anyone can contribute, whether you're a hobbyist, print farm or brand.

The steps to contribute to the database are simple but may get technical at times depending on how you want to do it, don't worry if you don't all understand terms, we'll guide you through it.

### So what are the steps?
1. **Create a GitHub account**
2. **Create a copy of the database** (called "forking" this repository)
3. **Install a few small applications** (Git, Python, Node.js)
4. **Download your copy of the database** (called "cloning" it).
5. **Use either our simple web editor or use the manual method**
6. **Check if your data has errors**
7. **Upload your data and make what's called a pull request**

## Let's do it!

### 1. Sign up for a GitHub Account
If you don’t have one already, [create a free GitHub account](https://github.com/join).

### 2. Fork the Project (Two-Click)
Click the **Fork** button in the top right of this page, a guide is [available here if needed](docs/forking.md)
![Fork button getting pressed](docs/img/forking01.png)
### 3. Install our requirements
If you don't have Git installed, [follow this guide](docs/installing-software.md#git). The OFD wrapper script will help you install Python and Node.js automatically (see step 5).

### 4. Download the database
Download the database using either [this guide](docs/cloning.md) or by just using the command below, with `YOUR_USERNAME` replaced ofc!
```bash
git clone https://github.com/YOUR_USERNAME/open-filament-database.git
cd open-filament-database
```
### 5. Make your changes!
Use the web editor (recommended) or edit files manually:

**Using the OFD Wrapper (Recommended - handles setup automatically):**

Linux/macOS:
```bash
./ofd.sh webui
```

Windows:
```cmd
ofd.bat webui
```

On first run, the wrapper will:
- Check if Python 3.10+ and Node.js are installed (and help install them if not)
- Create a Python virtual environment
- Install all required dependencies
- Start the WebUI development server

Then access it in your browser at http://localhost:5173

The WebUI includes built-in validation and data sorting features to help ensure your changes are correct. [Full WebUI guide](docs/webui.md)

**Manual setup:** If you prefer to set things up manually, [install our requirements](docs/installing-software.md) and then:
```bash
cd webui
npm ci
npm run dev
```

**Manual editing:** If you prefer to edit files directly, [follow this guide](docs/manual.md)

### 6. Validate and sort your changes
The WebUI can validate and sort your data automatically:

1. Click the "Validate" button in the top-right corner to check for errors
2. Click the "Sort Data" button to organize your JSON files consistently
3. Fix any validation errors that appear (they'll be highlighted in red)

Alternatively, you can use the command-line validation scripts ([see guide](docs/validation.md)):

Linux/macOS:
```bash
./ofd.sh validate # Run all validations
./ofd.sh validate --folder-names # Validate folder names
./ofd.sh validate --json-files # Validate JSON files against schemas
./ofd.sh validate --logos # Validate logo files (size, naming, format)
./ofd.sh validate --store-ids # Validate store IDs in purchase links
./ofd.sh validate --gtin # Validate GTIN/EAN fields
```

Windows:
```cmd
ofd.bat validate # Run all validations
ofd.bat validate --folder-names # Validate folder names
ofd.bat validate --json-files # Validate JSON files against schemas
ofd.bat validate --logos # Validate logo files (size, naming, format)
ofd.bat validate --store-ids # Validate store IDs in purchase links
ofd.bat validate --gtin # Validate GTIN/EAN fields
```
### 7. Submit your changes
Before submitting, make sure your data is sorted consistently:
- **In the WebUI:** Click the "Sort Data" button in the top-right corner
- **Or via command line:** Run `./ofd.sh script style_data` (Linux/macOS) or `ofd.bat script style_data` (Windows)

Then add your changes:
```bash
git add .
```

Create a commit with a descriptive message (e.g., "Added Elegoo Red PLA variant"):
```bash
git commit -m "COMMIT_MESSAGE"
```

Upload your changes to GitHub:
```bash
git push -u origin YOUR_BRANCHNAME
```

Finally, make a pull request [using this guide](docs/pull-requesting.md)

An open, community-maintained database of 3D-printing filaments — brands, materials, filament product lines, colour variants, spool sizes, and the stores that sell them. Hosted by the **Open Filament Collective**, currently facilitated by SimplyPrint.

The data is free to use under MIT — slicers, print farm software, NFC spool tags ([OpenPrintTag](https://specs.openprinttag.org/)), inventory apps, and price-comparison tools can all read it directly.

---

## ✍️ Contributing

The fastest way to add, fix, or correct data is the cloud editor — no install required:

> 👉 **<http://ofd-webui-vv73c.ondigitalocean.app/>**

Browse brands → materials → filaments → variants → sizes, edit fields, upload logos, and submit your changes as a pull request straight from the browser. The editor validates schema, logos, and store references in-page before submitting, so most mistakes are caught up front.

You can sign in two ways:

- **GitHub** — your edits become a pull request opened **from your own fork**, attributed to you on your GitHub profile.
- **SimplyPrint** — your edits become a pull request opened by our **bot account**, with attribution back to you in the PR body. No GitHub account needed. Rate-limited per IP (default 5 submissions/hour).

### Editing locally instead

If you'd rather work from a clone — for offline edits, running the Python validator against your own data, bulk imports, or developing the WebUI itself — see [docs/contributing-locally.md](docs/contributing-locally.md). For editing JSON files by hand without the WebUI, see the [manual editing guide](docs/manual.md).

---

## 🔌 Using the data (API)

The full dataset is published as a static REST API, with bulk JSON / NDJSON / SQLite / CSV downloads alongside it. The landing page documents the URL shape, endpoints, and examples:

> 👉 **<https://api.openfilamentdatabase.org/>**

Address entities by **path**, e.g. `/api/v1/brands/{brand}/materials/{MATERIAL}/filaments/{filament}/variants/{variant}.json`.

> ℹ️ UUID-based lookups are still supported for integrations that need stable opaque identifiers (NFC tags, slicer profiles), but path-based addressing is what we recommend for everyone else — it's human-readable and stable across cosmetic renames.

---

## 📚 More documentation

- [WebUI guide](docs/webui.md) — features, modes, configuration
- [Manual editing guide](docs/manual.md) — editing JSON files by hand
- [Validation guide](docs/validation.md) — running the validator, understanding errors
- [Local contributing guide](docs/contributing-locally.md) — full fork → clone → PR walkthrough
- [Pull request guide](docs/pull-requesting.md) — opening a PR from your fork
- [Software installation](docs/installing-software.md) — Git, Python, Node.js setup (local route only)

---

## 📜 License

MIT. See [`LICENSE`](LICENSE). The data is free to use, redistribute, and embed in commercial products; attribution is appreciated but not required.

---

## 🔗 Related projects

- [OpenPrintTag spec](https://specs.openprinttag.org/) — NFC data format that consumes OFD UUIDs
- [`slicer-profiles-db`](https://github.com/SimplyPrint/slicer-profiles-db) — separate repo mapping OFD filaments to slicer profiles
- [SimplyPrint](https://simplyprint.io/) — 3D printer management platform; facilitator of the Open Filament Collective
122 changes: 122 additions & 0 deletions docs/contributing-locally.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Contributing from a Local Clone

Most contributors don't need this guide — the [hosted web editor](http://ofd-webui-vv73c.ondigitalocean.app/) lets you add or fix data straight from the browser and opens the pull request for you. See the main [README](../README.md) and the [WebUI guide](webui.md) for that route.

This document is for contributors who want to work from a local clone instead — for offline editing, running the Python validator against your own data, bulk imports, or developing the WebUI itself.

## Steps at a glance

1. [Create a GitHub account](#1-sign-up-for-a-github-account)
2. [Fork the repository](#2-fork-the-project-two-click)
3. [Install the requirements](#3-install-our-requirements)
4. [Clone the database](#4-download-the-database)
5. [Make your changes](#5-make-your-changes)
6. [Validate and sort your changes](#6-validate-and-sort-your-changes)
7. [Submit your changes](#7-submit-your-changes)

---

## 1. Sign up for a GitHub Account
If you don't have one already, [create a free GitHub account](https://github.com/join).

## 2. Fork the Project (Two-Click)
Click the **Fork** button in the top right of [the repo page](https://github.com/OpenFilamentCollective/open-filament-database); a guide is [available here if needed](forking.md).

![Fork button getting pressed](img/forking01.png)

## 3. Install our requirements
If you don't have Git installed, [follow this guide](installing-software.md#git). The OFD wrapper script will help you install Python and Node.js automatically (see step 5).

## 4. Download the database
Download the database using either [this guide](cloning.md) or by just using the command below, with `YOUR_USERNAME` replaced ofc!

```bash
git clone https://github.com/YOUR_USERNAME/open-filament-database.git
cd open-filament-database
```

## 5. Make your changes
You have two options:

**Option A — Run the WebUI locally (recommended):**

The OFD wrapper handles all setup automatically:

Linux/macOS:
```bash
./ofd.sh webui
```

Windows:
```cmd
ofd.bat webui
```

On first run, the wrapper will:
- Check if Python 3.10+ and Node.js are installed (and help install them if not)
- Create a Python virtual environment
- Install all required dependencies
- Start the WebUI development server

Then access it in your browser at <http://localhost:5173>. The WebUI includes built-in validation and data sorting features — see the [full WebUI guide](webui.md).

If you'd rather run things by hand, [install our requirements](installing-software.md) and then:

```bash
cd webui
npm ci
npm run dev
```

**Option B — Edit JSON files directly:** follow the [manual editing guide](manual.md).

## 6. Validate and sort your changes
The WebUI can validate and sort your data automatically:

1. Click the "Validate" button in the top-right corner to check for errors
2. Click the "Sort Data" button to organize your JSON files consistently
3. Fix any validation errors that appear (they'll be highlighted in red)

Alternatively, you can use the command-line validator ([full guide](validation.md)):

Linux/macOS:
```bash
./ofd.sh validate # Run all validations
./ofd.sh validate --folder-names # Validate folder names
./ofd.sh validate --json-files # Validate JSON files against schemas
./ofd.sh validate --logos # Validate logo files (size, naming, format)
./ofd.sh validate --store-ids # Validate store IDs in purchase links
./ofd.sh validate --gtin # Validate GTIN/EAN fields
```

Windows:
```cmd
ofd.bat validate # Run all validations
ofd.bat validate --folder-names # Validate folder names
ofd.bat validate --json-files # Validate JSON files against schemas
ofd.bat validate --logos # Validate logo files (size, naming, format)
ofd.bat validate --store-ids # Validate store IDs in purchase links
ofd.bat validate --gtin # Validate GTIN/EAN fields
```

## 7. Submit your changes
Before submitting, make sure your data is sorted consistently:
- **In the WebUI:** Click the "Sort Data" button in the top-right corner
- **Or via command line:** Run `./ofd.sh script style_data` (Linux/macOS) or `ofd.bat script style_data` (Windows)

Then add your changes:
```bash
git add .
```

Create a commit with a descriptive message (e.g., "Added Elegoo Red PLA variant"):
```bash
git commit -m "COMMIT_MESSAGE"
```

Upload your changes to GitHub:
```bash
git push -u origin YOUR_BRANCHNAME
```

Finally, make a pull request [using this guide](pull-requesting.md).
Loading
Loading