Summary
The repo has organically grown to contain 3 separate apps with no coordination, tangled dependencies, and dead code. This issue proposes consolidating into a cleaner structure.
Current State
| Directory |
What it is |
Status |
tokens/ + chains/ |
Asset files (144MB, ~2480 tokens) |
✅ Core data |
_config/nodeAPI/ |
Next.js proxy → token-assets-one.vercel.app |
⚠️ Overengineered |
_config/goAPI/ |
Go server (Gin) doing the same thing |
❌ Appears unused |
app/image-tools/ |
Vite SPA + Vercel edge functions for uploading assets via GitHub PRs |
✅ Active |
scripts/ |
Batch ingest script |
✅ Utility |
Root package.json |
Mixed deps from all apps (next, ethers, @fleekxyz/sdk) |
⚠️ Cruft |
Problems
1. Three apps, one repo, tangled deps
The root package.json mixes concerns — next (for nodeAPI), ethers (for scripts?), @fleekxyz/sdk (IPFS push?). The nodeAPI and image-tools each have their own package.json too. Three separate dependency trees with no monorepo tooling.
2. Go server is dead weight
_config/goAPI/ — if nobody is running it, it just confuses newcomers.
3. nodeAPI bundles 144MB at build time
build.sh copies all token/chain images into public/ on every Vercel deploy. As the repo grows this will hit Vercel deploy size limits. Meanwhile, the route handler in tokenHelpers.ts fetches from raw.githubusercontent.com at runtime anyway — unclear which path actually serves requests.
4. nodeAPI is a glorified reverse proxy
Its only value over raw jsDelivr is:
?fallback=true placeholder image support
- Proper 404s instead of jsDelivr's confusing 403
- Correct content-type headers
That's ~20 lines of edge function logic, not a full Next.js app.
5. Redundant route duplication
The nodeAPI has both /token/ and /tokens/ and /chain/ and /chains/ routes — all doing the same thing. Middleware rewrites non-/api paths to /api paths. 8 route directories for 2 actual operations.
6. No shared config between apps
The image-tools app creates PRs that add files the nodeAPI eventually serves, but there's no integration test or shared schema.
Proposed Changes
-
Delete _config/goAPI/ — if not deployed, remove it.
-
Decide: jsDelivr or self-hosted, not both. If yearn.fi fetches from jsDelivr directly and that works, the nodeAPI's value is minimal. The fallback + 404 logic could be a single edge function in the image-tools project.
-
If keeping self-hosted serving: ditch the build.sh copy approach. Lean into the raw.githubusercontent.com proxy pattern with caching headers. No need to bundle images at deploy time.
-
Consolidate into one Vercel project. app/image-tools already deploys to Vercel. Add the token-serving edge route there. One deploy, one domain, two features: upload UI + image proxy.
-
Clean up root package.json. Move script deps into scripts/package.json. Root shouldn't have next or ethers.
Impact
- Simpler repo structure for contributors
- One Vercel project instead of two
- No more 144MB build-time copy
- Clear separation: data (tokens/chains) vs. app (image-tools + serving)
Summary
The repo has organically grown to contain 3 separate apps with no coordination, tangled dependencies, and dead code. This issue proposes consolidating into a cleaner structure.
Current State
tokens/+chains/_config/nodeAPI/token-assets-one.vercel.app_config/goAPI/app/image-tools/scripts/package.jsonnext,ethers,@fleekxyz/sdk)Problems
1. Three apps, one repo, tangled deps
The root
package.jsonmixes concerns —next(for nodeAPI),ethers(for scripts?),@fleekxyz/sdk(IPFS push?). The nodeAPI and image-tools each have their ownpackage.jsontoo. Three separate dependency trees with no monorepo tooling.2. Go server is dead weight
_config/goAPI/— if nobody is running it, it just confuses newcomers.3. nodeAPI bundles 144MB at build time
build.shcopies all token/chain images intopublic/on every Vercel deploy. As the repo grows this will hit Vercel deploy size limits. Meanwhile, the route handler intokenHelpers.tsfetches fromraw.githubusercontent.comat runtime anyway — unclear which path actually serves requests.4. nodeAPI is a glorified reverse proxy
Its only value over raw jsDelivr is:
?fallback=trueplaceholder image supportThat's ~20 lines of edge function logic, not a full Next.js app.
5. Redundant route duplication
The nodeAPI has both
/token/and/tokens/and/chain/and/chains/routes — all doing the same thing. Middleware rewrites non-/apipaths to/apipaths. 8 route directories for 2 actual operations.6. No shared config between apps
The image-tools app creates PRs that add files the nodeAPI eventually serves, but there's no integration test or shared schema.
Proposed Changes
Delete
_config/goAPI/— if not deployed, remove it.Decide: jsDelivr or self-hosted, not both. If yearn.fi fetches from jsDelivr directly and that works, the nodeAPI's value is minimal. The fallback + 404 logic could be a single edge function in the image-tools project.
If keeping self-hosted serving: ditch the
build.shcopy approach. Lean into the raw.githubusercontent.com proxy pattern with caching headers. No need to bundle images at deploy time.Consolidate into one Vercel project.
app/image-toolsalready deploys to Vercel. Add the token-serving edge route there. One deploy, one domain, two features: upload UI + image proxy.Clean up root
package.json. Move script deps intoscripts/package.json. Root shouldn't havenextorethers.Impact