Skip to content

chore: text and diagram updates#20

Merged
weaponsforge merged 4 commits into
devfrom
chore/text-updates-20250922
Sep 22, 2025
Merged

chore: text and diagram updates#20
weaponsforge merged 4 commits into
devfrom
chore/text-updates-20250922

Conversation

@weaponsforge
Copy link
Copy Markdown
Owner

@weaponsforge weaponsforge commented Sep 22, 2025

  • Chore: display the MongoDB seed script in the architecture diagram
  • Docs: display local development screenshots
  • Docs: add a Quickstart section in the README
  • Chore: update text content in the README

Summary by CodeRabbit

  • Documentation
    • Added Online Demo section with REST API URL and links to static and interactive API docs.
    • Introduced Quickstart with Docker-first setup, building/running containers, seeding, and access instructions; updated Installation/Seed steps accordingly.
    • Added Local Development Screenshots and clarified OpenAPI doc generation notes (adjusted compose line references).
    • Expanded “Adding New Endpoints” guidance (Zod meta/examples, typing, validation middleware, OpenAPI linking, clearer HTTP location names).
    • Updated core libraries table; added assets/README and refreshed architecture diagram to include seed script and developer flow.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Sep 22, 2025

Walkthrough

Adds and restructures documentation in README.md (Online Demo, Quickstart, Local Development Screenshots), reworks installation/seed/OpenAPI notes to prefer Docker and correct docker-compose line references, expands endpoint authoring guidance with Zod metadata and validation steps, adds assets/README.md, and updates assets/architecture.drawio with a seed script, Developer actor, and new connections.

Changes

Cohort / File(s) Summary
README overhaul
README.md
Adds Online Demo section and links; replaces Online Deployments with Local Development Screenshots (adds centered screenshots); adds Quickstart with Docker-first flow, build/run/seed steps and access instructions; reorders Installation/Seed to prioritize Docker with Node alternatives; updates OpenAPI generation notes to reference docker-compose line #21; expands "Adding New Endpoints" to require Zod meta descriptions/examples, use Zod-inferred types for Mongoose schemas, add input validation middleware and OpenAPI linking, and rename schema locations to HTTP query/response/params/body; updates related tables and wording.
Assets documentation
assets/README.md
New file describing the assets folder contents, notes architecture.drawio created with draw.io v28.1.2, and adds footer/authorship/date.
Architecture diagram
assets/architecture.drawio
Updates diagram to add a MongoDB seed script node, a Developer actor, a dashed Developer→seed connection, a seed→schema edge, an explicit intermediate edge, and marks an existing cell with edge="1".

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I nibble docs with whiskers keen,
Quickstarts lit where seeds are seen.
Docker hums beneath my paws,
Diagrams link our tiny cause.
Hop on—new routes, a tidy burrow! 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "chore: text and diagram updates" is a concise, single-sentence summary that accurately reflects the primary changes in the PR (README text edits, a new Quickstart, and an architecture.drawio update), so it is relevant and clear enough for a reviewer scanning history. It avoids noise and directly relates to the changeset content.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/text-updates-20250922

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (12)
README.md (7)

16-17: Fix MD007: nested list indentation under “API documentation”.

Indent the two sub-bullets by 2 spaces (not 3) to satisfy markdownlint.

Apply:

-   - Static: <https://ph-regions.vercel.app>
-   - Interactive: <https://ph-regions.vercel.app/docs>
+  - Static: <https://ph-regions.vercel.app>
+  - Interactive: <https://ph-regions.vercel.app/docs>

117-119: Fix MD034: replace bare URLs in Quickstart step 5.

Use Markdown links to avoid “bare URL” warnings.

-   - REST API documentation: http://localhost:3001
-   - REST API endpoints: http://localhost:3001/api
+   - REST API documentation: [http://localhost:3001](http://localhost:3001)
+   - REST API endpoints: [http://localhost:3001/api](http://localhost:3001/api)

315-316: Avoid brittle “Line #21” references in docker-compose notes.

Line numbers drift. Refer to the mount path/name instead.

-> 💡 **NOTE:** Comment out **Line #21, under [public folder volume]** in the `docker-compose.yml` file ...
+> 💡 **NOTE:** Temporarily comment out the host bind-mount for the public folder in `docker-compose.yml`
+> (the volume that maps `./server/public` -> `/server/public`) before generating OpenAPI assets, then restore it.

If helpful, we can add a short yq snippet or exact compose volume key instead of a line number.

Also applies to: 325-326, 331-332


101-115: Make the seed command resilient to container/service names.

Hardcoding the container name can break on forks. Prefer docker compose exec against the service.

-`docker exec -it weaponsforge-ph-regions npm run seed`
+`docker compose exec <server-service-name> npm run seed`
+# Example (if the service is named "server"):
+# docker compose exec server npm run seed

Please confirm the actual service name in docker-compose and update the example accordingly.


28-33: Optional: add loading="lazy" to screenshots for quicker page paint.

Small UX win on GitHub web rendering.

-   <img src="assets/ph_regions_ss_01.png" width="45%" alt="Static API docs screenshot" />
-   <img src="assets/ph_regions_ss_02.png" width="45%" alt="Interactive API docs screenshot" />
+   <img src="assets/ph_regions_ss_01.png" width="45%" loading="lazy" alt="Static API docs screenshot" />
+   <img src="assets/ph_regions_ss_02.png" width="45%" loading="lazy" alt="Interactive API docs screenshot" />

93-94: Clarify the OpenAPI docs path in folder structure.

“🌐 openapi” points at “/scripts/openapi/docs”; consider aligning the label/path to avoid confusion.

-- 🌐 **openapi** - Contains OpenAPI definitions using Zod schemas (folder: `/scripts/openapi/docs`)
+- 🌐 **scripts/openapi/docs** - Contains OpenAPI definitions generated from Zod schemas

Or keep the label “openapi” but remove the parenthetical path.


385-397: Don’t instruct adding unvalidated routes, even temporarily.

Recommend creating routes with validation middleware from the start to avoid accidental commits exposing unvalidated endpoints.

-Add new routes ... **without input validation** for now.
+Add new routes with the validation middleware wired immediately to avoid exposing unvalidated endpoints.
assets/README.md (2)

7-7: Capture how to regenerate/export the PNG from the .drawio source.

Add a one‑liner so contributors keep assets/architecture.png in sync with assets/architecture.drawio.

-### Notes
+### Notes
+- Export `assets/architecture.drawio` to `assets/architecture.png` (File → Export as → PNG) whenever the diagram changes.

7-10: Optional: add license/source notes for embedded icons.

If draw.io shapes/icons with specific licenses are used, link the license or note “draw.io default shapes”.

assets/architecture.drawio (3)

54-59: Add arrowheads to seed→model edge for directionality.

Edge xfzBbhjO1vl4Opf90gaK-3 has no arrow; consider startArrow=classicThin;startFill=1 (or endArrow) to show data flow.


51-53: Unify label casing and add a legend.

Standardize node titles (e.g., “Model”, “Schema (Zod)”, “Router”, “Controller”, “Middleware (Validation)”) and add a small legend for shapes/colors.

Also applies to: 57-59, 61-65


23-27: Link diagram nodes to code paths (optional).

Where supported, add hyperlinks:

  • seed script → server/src/scripts/seed.ts
  • schema (Zod) → server/src/schemas/...
  • model → server/src/models/...

Also applies to: 51-53, 57-59

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9aadcdf and c9d49df.

⛔ Files ignored due to path filters (3)
  • assets/architecture.png is excluded by !**/*.png
  • assets/ph_regions_ss_01.png is excluded by !**/*.png
  • assets/ph_regions_ss_02.png is excluded by !**/*.png
📒 Files selected for processing (3)
  • README.md (8 hunks)
  • assets/README.md (1 hunks)
  • assets/architecture.drawio (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: weaponsforge
PR: weaponsforge/ph-regions#16
File: server/public/openapi.json:64-64
Timestamp: 2025-09-10T18:53:14.581Z
Learning: The user weaponsforge prefers to use full server URLs (like "http://localhost:3001" or Vercel URLs) in OpenAPI specifications rather than relative URLs, even when relative URLs could make the spec more portable across environments.
📚 Learning: 2025-07-27T22:53:58.000Z
Learnt from: weaponsforge
PR: weaponsforge/ph-regions#1
File: server/src/controllers/region.ts:0-0
Timestamp: 2025-07-27T22:53:58.000Z
Learning: In the ph-regions project, route parameters like regionId, provinceId, and municipalityId are validated by the zod validate() middleware at the route level in files like server/src/routes/region.ts, server/src/routes/province.ts, etc. The validate middleware in server/src/middlewares/validate.ts automatically validates request parameters against MongoIdSchema, ensuring they are valid MongoDB ObjectIDs before reaching the controller functions. This eliminates the need for additional parameter validation within the controller functions themselves.

Applied to files:

  • README.md
🪛 markdownlint-cli2 (0.18.1)
README.md

16-16: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


17-17: Unordered list indentation
Expected: 2; Actual: 3

(MD007, ul-indent)


117-117: Bare URL used

(MD034, no-bare-urls)


118-118: Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (3)
assets/architecture.drawio (2)

54-65: Nice addition: seed script and developer flow.

The new nodes and dashed link improve clarity of the setup flow.


23-27: Confirm architecture.png was regenerated to reflect the updated .drawio.

README shows assets/architecture.png; ensure it matches this source.

README.md (1)

389-401: Confirmed: referenced OpenAPI files exist and are registered.

server/src/scripts/openapi/docs/api.schema.ts is present; server/src/scripts/openapi/main.ts creates an OpenAPIRegistry and calls registry.register(...) to register the schemas.

Comment thread README.md
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
README.md (1)

117-118: Consider wrapping bare URLs in angle brackets

Static analysis flagged bare URLs that should be wrapped in angle brackets for proper Markdown formatting.

-   - REST API documentation: http://localhost:3001
-   - REST API endpoints: http://localhost:3001/api
+   - REST API documentation: <http://localhost:3001>
+   - REST API endpoints: <http://localhost:3001/api>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9d49df and 9748a79.

📒 Files selected for processing (2)
  • README.md (8 hunks)
  • assets/README.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • assets/README.md
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: weaponsforge
PR: weaponsforge/ph-regions#16
File: server/public/openapi.json:64-64
Timestamp: 2025-09-10T18:53:14.581Z
Learning: The user weaponsforge prefers to use full server URLs (like "http://localhost:3001" or Vercel URLs) in OpenAPI specifications rather than relative URLs, even when relative URLs could make the spec more portable across environments.
📚 Learning: 2025-07-27T22:53:58.000Z
Learnt from: weaponsforge
PR: weaponsforge/ph-regions#1
File: server/src/controllers/region.ts:0-0
Timestamp: 2025-07-27T22:53:58.000Z
Learning: In the ph-regions project, route parameters like regionId, provinceId, and municipalityId are validated by the zod validate() middleware at the route level in files like server/src/routes/region.ts, server/src/routes/province.ts, etc. The validate middleware in server/src/middlewares/validate.ts automatically validates request parameters against MongoIdSchema, ensuring they are valid MongoDB ObjectIDs before reaching the controller functions. This eliminates the need for additional parameter validation within the controller functions themselves.

Applied to files:

  • README.md
🪛 markdownlint-cli2 (0.18.1)
README.md

117-117: Bare URL used

(MD034, no-bare-urls)


118-118: Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (9)
README.md (9)

12-18: LGTM! Well-structured Online Demo section

The new Online Demo section provides clear access to both the REST API and documentation resources with appropriate URLs.


28-33: LGTM! Good visual presentation of screenshots

The section rename from "Online Deployments" to "Local Development Screenshots" is more accurate, and the centered layout with proper sizing provides good visual appeal.


74-76: Align README dependency versions with server/package.json

The dependency versions in the README don't match the actual versions in server/package.json, creating potential confusion for developers.


101-119: LGTM! Excellent Quickstart section

The new Quickstart section provides a clear, streamlined path for developers to get started quickly with Docker-based setup. The step-by-step approach covers all essential tasks from environment setup to accessing resources.


125-125: Good prioritization of Docker workflow

The updated installation instructions appropriately emphasize Docker as the primary approach while still providing the Node alternative.


149-155: LGTM! Clear Docker-first seeding instructions

The updated seeding instructions properly reference the Docker workflow and provide clear guidance on when to run the seed command.


378-400: Excellent enhancement to endpoint creation guidelines

The expanded "Adding New Endpoints" section significantly improves the development workflow by:

  • Requiring Zod schemas to include metadata descriptions and examples
  • Emphasizing proper type casting from Zod to Mongoose schemas
  • Adding validation middleware steps
  • Clarifying HTTP-specific terminology (query, response, params, body)

These improvements will help maintain consistency and quality across the API.


315-315: Confirmed: docker-compose.yml line 21 (public folder volume) is correct

Line 21 contains - /opt/server/public as referenced in the README — no documentation change required.


40-40: Quickstart section exists — no changes needed.
Found "## 🆕 Quickstart" in README.md at line 101.

@weaponsforge weaponsforge merged commit 36a0e3e into dev Sep 22, 2025
2 checks passed
@weaponsforge weaponsforge deleted the chore/text-updates-20250922 branch September 22, 2025 06:07
@weaponsforge weaponsforge mentioned this pull request Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant