getting-started onboarding: docs + local-dev config + unblock backend tests (new-user review) - #538
Open
tri2510 wants to merge 4 commits into
Open
getting-started onboarding: docs + local-dev config + unblock backend tests (new-user review)#538tri2510 wants to merge 4 commits into
tri2510 wants to merge 4 commits into
Conversation
- README/local-dev "fastest start": add explicit `cp .env.example .env` (yarn dev crashes with no .env) and note STRICT_AUTH=false for self-registration (not set in .env.example). - development-guide: dev access is :3210, not :3200; the :3200 unified entry point is production-only. Correct the Vite proxy path list and drop the false "backend proxies frontend in dev" claim. - development-guide: remove the dead /api-docs Swagger reference (swagger-ui-express is never mounted). - development-guide: standardize the Mongo container name to autowrx-mongodb (was autowrx-mongo) so troubleshooting commands match the README. - Align Node/Yarn prerequisites wording across docs. Signed-off-by: Tri Hua <tri2510@gmail.com>
Jest had no transform config, so the ESM-only deps @paralleldrive/cuid2 and @noble/hashes (reached via formidable when integration tests load app.js) failed to parse with "Cannot use import statement outside a module", which stopped 5 of 7 suites from running. Add @babel/core, babel-jest@29 and @babel/preset-env — pinned to Babel v7 to match jest 29 and the existing @babel/traverse@7 (Babel v8 + traverse v7 throws "traverse is not a function") — plus a babel.config.js, and opt cuid2/@noble back into transformation via transformIgnorePatterns. Result: all 7 suites now load and run (0 ESM errors, 20/26 tests pass). The 6 remaining failures are pre-existing and unrelated to ESM (User model validation drift, paginate-plugin strictPopulate, a stale /v1/docs integration test) and will be addressed separately. Signed-off-by: Tri Hua <tri2510@gmail.com>
tri2510
force-pushed
the
docs/getting-started-review
branch
from
July 17, 2026 06:26
19293b0 to
b9fe60a
Compare
- Add STRICT_AUTH=false so self-registration and public viewing work out of the box (previously a new user got 403 on /v2/auth/register). - Remove the duplicate JWT_COOKIE_NAME line (the second silently overrode the first). - Bump engines.node from ">=12.0.0" to ">=18.0.0" to match the documented Node requirement and the node:22 base image. Signed-off-by: Tri Hua <tri2510@gmail.com>
The repo uses Yarn (yarn.lock is canonical and the docs say "Yarn 1.x"). The leftover package-lock.json files triggered a "mixing lock files" yarn warning on every install and were stale. Removed in favor of yarn.lock. Signed-off-by: Tri Hua <tri2510@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follows a from-scratch new-user review of
docs/getting-started/, where every documented command was executed against a clean Ubuntu/Docker environment. This PR fixes the local-development issues found (docs, dev config, and unblocking the backend test suite). Product-functionality issues surfaced by the review are intentionally left untouched and listed below for follow-up.Why
A new contributor following the docs hit blockers and inaccuracies:
yarn devwith no.env→ backend crashed (MONGODB_URL is required)..env.exampledidn't setSTRICT_AUTH=false.yarn testfailed on 5/7 suites — Jest had no ESM-transform config, so ESM-only deps couldn't be parsed.development-guide.mdpointed at:3200for dev access (actually:3210), a non-existent/api-docsSwagger UI, and an inconsistent Mongo container name.Changes (local-dev only)
Docs
cp .env.example .env+ note that self-registration needsSTRICT_AUTH=false.:3210(Vite proxies API to:3200);:3200unified entry is production-only; corrected the Vite proxy path list; dropped the false "backend proxies frontend in dev" claim./api-docsSwagger reference; standardized the Mongo container name toautowrx-mongodb; aligned Node/Yarn prerequisites wording.Backend tests
@babel/core,babel-jest@29,@babel/preset-env(pinned to Babel v7 to matchjest@29+@babel/traverse@7), ababel.config.js, and whitelisted@paralleldrive/cuid2+@noble/hashes.Dev config / tooling
.env.example: addSTRICT_AUTH=false(self-registration works out of the box); remove the duplicateJWT_COOKIE_NAME.backend/package.json:engines.node>=12→>=18(matches docs + thenode:22base image).backend/package-lock.json+frontend/package-lock.json(yarn.lockis canonical) — eliminates the yarn "mixing lock files" warning.Verification (clean Ubuntu/Docker env)
cd backend && yarn test→ 0 ESM errors, 7/7 suites run, 20/26 pass.cd backend && cp .env.example .env && yarn dev→Connected to MongoDB+Listening to port 3200(~1s).POST /v2/auth/register→ 201 now that.env.exampleshipsSTRICT_AUTH=false(was 403).cd frontend && npx tsc --noEmit && yarn build→ exit 0.yarn install→ no more "mixing lock files" warning.Not addressed — product functionality (intentionally left for follow-up)
Per scope, no product/auth behavior was changed. These were found by the review and are noted for separate PRs:
backend/src/models/plugins/paginate.plugin.js—docsPromise.populate(...options.populate)spreads a string into chars, causingStrictPopulateError: path 'p'. (2 failing tests.)backend/src/models/user.model.js— password validation only enforcesminlength: 8(no number/letter rule) and the role validator doesn't reject unknown roles; tests expect more. Needs a maintainer call on intent. (3 failing tests.)backend/tests/integration/docs.test.js— hits/v1/docs(the API is/v2). (1 failing test.)backend/src/config/config.js—MONGODB_URLhas a contradictory.default(...).required(); and true zero-config boot is still blocked becauseJWT_SECREThas no default and passport requires it. The README'scp .env.example .envstep is the practical workaround (included here).backend/src/scripts/convertLogsCap.js— logs a non-fatalECONNRESETwhile capping thechangelogscollection on every boot.backend/src/app.js— Swagger UI could be mounted at/api-docs(deps +@swaggerannotations exist); the dead doc reference was removed instead.instance-setup/docker-compose.prod.ymlanddev-stage/docker-compose.mongodb.ymlpinmongo:4.4.6-bionic. Prod-affecting upgrade to track separately.preparescripts +.husky/dirs in both packages never activate (subfolder.gitnot found); hooks are dead. Cleanup is a maintainer workflow decision.Net:
yarn testis 20/26 — the 6 remaining failures are all in the product/behavior items above, not in dev tooling.Notes
Tri Hua <tri2510@gmail.com>).