Code Overlap With someli-api¶
This repo started as a fork of someli-api and has drifted. The shared code is concentrated in helper/, modules/dbDriver/, and the server.js/actions/ boilerplate.
helper/ overlap (10 files)¶
All 10 helper/*.js files exist in both repos by name. Counting diff lines as a proxy for drift:
| File | diff lines |
Status | Recommendation |
|---|---|---|---|
ragProcess.js |
0 | byte-identical | Extract to shared package |
revokeToken.js |
0 | byte-identical | Extract to shared package |
tokenGenerator.js |
0 | byte-identical | Extract to shared package |
webScraping.js |
0 | byte-identical | Extract to shared package |
stockImage.js |
49 | lightly forked | Reconcile diffs; consider shared |
index.js |
63 | lightly forked (different re-exports) | Each repo has its own surface — keep separate |
basic.js |
119 | meaningfully diverged | Compare semantically; reconcile only intentional drift |
constants.js |
163 | meaningfully diverged | Same — each repo has its own constants over time |
aiLogics.js |
396 | heavily diverged | Each repo has its own AI logic; treat as independent |
helper.js |
856 | heavily diverged | Each repo carries its own business helpers; treat as independent |
The four byte-identical files (ragProcess.js, revokeToken.js, tokenGenerator.js, webScraping.js) account for clearly shared, mature utilities. They are good extraction candidates for a shared internal npm package (e.g., @someli/internal-helpers).
modules/dbDriver/¶
The MySQL driver wrapper is shared in design but differs slightly in implementation. Treat as a "drifting copy" — fixes here should be considered for someli-api's copy too.
actions/actions.js¶
The generic CRUD service-layer pattern is shared. Drift is unaudited at byte level; someli-api's copy is the more recently hardened version (per the audit notes about null handling and recursive object stringification in designer-api/actions/ comparison).
server.js and methods.js¶
The boot sequence in server.js is structurally identical to someli-api/server.js. Differences observed:
Someli-admin-api/server.jsdoes not require./middlewares/passport(it's commented out)- The route mounts are simpler: only
routes/auth.jsandroutes/routes.js, noroutes/social.js, noroutes/paddle.js, nodashboard/ - A literal
secret: "3eB(2:\\srlI+qa5"is hardcoded inexpress-session()— see security.md
methods.js is also a verbatim copy of someli-api/methods.js (the ensureToken Bearer-JWT middleware).
routes/auth.js and routes/routes.js¶
These are not copy-pasted from someli-api's routes/auth.js and routes/routes.js. They are written for the admin domain. However, they import a large amount of shared boilerplate at the top (AWS SDK init, MySQL pool init, OpenAI client init) that matches someli-api's style.
The fork's auth/routes total about 2357 lines — a fraction of someli-api's 22000+ lines.
package.json¶
The dependency list is roughly a subset of someli-api's (78 vs ~100+). Many of the deps in Someli-admin-api (Passport strategies, Twitter SDK, expo push) are likely unused — see dependencies-inventory.md.
No overlap with designer-api¶
Despite sharing the same someli-api lineage, Someli-admin-api and designer-api evolved separately. No filename overlap in routes/; no job overlap (admin has no jobs). Helpers may overlap by name (both share with someli-api) but the contents differ.
Implication¶
When you fix a helper bug in someli-api/helper/:
| Helper | Action |
|---|---|
ragProcess.js, revokeToken.js, tokenGenerator.js, webScraping.js |
Apply the same fix here. |
stockImage.js, index.js, basic.js, constants.js |
Read this repo's copy; apply only the relevant subset. |
aiLogics.js, helper.js |
Don't assume parity. Read both files. Fix only where the bug exists. |
When you add a new endpoint in Someli-admin-api that depends on functionality already in someli-api's helper.js:
- Check if the function exists in this repo's
helper.jsfirst. - If not, either copy the function (and accept the drift cost) or refactor the function into one of the byte-identical shared files and bump both.