You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Components in `src/web/components/`, API calls via `src/web/ApiRequestManager.ts` using SWR
35
35
36
36
**Configuration files** (project root, read at runtime from `../` relative to `dist/`):
37
37
-`config.json` — addon and preset definitions (the primary data source for all addons)
38
38
-`thirdparty.json` — third-party addon registry
39
-
-`env.json` (optional, from `env.example.json`) — GitHub token, Discord webhook, port settings
39
+
-`env.json` (optional, from `env.example.json`) — GitHub token, Discord webhook, port settings, optional `weblink` block (url/path/branch) for the blueprint sync
40
40
-`Installation-Guide.txt` — bundled in generated ZIP files
-`WeblinkSync` shallow-clones `BentoBoxWorld/weblink` into `data/weblink/` on startup and `git pull --ff-only`s it on the same 6-minute cron used for addon refresh. Default branch is `master`.
44
+
-`buildCatalog()` scans `weblink/blueprints/<gameMode>/`, parses `.blueprint` files and bundle `.json` files (per BentoBox's `blueprint.schema.json` / `blueprint-bundle.schema.json`), and derives stats: dimensions, block-type counts, entity-type counts, air count, biome list, sinking flag.
45
+
- The optional `blueprints/catalog.json` overlay in weblink supplies curation fields (`displayName`, `description`, `author`, `authorLink`, `tags`, `license`, `image`) plus tag colours and game-mode display names; overlay fields take precedence over what is in the `.blueprint` file.
46
+
- Images live at `weblink/blueprints/images/<gameMode>/<name>.png` (recommended 800×450, with optional `<name>.thumb.png` at 400×225). The catalog auto-detects them at sync time when the overlay does not specify `image`. The Express handler at `src/index.ts` serves them under `/blueprints/images/...` with a path-traversal guard and PNG-only whitelist.
47
+
- Endpoints: `GET /api/blueprints` (full catalog), `GET /api/blueprints/download?id=<gameMode>/<name>&type=blueprint|bundle` (single file), `GET /api/blueprints/zip?ids=[...]|gameMode=<gm>` (multi-select or whole-game-mode zip). IDs are validated against a strict regex and resolved paths are checked against the blueprints root before any read.
-`POST /api/blueprints/submit` accepts a multipart upload (max 5 MB), JSON-parses, ajv-validates against `src/api/schemas/blueprint.schema.json` (vendored from `bentobox/`), runs `validateBlueprintSubmission` (rejects command-block materials and opaque `inventory` payloads), checks slug collision against the local clone, then opens a PR on `BentoBoxWorld/weblink` via Octokit using `env.weblink_github_token` — branch `submit/<discordId>/<slug>-<ts>` with two file commits (the `.blueprint` and the patched `catalog.json`).
54
+
- Helmet config in `src/index.ts` is the canonical CSP — Discord OAuth navigation works without an explicit allowlist because helmet's CSP does not constrain top-level navigation.
55
+
-`env.json` keys: `discord_client_id`, `discord_client_secret`, `discord_redirect_uri`, `weblink_github_token` (fine-grained PAT scoped to `BentoBoxWorld/weblink` with `contents: write` + `pull-requests: write`).
56
+
42
57
## Key Patterns
43
58
44
59
- All addon metadata is configuration-driven via `config.json`; adding an addon means editing that file
@@ -49,4 +64,93 @@ yarn site # Frontend-only dev rebuild + start server
49
64
50
65
## CI
51
66
52
-
GitHub Actions (`.github/workflows/build.yml`) runs on push/PR to `develop`: tests Node.js 12.x/14.x/16.x with `yarn && yarn add sqlite3 && yarn build`.
67
+
GitHub Actions (`.github/workflows/build.yml`) runs on push/PR to `develop`: tests Node.js 20.x/22.x with `yarn && yarn add sqlite3 && yarn build`.
68
+
69
+
## Dependency Source Lookup
70
+
71
+
When you need to inspect source code for a dependency (e.g., BentoBox, addons):
72
+
73
+
1.**Check local Maven repo first**: `~/.m2/repository/` — sources jars are named `*-sources.jar`
74
+
2.**Check the workspace**: Look for sibling directories or Git submodules that may contain the dependency as a local project (e.g., `../bentoBox`, `../addon-*`)
75
+
3.**Check Maven local cache for already-extracted sources** before downloading anything
76
+
4. Only download a jar or fetch from the internet if the above steps yield nothing useful
77
+
78
+
Prefer reading `.java` source files directly from a local Git clone over decompiling or extracting a jar.
79
+
80
+
In general, the latest version of BentoBox should be targeted.
81
+
82
+
## Project Layout
83
+
84
+
Related projects are checked out as siblings under `~/git/`:
-`weblink/` — data repo (blueprints, challenges, MCG configs, addon downloads matrix); the Downloads server clones a copy of this for the Blueprints tab
139
+
-`CrowdBound/` — CrowdBound addon
140
+
141
+
**Data packs:**
142
+
-`BoxedDataPack/` — advancement datapack for Boxed
0 commit comments