Skip to content

Feat/docs and branding - #37

Merged
yash-pouranik merged 24 commits into
mainfrom
feat/docs-and-branding
Mar 7, 2026
Merged

Feat/docs and branding#37
yash-pouranik merged 24 commits into
mainfrom
feat/docs-and-branding

Conversation

@yash-pouranik

@yash-pouranik yash-pouranik commented Mar 6, 2026

Copy link
Copy Markdown
Member

🚀 Documentation Restructure & Brand Refresh

This PR introduces a professional documentation hierarchy and aligns the entire frontend with the official urBackend branding and visual identity.

📦 Changes

📚 Documentation Restructure (GitBook Ready)

  • Modular Architecture: Replaced the single API_USAGE.md with a structured docs/ directory.
  • New Guides:
    • introduction.md: High-level overview and value prop.
    • getting-started.md: 60-second setup guide.
    • authentication.md: Comprehensive JWT and user contract details.
    • database.md: RESTful MongoDB operations reference.
    • storage.md: Cloud asset management guide.
    • security.md: Explanation of the dual-key system.
  • GitBook Integration: Added SUMMARY.md for automated table-of-contents generation.

🎨 Brand Identity & Landing Page

  • Logo Refresh: Integrated the new official urBACKEND_NAV_LOGO across the Navbar, Sidebar, and Footer.
  • Primary Taglines:
    • Hero: "Bring your own MongoDB. Get a production-ready backend in 60 seconds."
    • Sub-heading: "your backend — your database — your rules."
  • Color Palette Alignment: Shifted to the official Vibrant Cyan (#00f5d4) and Yellow accent theme from the brand banner.
  • UI Consistency: Applied the new color system to all glows, buttons, icons, and gradients for a premium, unified look.

🛠️ DX & Frontend Upgrades

  • Complex Data Support: The Auth page now supports editing Object, Array, and Ref (IDs) fields via JSON-aware textareas.
  • Safety First: Added NoSQL injection prevention (sanitization) and 7-day JWT expiration guards.

🧪 Verification

  • Verified local documentation rendering.
  • Confirmed responsive layout of the new landing page.
  • Tested the dynamic user form with complex objects.

Built with ❤️ for urBackend.

Summary by CodeRabbit

  • Documentation
    • Restructured and expanded docs: new introduction, getting started, API reference, authentication, database, storage, security, and summary; removed legacy API usage and devlog guides.
  • Style
    • Refreshed landing visuals and layout: new teal/cyan palette, updated gradients, icons, and consolidated logo usage.
  • Branding & Content
    • Messaging updated to emphasize “Bring your own MongoDB” and a production-ready backend in 60 seconds.
  • Behavior Changes
    • Enabling auth now validates an existing users collection and will not auto-create one.

@vercel

vercel Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ur-backend Ready Ready Preview, Comment Mar 7, 2026 10:23am

@coderabbitai

coderabbitai Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR removes monolithic API_USAGE and DEVLOG docs, adds a modular docs/ set (introduction, getting-started, authentication, database, storage, api-reference, security), updates README/SUMMARY and landing page branding/colors, replaces icon+text logos with a single /logo.png across layout components, and changes backend storage and auth toggle logic (atomic storage updates; no automatic users collection creation).

Changes

Cohort / File(s) Summary
Documentation Restructuring
API_USAGE.md, DEVLOG.md, docs/introduction.md, docs/getting-started.md, docs/authentication.md, docs/database.md, docs/storage.md, docs/api-reference.md, docs/security.md, SUMMARY.md
Deleted legacy API_USAGE.md and DEVLOG.md; added modular documentation files (intro, getting-started, auth, database, storage, API reference, security) and SUMMARY.md. Review for accuracy, linked references, and duplicated/removed guidance.
README & Visual Flow
README.md, ARCHITECTURE_DIAGRAM.md (linked)
Updated branding, feature copy, and "How it Works" visual flow in README; references new architecture diagram. Verify links and Mermaid diagram rendering.
Frontend — Logo & Theming
frontend/src/components/Layout/Footer.jsx, frontend/src/components/Layout/MainLayout.jsx, frontend/src/components/Layout/Sidebar.jsx, frontend/src/pages/LandingPage/index.jsx, frontend/src/pages/LandingPage/style.css
Replaced icon+text brand blocks with a single /logo.png image; updated LandingPage copy and moved color palette from green to teal/cyan. Check public asset /logo.png, alt text, and visual contrast across breakpoints.
Backend — Auth & Storage Logic
backend/controllers/project.controller.js, backend/controllers/storage.controller.js
Auth toggle no longer auto-creates a default users collection; enabling auth now validates only existing users schema and returns 422 on invalid schema. Storage accounting switched from mutating/saving in-memory Project to atomic Project.updateOne calls using $inc/$set; replaced isExternalStorage checks with isExternal(project). Review concurrency, DB update correctness, and cache invalidation.

Sequence Diagram(s)

sequenceDiagram
  participant Client as Client
  participant StorageCtrl as StorageController
  participant ProjectModel as Project Model (MongoDB)
  participant StorageProv as Storage Provider

  Client->>StorageCtrl: POST /api/storage/upload (multipart, x-api-key)
  StorageCtrl->>ProjectModel: Project.updateOne($inc used to adjust usage)
  ProjectModel-->>StorageCtrl: update result
  StorageCtrl->>StorageProv: upload file stream
  StorageProv-->>StorageCtrl: upload success + file URL/size
  StorageCtrl->>ProjectModel: Project.updateOne($set provider/status fields if needed)
  ProjectModel-->>StorageCtrl: update result
  StorageCtrl-->>Client: 201 Created + {url, path, size}
Loading
sequenceDiagram
  participant Client as Client
  participant ProjectCtrl as ProjectController
  participant ProjectModel as Project Model (MongoDB)
  participant Validator as Schema Validator

  Client->>ProjectCtrl: POST /api/project/:id/toggleAuth (enable)
  ProjectCtrl->>ProjectModel: find project, check for existing 'users' collection
  alt users collection exists
    ProjectCtrl->>Validator: validateUsersSchema(existingModel)
    Validator-->>ProjectCtrl: valid / invalid
    alt valid
      ProjectCtrl->>ProjectModel: update isAuthEnabled = true
      ProjectCtrl-->>Client: 200 OK
    else invalid
      ProjectCtrl-->>Client: 422 Unprocessable Entity
    end
  else users collection missing
    ProjectCtrl-->>Client: 422 Unprocessable Entity (no auto-creation)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Possibly related PRs

Poem

🐰 I hopped through folders, tucked docs in rows,
I swapped a logo where the green wind blows,
I nudged the backend—atomic counts take flight,
No auto-users now — validation's right.
A teal-tinted dawn, the rabbit cheers tonight! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Feat/docs and branding' accurately summarizes the main changes: documentation restructuring (docs folder, multiple new .md files) and branding updates (logo changes, color palette refresh, landing page hero updates).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/docs-and-branding

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.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the user experience by introducing a comprehensive and well-structured documentation system, making it easier for developers to understand and utilize the urBackend API. Concurrently, it refreshes the project's visual identity and core messaging across the frontend, aligning the brand with its updated value proposition of flexibility and speed.

Highlights

  • Documentation Overhaul: A new, comprehensive documentation suite has been added, replacing the single API_USAGE.md file with a structured docs/ directory covering introduction, getting started, authentication, database operations, cloud storage, security, and an API quick reference.
  • Branding Refresh: The project's visual branding has been updated across the frontend, including the introduction of a new logo and a refined color palette, shifting from green to a more cyan/teal hue.
  • Messaging Update: Key marketing messages on the landing page and README have been revised to emphasize "Bring your own MongoDB" and "production-ready backend in 60 seconds," aligning with the project's updated value proposition.
Changelog
  • API_USAGE.md
    • Removed the old API usage guide.
  • README.md
    • Updated the project's main description and the link to the documentation.
  • docs/SUMMARY.md
    • Added a new table of contents for the documentation.
  • docs/api-reference.md
    • Added a new quick reference guide for API endpoints.
  • docs/authentication.md
    • Added detailed documentation for user authentication.
  • docs/database.md
    • Added detailed documentation for database operations.
  • docs/getting-started.md
    • Added a new guide for getting started with urBackend.
  • docs/introduction.md
    • Added a new introductory document for the project.
  • docs/security.md
    • Added detailed documentation on security practices and API keys.
  • docs/storage.md
    • Added detailed documentation for cloud storage operations.
  • frontend/src/components/Layout/Footer.jsx
    • Replaced the text-based logo with an image logo.
  • frontend/src/components/Layout/MainLayout.jsx
    • Updated the logo image path.
  • frontend/src/components/Layout/Sidebar.jsx
    • Updated the logo image and its styling.
  • frontend/src/pages/LandingPage/index.jsx
    • Updated the navigation logo, hero section taglines, and various color values for UI elements.
  • frontend/src/pages/LandingPage/style.css
    • Updated color variables and gradients to reflect the new branding palette.
Activity
  • The pull request was opened by yash-pouranik. No further activity has been recorded.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request significantly refactors the project's documentation and updates frontend branding. The previous API_USAGE.md has been replaced with a new, structured docs directory, including detailed guides on authentication, database operations, cloud storage, security, and an API quick reference, along with an introduction and getting started guide. Concurrently, the frontend has been updated to reflect new branding, changing the primary color scheme, updating hero section taglines, and replacing old logo assets with a new official logo across various components like the footer, main layout, sidebar, and landing page navigation. Review comments highlight several areas for improvement in the new documentation, including defining an undefined variable in a code example, adding a missing heading in the 'Getting Started' section, correcting a duplicated heading and a grammatical error in the 'Introduction', and suggesting a more web-friendly filename for the new logo asset. Additionally, a general suggestion was made to move inline styles to CSS files for better maintainability in the LandingPage component.

Comment thread docs/database.md
Comment thread docs/getting-started.md
Comment thread docs/introduction.md Outdated
Comment thread docs/introduction.md Outdated
<Database size={24} color="var(--color-primary)" />
<span style={{ fontSize: '1.2rem', fontWeight: 700, color: '#fff' }}>urBackend</span>
<div style={{ display: 'flex', alignItems: 'center', marginBottom: '1rem' }}>
<img src="/urBACKEND_NAV_LOGO (2).png" alt="urBackend Logo" style={{ height: '80px', width: 'auto' }} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The filename urBACKEND_NAV_LOGO (2).png contains spaces and parentheses, which can cause issues with some tools and are not ideal for web assets. It's best practice to use web-friendly names (e.g., kebab-case, no special characters). Consider renaming the file to something like urbackend-nav-logo.png and updating all references to it.

Suggested change
<img src="/urBACKEND_NAV_LOGO (2).png" alt="urBackend Logo" style={{ height: '80px', width: 'auto' }} />
<img src="/urbackend-nav-logo.png" alt="urBackend Logo" style={{ height: '80px', width: 'auto' }} />

@@ -284,7 +283,7 @@ function LandingPage() {
</div>

<div id="features" style={{ padding: '8rem 0', background: '#030303', borderTop: '1px solid rgba(255, 255, 255, 0.05)', position: 'relative', overflow: 'hidden' }}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This component uses a lot of inline styles. While it works, it makes the code harder to maintain and read. For better separation of concerns and reusability, consider moving these styles to the corresponding style.css file and using CSS classes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🧹 Nitpick comments (1)
docs/api-reference.md (1)

8-12: Use one placeholder name for the data routes across the docs.

This file uses :col, while docs/database.md uses :collectionName for the same endpoints. Keeping one name avoids needless confusion.

Proposed doc fix
-| **Data** | `GET` | `/api/data/:col` | Get all documents in collection |
-| **Data** | `GET` | `/api/data/:col/:id` | Get document by ID |
-| **Data** | `POST` | `/api/data/:col` | Insert new document |
-| **Data** | `PUT` | `/api/data/:col/:id` | Update document by ID |
-| **Data** | `DELETE` | `/api/data/:col/:id` | Delete document by ID |
+| **Data** | `GET` | `/api/data/:collectionName` | Get all documents in collection |
+| **Data** | `GET` | `/api/data/:collectionName/:id` | Get document by ID |
+| **Data** | `POST` | `/api/data/:collectionName` | Insert new document |
+| **Data** | `PUT` | `/api/data/:collectionName/:id` | Update document by ID |
+| **Data** | `DELETE` | `/api/data/:collectionName/:id` | Delete document by ID |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/api-reference.md` around lines 8 - 12, The docs use two different route
placeholder names (":col" in the API table and ":collectionName" elsewhere);
standardize to one placeholder (use ":collectionName") by replacing all
occurrences of "/api/data/:col" and "/api/data/:col/:id" in the API table with
"/api/data/:collectionName" and "/api/data/:collectionName/:id" so the route
examples match the rest of the docs (look for the table entries and route
patterns in the docs to update).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/authentication.md`:
- Around line 19-21: The docs claim a 7-day signup JWT but the signup token
created in backend/controllers/userAuth.controller.js is signed without an
expiresIn; update the jwt.sign call that generates the signup token (the one in
the signup/create user handler) to include an expiresIn: '7d' option so the
created token actually expires in seven days, and ensure any related helper or
constant (if used) is updated consistently.

In `@docs/getting-started.md`:
- Around line 9-10: The docs currently state "Publishable Key (`pk_live_...`)"
is read-only but the example at the POST demo uses it for a write operation;
clarify the exact permission model and update examples: explicitly state that
Publishable keys (pk_...) are read-only and must not be used for
POST/PUT/DELETE, change the POST example that currently uses the publishable key
to instead reference the Secret Key (`sk_live_...`) as a backend-only operation
(or change the demo to a read-only GET that is safe for pk_...), and add a
prominent warning note before the example explaining that secret keys must
remain on trusted servers only and that publishable keys are safe for
client-side read-only use (or, if your system allows limited client-side writes,
document the security model including rate limits and allowed operations).
Ensure references to "Publishable Key (`pk_live_...`)" and "Secret Key
(`sk_live_...`)" and the POST example are updated accordingly.
- Line 12: The document jumps to "## 2. Your First Request" without a preceding
section 1; either insert a new heading "## 1. Get Your API Keys" before the
existing "## 2. Your First Request" heading or rename "## 2. Your First Request"
to "## 1. Your First Request" and renumber all subsequent top-level headings
accordingly; update the heading text "## 2. Your First Request" wherever it
appears to ensure sequential numbering.

In `@docs/introduction.md`:
- Around line 20-24: Remove the duplicated section heading "## Why urBackend?"
(the one at the later occurrence) and correct the sentence in that paragraph to
read "urBackend provides a **Unified REST API** that abstracts all that
complexity away." Locate the duplicate heading and the paragraph containing
"urBackend provides a **Unified REST API** that abstract all that complexity
away" and delete the extra heading and change "abstract" to "abstracts" so the
sentence is grammatical.

In `@docs/security.md`:
- Around line 24-27: The doc incorrectly describes the auth limiter as
monitoring failed login attempts while the actual middleware
(backend/middleware/auth_limiter.js, the exported limiter middleware with max:
10) is a simple request-count limiter; update docs/security.md to state the auth
endpoints are protected by a request-based rate limiter (e.g., max 10 requests
per window per IP) rather than a failure-based lockout, or alternatively modify
backend/middleware/auth_limiter.js to implement failure-based tracking if you
intend to rate-limit only failed logins; reference the limiter middleware
(auth_limiter.js) when making the change so the doc and implementation match.
- Around line 21-23: The docs overstate the NoSQL sanitization: update the
"NoSQL Injection Prevention" section to say that the current sanitizer in
backend/utils/input.validation.js only strips `$`-prefixed keys at the top level
(the top-level stripping logic / sanitize function) and does not recurse into
nested objects like {"data":{"$gt":""}}; either document this limitation
explicitly and recommend using a recursive sanitizer or a vetted library, or
change the implementation to perform a deep recursive removal of `$`-prefixed
keys in that same module.

In `@frontend/src/components/Layout/MainLayout.jsx`:
- Around line 6-7: The logo path is hard-coded in the const logoImage
declaration; replace it with a BASE_URL-aware path using
import.meta.env.BASE_URL so the app works when served from a non-root base;
update the const logoImage in MainLayout.jsx and make the same change for the
equivalent logo path/constant in Footer.jsx and LandingPage/index.jsx (or
extract a shared constant like siteLogoUrl) so all references concatenate
import.meta.env.BASE_URL with "urBACKEND_NAV_LOGO (2).png" instead of using a
root-relative string.

---

Nitpick comments:
In `@docs/api-reference.md`:
- Around line 8-12: The docs use two different route placeholder names (":col"
in the API table and ":collectionName" elsewhere); standardize to one
placeholder (use ":collectionName") by replacing all occurrences of
"/api/data/:col" and "/api/data/:col/:id" in the API table with
"/api/data/:collectionName" and "/api/data/:collectionName/:id" so the route
examples match the rest of the docs (look for the table entries and route
patterns in the docs to update).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 643249d4-8ffd-4098-892e-2deb096c3317

📥 Commits

Reviewing files that changed from the base of the PR and between 03a8b93 and 49b81d5.

⛔ Files ignored due to path filters (2)
  • banner.png is excluded by !**/*.png
  • frontend/public/urBACKEND_NAV_LOGO (2).png is excluded by !**/*.png
📒 Files selected for processing (15)
  • API_USAGE.md
  • README.md
  • docs/SUMMARY.md
  • docs/api-reference.md
  • docs/authentication.md
  • docs/database.md
  • docs/getting-started.md
  • docs/introduction.md
  • docs/security.md
  • docs/storage.md
  • frontend/src/components/Layout/Footer.jsx
  • frontend/src/components/Layout/MainLayout.jsx
  • frontend/src/components/Layout/Sidebar.jsx
  • frontend/src/pages/LandingPage/index.jsx
  • frontend/src/pages/LandingPage/style.css
💤 Files with no reviewable changes (1)
  • API_USAGE.md

Comment thread docs/authentication.md
Comment thread docs/getting-started.md
Comment thread docs/getting-started.md
Comment thread docs/introduction.md Outdated
Comment thread docs/security.md
Comment thread docs/security.md Outdated
Comment thread frontend/src/components/Layout/MainLayout.jsx Outdated
@coderabbitai

coderabbitai Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Note

Docstrings generation - SUCCESS
Generated docstrings for this pull request at #38

coderabbitai Bot added a commit that referenced this pull request Mar 6, 2026
Docstrings generation was requested by @yash-pouranik.

* #37 (comment)

The following files were modified:

* `frontend/src/components/Layout/Footer.jsx`
* `frontend/src/components/Layout/MainLayout.jsx`
* `frontend/src/components/Layout/Sidebar.jsx`
* `frontend/src/pages/LandingPage/index.jsx`
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 (2)
docs/database.md (2)

29-35: Document query parameters for filtering, sorting, and pagination.

The "Fetch All" endpoint (line 32) documentation doesn't mention how to filter, sort, limit, or paginate results when fetching all documents. For collections with many documents, developers will need guidance on:

  • Filtering by field values (e.g., ?status=published)
  • Sorting results (e.g., ?sort=-createdAt)
  • Pagination (e.g., ?limit=10&skip=20)

If the API supports these features, documenting them would significantly improve usability. If not supported yet, consider noting that all documents are returned (which could be a performance concern for large collections).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/database.md` around lines 29 - 35, The "Fetch All" endpoint GET
/api/data/:collectionName lacks documentation for query parameters; update the
docs to list supported query params for filtering (e.g., field=value, multiple
fields), sorting (e.g., sort=field or sort=-field for desc), pagination/limits
(e.g., limit and skip or page and perPage), and provide example query strings
like ?status=published&sort=-createdAt&limit=10&skip=20; if the API does not
support these features yet, explicitly state that the endpoint returns all
documents and note the potential performance implications and recommend adding
pagination/filtering in the future.

29-35: Consider adding code examples for GET requests.

Unlike the Create and Update sections, the Read section lacks code examples. Adding fetch examples for both endpoints would improve consistency and help developers understand:

  • How to include the x-api-key header in GET requests
  • What the response structure looks like
  • How to handle returned data (single document vs. array of documents)
📝 Example to consider adding
// Fetch all documents
const response = await fetch('https://api.urbackend.bitbros.in/api/data/posts', {
  method: 'GET',
  headers: { 'x-api-key': 'YOUR_KEY' }
});
const posts = await response.json();

// Fetch single document
const postId = "YOUR_DOCUMENT_ID";
const singleResponse = await fetch(`https://api.urbackend.bitbros.in/api/data/posts/${postId}`, {
  method: 'GET',
  headers: { 'x-api-key': 'YOUR_KEY' }
});
const post = await singleResponse.json();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/database.md` around lines 29 - 35, Add JavaScript fetch examples to the
"Fetch All" and "Fetch Single Document" sections in docs/database.md showing how
to call the GET /api/data/:collectionName and GET /api/data/:collectionName/:id
endpoints with the x-api-key header, parse the JSON response, and demonstrate
the expected response shapes (an array for the collection fetch and an object
for the single document fetch); place concise snippets under the respective
headings and label them "Fetch all documents" and "Fetch single document" so
readers can copy/paste usage for those endpoints.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/database.md`:
- Around line 16-27: The example uses an API key directly in a client-side fetch
call (the fetch() example setting header 'x-api-key'), which risks leaking
secrets; add a concise security note after the code block stating that API keys
must never be embedded in frontend/browser code, that the shown pattern is for
server-side/Node.js or trusted environments only, and recommend using a backend
proxy or user-authentication (e.g., JWTs with proper expiry) instead of exposing
'x-api-key' to clients.

---

Nitpick comments:
In `@docs/database.md`:
- Around line 29-35: The "Fetch All" endpoint GET /api/data/:collectionName
lacks documentation for query parameters; update the docs to list supported
query params for filtering (e.g., field=value, multiple fields), sorting (e.g.,
sort=field or sort=-field for desc), pagination/limits (e.g., limit and skip or
page and perPage), and provide example query strings like
?status=published&sort=-createdAt&limit=10&skip=20; if the API does not support
these features yet, explicitly state that the endpoint returns all documents and
note the potential performance implications and recommend adding
pagination/filtering in the future.
- Around line 29-35: Add JavaScript fetch examples to the "Fetch All" and "Fetch
Single Document" sections in docs/database.md showing how to call the GET
/api/data/:collectionName and GET /api/data/:collectionName/:id endpoints with
the x-api-key header, parse the JSON response, and demonstrate the expected
response shapes (an array for the collection fetch and an object for the single
document fetch); place concise snippets under the respective headings and label
them "Fetch all documents" and "Fetch single document" so readers can copy/paste
usage for those endpoints.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7025479b-c431-4f59-ae0f-560ccc52bf9f

📥 Commits

Reviewing files that changed from the base of the PR and between 49b81d5 and 6ed8daa.

📒 Files selected for processing (1)
  • docs/database.md

Comment thread docs/database.md
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 (1)
SUMMARY.md (1)

3-3: Use h2 (##) for top-level section headings instead of h3.

The document jumps from h1 (# Summary) directly to h3 (### Documentation). For proper heading hierarchy, section headings should use h2 (##).

📝 Proposed fix
-### Documentation 📚
+## Documentation 📚
-### Project & Community 🤝
+## Project & Community 🤝

Also applies to: 14-14

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@SUMMARY.md` at line 3, Change top-level section headings from h3 to h2:
replace "### Documentation 📚" with "## Documentation 📚" and likewise update
any other occurrences of h3 used as top-level sections (the other instance
mentioned) so all main sections under "# Summary" use "##" for proper hierarchy;
locate the headings by their text ("Documentation") and amend the leading hashes
accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/getting-started.md`:
- Line 16: The docs incorrectly state that collections are created on the fly;
update the text to reflect that insertData checks project.collections for an
existing collection (see collectionConfig and the insertData controller) and
returns 404 if not found. Change the sentence to say collections must be
pre-configured before POSTing, and add a short note/instruction explaining how
to create or register a collection (or link to the collection setup docs) so
users won't hit the 404 from the insertData controller's collection lookup.

---

Nitpick comments:
In `@SUMMARY.md`:
- Line 3: Change top-level section headings from h3 to h2: replace "###
Documentation 📚" with "## Documentation 📚" and likewise update any other
occurrences of h3 used as top-level sections (the other instance mentioned) so
all main sections under "# Summary" use "##" for proper hierarchy; locate the
headings by their text ("Documentation") and amend the leading hashes
accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 429c63c6-080b-4d09-bc74-abfbe2236202

📥 Commits

Reviewing files that changed from the base of the PR and between 6ed8daa and 9e368a2.

⛔ Files ignored due to path filters (2)
  • frontend/public/logo.png is excluded by !**/*.png
  • frontend/public/logo_u.png is excluded by !**/*.png
📒 Files selected for processing (10)
  • DEVLOG.md
  • README.md
  • SUMMARY.md
  • docs/api-reference.md
  • docs/getting-started.md
  • docs/introduction.md
  • docs/security.md
  • frontend/src/components/Layout/Footer.jsx
  • frontend/src/components/Layout/MainLayout.jsx
  • frontend/src/pages/LandingPage/index.jsx
💤 Files with no reviewable changes (1)
  • DEVLOG.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • frontend/src/components/Layout/MainLayout.jsx
  • docs/introduction.md
  • docs/api-reference.md
  • frontend/src/components/Layout/Footer.jsx
  • frontend/src/pages/LandingPage/index.jsx

Comment thread docs/getting-started.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/getting-started.md`:
- Around line 20-22: The markdown contains two adjacent blockquotes ("**💡 Pro
Tip**: You can define..." and "**⚠️ Note**: Write operations...") separated by a
blank line which triggers MD028; remove the empty line between these two
blockquote paragraphs so they are consecutive blockquotes (i.e., ensure the line
after the Pro Tip blockquote begins with '>' immediately before the Note
blockquote) to satisfy the linter.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 73bcf66c-d600-46a0-98d6-e5dce82b2fda

📥 Commits

Reviewing files that changed from the base of the PR and between 9e368a2 and 2f459fc.

📒 Files selected for processing (1)
  • docs/getting-started.md

Comment thread docs/getting-started.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
backend/controllers/storage.controller.js (1)

31-57: ⚠️ Potential issue | 🟠 Major

Make the storage-limit check and reservation atomic.

Line 32 reads project.storageUsed from the request object, but Line 54 increments the persisted counter later, after the file is already uploaded. Two concurrent uploads can both pass the check and push internal storage past storageLimit, and a DB failure after a successful upload leaves an untracked file behind. Please reserve quota with a conditional DB update before the upload, then roll it back if the upload fails.

💡 Proposed fix
-        if (!external) {
-            if (project.storageUsed + file.size > project.storageLimit) {
-                return res
-                    .status(403)
-                    .json({ error: "Internal storage limit exceeded." });
-            }
-        }
+        if (!external) {
+            const reservation = await Project.updateOne(
+                {
+                    _id: project._id,
+                    storageUsed: { $lte: project.storageLimit - file.size }
+                },
+                { $inc: { storageUsed: file.size } }
+            );
+
+            if (reservation.modifiedCount !== 1) {
+                return res
+                    .status(403)
+                    .json({ error: "Internal storage limit exceeded." });
+            }
+        }
@@
-        if (uploadError) throw uploadError;
-
-        if (!external) {
-            await Project.updateOne(
-                { _id: project._id },
-                { $inc: { storageUsed: file.size } }
-            );
-        }
+        if (uploadError) {
+            if (!external) {
+                await Project.updateOne(
+                    { _id: project._id },
+                    { $inc: { storageUsed: -file.size } }
+                );
+            }
+            throw uploadError;
+        }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@backend/controllers/storage.controller.js` around lines 31 - 57, The current
flow reads project.storageUsed then uploads and only afterward increments
storageUsed, allowing race conditions and orphaned uploads; change to atomically
reserve quota before upload by performing a conditional DB update (e.g., use
Project.findOneAndUpdate or updateOne with a filter that ensures storageUsed +
file.size <= storageLimit and $inc: { storageUsed: file.size }) and fail with
403 if the update did not match (no quota); proceed to call
supabase.storage.from(bucket).upload(filePath, ...) only after the successful
reservation; if the upload fails (uploadError or thrown), roll back the
reservation by decrementing storageUsed by file.size (use a safe update like
Project.updateOne({ _id: project._id }, { $inc: { storageUsed: -file.size } }))
and surface the upload error to the caller. Ensure the code references
project._id, file.size, Project.updateOne/findOneAndUpdate, filePath and the
supabase upload call so you modify the right places.
🧹 Nitpick comments (1)
backend/controllers/storage.controller.js (1)

10-11: Consider extracting isExternal to a shared helper.

This logic now duplicates backend/controllers/project.controller.js:29-33. Keeping the storage classification rule in one place will prevent the controllers from drifting if the Project shape changes again.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@backend/controllers/storage.controller.js` around lines 10 - 11, The
isExternal check in storage.controller.js (const isExternal = (project) =>
!!project.resources?.storage?.isExternal) is duplicated in
project.controller.js; extract this logic into a shared helper (e.g., export a
function isProjectStorageExternal in a new/shared module) and replace both local
definitions with imports from that helper, updating storage.controller.js and
project.controller.js to call the shared isProjectStorageExternal function so
the storage classification rule is maintained in one place.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@backend/controllers/project.controller.js`:
- Around line 903-909: The current enable-auth check only validates an existing
'users' collection schema but allows enabling auth when the 'users' collection
is missing; update the logic around usersCol and validateUsersSchema (the
project.collections.find(c => c.name === 'users') result) to explicitly block
enabling auth when usersCol is falsy by returning a 422 JSON response explaining
that the 'users' collection must exist (and include required 'email' and
'password' fields) before toggling isAuthEnabled, so Auth cannot be marked
enabled while signup/login remain nonfunctional.

In `@SUMMARY.md`:
- Line 13: The "Project & Community" heading jumps from h1 ("Summary") to h3;
change the "### Project & Community 🤝" heading to h2 ("## Project & Community
🤝") to restore proper incremental heading levels, and scan nearby headings
(e.g., any following "###" sections) to ensure heading levels only increase or
decrease by one step relative to their predecessors.

---

Outside diff comments:
In `@backend/controllers/storage.controller.js`:
- Around line 31-57: The current flow reads project.storageUsed then uploads and
only afterward increments storageUsed, allowing race conditions and orphaned
uploads; change to atomically reserve quota before upload by performing a
conditional DB update (e.g., use Project.findOneAndUpdate or updateOne with a
filter that ensures storageUsed + file.size <= storageLimit and $inc: {
storageUsed: file.size }) and fail with 403 if the update did not match (no
quota); proceed to call supabase.storage.from(bucket).upload(filePath, ...) only
after the successful reservation; if the upload fails (uploadError or thrown),
roll back the reservation by decrementing storageUsed by file.size (use a safe
update like Project.updateOne({ _id: project._id }, { $inc: { storageUsed:
-file.size } })) and surface the upload error to the caller. Ensure the code
references project._id, file.size, Project.updateOne/findOneAndUpdate, filePath
and the supabase upload call so you modify the right places.

---

Nitpick comments:
In `@backend/controllers/storage.controller.js`:
- Around line 10-11: The isExternal check in storage.controller.js (const
isExternal = (project) => !!project.resources?.storage?.isExternal) is
duplicated in project.controller.js; extract this logic into a shared helper
(e.g., export a function isProjectStorageExternal in a new/shared module) and
replace both local definitions with imports from that helper, updating
storage.controller.js and project.controller.js to call the shared
isProjectStorageExternal function so the storage classification rule is
maintained in one place.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f84e3bee-f7ea-45f7-b4ac-0bf0f5039dbc

📥 Commits

Reviewing files that changed from the base of the PR and between 2f459fc and 95cecb6.

📒 Files selected for processing (4)
  • README.md
  • SUMMARY.md
  • backend/controllers/project.controller.js
  • backend/controllers/storage.controller.js

Comment thread backend/controllers/project.controller.js
Comment thread SUMMARY.md Outdated
@yash-pouranik
yash-pouranik temporarily deployed to feat/docs-and-branding - urBackend-frankfrut PR #37 March 7, 2026 10:23 — with Render Destroyed
@yash-pouranik
yash-pouranik merged commit 4a7a0e5 into main Mar 7, 2026
7 of 9 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Apr 2, 2026
17 tasks
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