Skip to content

docs: added docs generated by mintlify by refrencing to /docs-legacy#91

Merged
yash-pouranik merged 1 commit intomainfrom
docs/powered-by-mintlify
Apr 11, 2026
Merged

docs: added docs generated by mintlify by refrencing to /docs-legacy#91
yash-pouranik merged 1 commit intomainfrom
docs/powered-by-mintlify

Conversation

@yash-pouranik
Copy link
Copy Markdown
Collaborator

@yash-pouranik yash-pouranik commented Apr 11, 2026

urbackend docs generated by mintlify.


Built with ❤️ for urBackend.

Summary by CodeRabbit

Release Notes

  • Documentation
    • Complete API reference documentation covering authentication, database operations, and file storage endpoints
    • User guides for signup/login, password reset, OAuth social authentication via GitHub and Google
    • Database management guides including row-level security and schema concepts
    • File upload and storage management documentation
    • Webhook integration guide with signature verification
    • TypeScript SDK documentation and quick start tutorial

Copilot AI review requested due to automatic review settings April 11, 2026 08:30
@mintlify
Copy link
Copy Markdown
Contributor

mintlify bot commented Apr 11, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
urbackend 🟢 Ready View Preview Apr 11, 2026, 8:31 AM

@yash-pouranik yash-pouranik temporarily deployed to docs/powered-by-mintlify - urBackend-frankfrut PR #91 April 11, 2026 08:30 — with Render Destroyed
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 11, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 23ae4c3b-c6fa-4574-bc46-e5cc2b67b326

📥 Commits

Reviewing files that changed from the base of the PR and between 6c16968 and 203aa81.

📒 Files selected for processing (38)
  • mintlify/docs/.atlas-analysis.json
  • mintlify/docs/.mintignore
  • mintlify/docs/AGENTS.md
  • mintlify/docs/CONTRIBUTING.md
  • mintlify/docs/LICENSE
  • mintlify/docs/README.md
  • mintlify/docs/api-reference/auth/login.mdx
  • mintlify/docs/api-reference/auth/logout.mdx
  • mintlify/docs/api-reference/auth/me.mdx
  • mintlify/docs/api-reference/auth/refresh-token.mdx
  • mintlify/docs/api-reference/auth/signup.mdx
  • mintlify/docs/api-reference/auth/social.mdx
  • mintlify/docs/api-reference/data/delete.mdx
  • mintlify/docs/api-reference/data/get-all.mdx
  • mintlify/docs/api-reference/data/get-one.mdx
  • mintlify/docs/api-reference/data/insert.mdx
  • mintlify/docs/api-reference/data/update.mdx
  • mintlify/docs/api-reference/overview.mdx
  • mintlify/docs/api-reference/storage/delete.mdx
  • mintlify/docs/api-reference/storage/upload.mdx
  • mintlify/docs/concepts/api-keys.mdx
  • mintlify/docs/concepts/collections-schemas.mdx
  • mintlify/docs/concepts/row-level-security.mdx
  • mintlify/docs/docs.json
  • mintlify/docs/guides/authentication.mdx
  • mintlify/docs/guides/database.mdx
  • mintlify/docs/guides/social-auth.mdx
  • mintlify/docs/guides/storage.mdx
  • mintlify/docs/guides/webhooks.mdx
  • mintlify/docs/index.mdx
  • mintlify/docs/introduction.mdx
  • mintlify/docs/limits-and-quotas.mdx
  • mintlify/docs/quickstart.mdx
  • mintlify/docs/sdk/auth.mdx
  • mintlify/docs/sdk/database.mdx
  • mintlify/docs/sdk/overview.mdx
  • mintlify/docs/sdk/storage.mdx
  • mintlify/docs/security.mdx

📝 Walkthrough

Walkthrough

This PR adds comprehensive Mintlify documentation for urBackend, covering API reference endpoints (auth, data, storage), SDK usage guides, concept explanations (API keys, collections, RLS), security guidance, and configuration files for the documentation site.

Changes

Cohort / File(s) Summary
Configuration & Setup
.mintignore, docs.json, .atlas-analysis.json, LICENSE, README.md, AGENTS.md, CONTRIBUTING.md
Project metadata, Mintlify configuration, licensing, contributing guidelines, and documentation metadata definition.
Core Documentation
index.mdx, introduction.mdx, quickstart.mdx, limits-and-quotas.mdx, security.mdx
Landing page, introductory overview, quick start setup guide, operational limits/quotas, and security mechanisms documentation.
Concept Documentation
concepts/api-keys.mdx, concepts/collections-schemas.mdx, concepts/row-level-security.mdx
Explanations of API key types, MongoDB collection/schema management, and row-level security implementation and usage.
Guide Documentation
guides/authentication.mdx, guides/database.mdx, guides/social-auth.mdx, guides/storage.mdx, guides/webhooks.mdx
Step-by-step guides covering user authentication flows, database CRUD operations, OAuth integration, file uploads, and webhook configuration.
API Reference - Authentication
api-reference/auth/login.mdx, api-reference/auth/logout.mdx, api-reference/auth/me.mdx, api-reference/auth/refresh-token.mdx, api-reference/auth/signup.mdx, api-reference/auth/social.mdx
Detailed endpoint documentation for all authentication operations including sign-up, login, profile retrieval, token refresh, logout, and social OAuth.
API Reference - Data Operations
api-reference/data/get-one.mdx, api-reference/data/get-all.mdx, api-reference/data/insert.mdx, api-reference/data/update.mdx, api-reference/data/delete.mdx
Complete CRUD operation reference with request/response schemas, error handling, RLS behavior, and code examples.
API Reference - Storage & Overview
api-reference/storage/upload.mdx, api-reference/storage/delete.mdx, api-reference/overview.mdx
File upload/deletion endpoints, API base URL, authentication requirements, response envelope format, and endpoint quick reference table.
SDK Documentation
sdk/overview.mdx, sdk/auth.mdx, sdk/database.mdx, sdk/storage.mdx
TypeScript SDK installation, initialization, and module documentation covering auth operations, database queries, storage operations, and error handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • PR #80: Implements Row-Level Security (RLS) features that this documentation comprehensively describes and documents.
  • PR #90: Introduces SDK v0.2.0 updates whose APIs, type signatures, and behaviors are directly documented in the new SDK pages.
  • PR #81: Adds social authentication OAuth endpoints (/api/userAuth/social/*) that the social auth API reference and guide pages document in detail.

Poem

🐰 Docs bloom bright in Mintlify's care,
API routes and SDK laid bare!
From auth to storage, each endpoint so clear,
A rabbit-reviewed map for all to revere. 🌟

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/powered-by-mintlify

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.

@yash-pouranik yash-pouranik merged commit 7cb6957 into main Apr 11, 2026
6 of 7 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Mintlify documentation site for urBackend, including guides, SDK docs, and API reference pages.

Changes:

  • Introduces Mintlify config (docs.json) and a full documentation IA (Get Started / Concepts / Guides / SDK / API Reference).
  • Adds new MDX pages covering auth, database, storage, webhooks, security, limits, and SDK usage.
  • Includes Mintlify starter-kit ancillary files (README/CONTRIBUTING/AGENTS/LICENSE/.mintignore) and an analysis snapshot.

Reviewed changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated 28 comments.

Show a summary per file
File Description
mintlify/docs/docs.json Defines Mintlify site settings and navigation structure.
mintlify/docs/index.mdx New docs landing page with links into major sections.
mintlify/docs/introduction.mdx Product overview and feature entry points.
mintlify/docs/quickstart.mdx Quick start workflow for keys, collections, and first API calls.
mintlify/docs/security.mdx Security model overview (keys, injection, rate limiting, domains).
mintlify/docs/limits-and-quotas.mdx Documented service limits and common HTTP status codes.
mintlify/docs/concepts/api-keys.mdx Explains pk/sk key usage and RLS interaction.
mintlify/docs/concepts/collections-schemas.mdx Explains collections, schema modes, and field types.
mintlify/docs/concepts/row-level-security.mdx Explains RLS behavior, modes, and examples.
mintlify/docs/guides/authentication.mdx End-user auth flows using /api/userAuth/* endpoints.
mintlify/docs/guides/social-auth.mdx OAuth social login setup and callback/exchange flow.
mintlify/docs/guides/database.mdx REST CRUD + filtering/pagination docs for data API.
mintlify/docs/guides/storage.mdx REST storage upload/delete guide.
mintlify/docs/guides/webhooks.mdx Webhook payload/signature verification and retry guidance.
mintlify/docs/sdk/overview.mdx SDK install + initialization + error handling overview.
mintlify/docs/sdk/auth.mdx SDK auth module methods and usage.
mintlify/docs/sdk/database.mdx SDK database module methods and usage.
mintlify/docs/sdk/storage.mdx SDK storage module methods and usage.
mintlify/docs/api-reference/overview.mdx API base URL, auth headers, response format, endpoint index.
mintlify/docs/api-reference/auth/signup.mdx API reference for signup endpoint.
mintlify/docs/api-reference/auth/login.mdx API reference for login endpoint.
mintlify/docs/api-reference/auth/me.mdx API reference for me + public profile endpoints.
mintlify/docs/api-reference/auth/refresh-token.mdx API reference for refresh-token endpoint.
mintlify/docs/api-reference/auth/logout.mdx API reference for logout endpoint.
mintlify/docs/api-reference/auth/social.mdx API reference for social auth start + exchange endpoints.
mintlify/docs/api-reference/data/get-all.mdx API reference for listing documents.
mintlify/docs/api-reference/data/get-one.mdx API reference for fetching a single document.
mintlify/docs/api-reference/data/insert.mdx API reference for inserting documents.
mintlify/docs/api-reference/data/update.mdx API reference for PUT/PATCH updates.
mintlify/docs/api-reference/data/delete.mdx API reference for deleting documents.
mintlify/docs/api-reference/storage/upload.mdx API reference for storage upload.
mintlify/docs/api-reference/storage/delete.mdx API reference for storage delete.
mintlify/docs/.mintignore Mintlify ignore rules (drafts, etc.).
mintlify/docs/.atlas-analysis.json Generated Mintlify/Atlas analysis snapshot.
mintlify/docs/README.md Mintlify starter-kit README template.
mintlify/docs/CONTRIBUTING.md Mintlify starter-kit contributing template.
mintlify/docs/AGENTS.md Mintlify agent guidance template.
mintlify/docs/LICENSE Mintlify starter-kit license file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +66 to +70
window.location.href = `${API_URL}/api/userAuth/social/github/start?x-api-key=${API_KEY}`;
};

const handleGoogleLogin = () => {
window.location.href = `${API_URL}/api/userAuth/social/google/start?x-api-key=${API_KEY}`;
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

The OAuth start URLs here use ?x-api-key=..., but the public API middleware only reads a publishable key from the key query parameter (and strips req.query.key). Using x-api-key in the query string will be ignored and the redirect will 401. Update the examples to use ?key=pk_live_... (and keep secret keys in headers only).

Suggested change
window.location.href = `${API_URL}/api/userAuth/social/github/start?x-api-key=${API_KEY}`;
};
const handleGoogleLogin = () => {
window.location.href = `${API_URL}/api/userAuth/social/google/start?x-api-key=${API_KEY}`;
window.location.href = `${API_URL}/api/userAuth/social/github/start?key=${API_KEY}`;
};
const handleGoogleLogin = () => {
window.location.href = `${API_URL}/api/userAuth/social/google/start?key=${API_KEY}`;

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +33
Redirects the user's browser to the provider login page. Because this is a browser redirect (not a `fetch` call), pass your API key as a query parameter.

<ParamField path="provider" type="string" required>
OAuth provider name. Accepted values: `github`, `google`.
</ParamField>

<ParamField query="x-api-key" type="string" required>
Your `pk_live_…` key. Can also be sent as a header if you are making a non-redirect request.
</ParamField>

Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

This API reference documents the OAuth start endpoint as taking x-api-key in the query string, but the server expects the publishable key in ?key= (query param) for browser redirects. Update the parameter name and the code examples accordingly or the documented flow will fail with 401.

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +11
Access storage methods via `client.storage`. Uploaded files are served from a public CDN — no extra configuration required.

<Note>
Storage operations accept both `pk_live_...` and `sk_live_...` keys. Use `pk_live_...` in browser code for user-initiated uploads, and `sk_live_...` for server-side uploads. Never expose your secret key in browser code.
</Note>
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

This note says Storage operations accept both pk_live_... and sk_live_... keys, but /api/storage/* routes are protected by requireSecretKey in the public API. With the current backend, storage calls require sk_live_... and will 403 for publishable keys—please update the SDK docs accordingly (or change the backend to actually allow pk-live uploads).

Copilot uses AI. Check for mistakes.
Comment on lines +98 to +107
## Limits

| Limit | Value |
|---|---|
| Max file size | 5 MB per file |
| Total storage per project | 100 MB |

<Note>
Uploads that exceed 5 MB are rejected with a `StorageError`. Check `file.size` before calling `upload()` if you need to show a friendly error to your users.
</Note>
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

The limits section claims the SDK upload limit is 5 MB, but the server enforces a 10 MB max file size for /api/storage/upload (multer + controller check). The SDK does not appear to enforce 5 MB client-side either, so this will mislead users—update to the actual limit or document any planned SDK-side restriction.

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +30
const res = await fetch('https://api.ub.bitbros.in/api/storage/upload', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_KEY'
},
body: formData
});
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

The storage guide implies any API key can be used ('YOUR_KEY'), but the public API storage routes require a secret key (sk_live_...) via requireSecretKey. Document this explicitly; otherwise users will try pk_live_... from the browser and get 403.

Copilot uses AI. Check for mistakes.
Comment on lines +72 to +94
## deleteFile

Delete a previously uploaded file by its storage path.

```typescript
deleteFile(path: string): Promise<{ deleted: boolean }>
```

**Parameters**

| Name | Type | Required | Description |
|---|---|---|---|
| `path` | `string` | Yes | The `path` returned by `upload()`. |

**Example**

```typescript
// Retrieve the stored path
const image = await client.db.getOne('product_images', id);

const result = await client.storage.deleteFile(image.path);
console.log(result.deleted); // true
```
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

deleteFile() is documented as returning { deleted: boolean }, but the current /api/storage/file handler responds with { message: "File deleted successfully" } on success (no deleted flag). Either adjust the docs/types to match the API, or update the API response to include the documented boolean so SDK callers can rely on it.

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +76
Your webhook URL is public, so anyone could send data to it. urBackend signs every payload with your signing secret using HMAC-SHA256 and includes the signature in the `X-urBackend-Signature` header. Always verify this signature before processing the event.

### How verification works

1. urBackend computes `HMAC-SHA256(signingSecret, JSON.stringify(requestBody))`.
2. The resulting hex digest is sent in `X-urBackend-Signature`.
3. Your server performs the same computation and compares the result.
4. If the signatures match, the request is authentic.

### Node.js / Express example

```javascript
const express = require('express');
const crypto = require('crypto');
const app = express();

const URBACKEND_WEBHOOK_SECRET = process.env.URBACKEND_WEBHOOK_SECRET;

app.post('/urbackend-webhook', express.json(), (req, res) => {
// 1. Extract the signature header sent by urBackend
const signature = req.headers['x-urbackend-signature'];

// 2. Serialize the request body
const payload = JSON.stringify(req.body);

// 3. Compute the expected HMAC-SHA256 digest
const expectedSignature = crypto
.createHmac('sha256', URBACKEND_WEBHOOK_SECRET)
.update(payload)
.digest('hex');

// 4. Compare signatures — reject if they don't match
if (!signature || signature !== expectedSignature) {
console.error('Webhook verification failed — potential spoofing attempt');
return res.status(401).send('Invalid signature');
}
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

The webhook signature example computes/compares a raw hex digest, but the backend sends X-urBackend-Signature in the format sha256=<hex> (including the sha256= prefix). As written, signature !== expectedSignature will always fail. Update the docs to either include the prefix in the computed value or strip it before comparison.

Copilot uses AI. Check for mistakes.
Comment on lines +92 to +97
Always respond with a `2xx` status code as quickly as possible. If your endpoint takes longer than 10 seconds to respond or returns a `4xx`/`5xx` status, urBackend marks the delivery as failed and will retry it.
</Warning>

## Retry logic

If a delivery fails (timeout over 10 seconds, or a `4xx`/`5xx` response), urBackend will automatically retry. You can inspect every delivery attempt — including the exact payload sent and the response received — in the **Delivery History** panel of your webhook's dashboard page. You can also manually replay failed deliveries from there.
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

This warning states failures include a timeout over 10 seconds, but the current webhook delivery worker uses a 30s AbortController timeout. Update the documented timeout threshold so it matches actual delivery behavior (or adjust the implementation to 10s if that’s the intended contract).

Suggested change
Always respond with a `2xx` status code as quickly as possible. If your endpoint takes longer than 10 seconds to respond or returns a `4xx`/`5xx` status, urBackend marks the delivery as failed and will retry it.
</Warning>
## Retry logic
If a delivery fails (timeout over 10 seconds, or a `4xx`/`5xx` response), urBackend will automatically retry. You can inspect every delivery attempt — including the exact payload sent and the response received — in the **Delivery History** panel of your webhook's dashboard page. You can also manually replay failed deliveries from there.
Always respond with a `2xx` status code as quickly as possible. If your endpoint takes longer than 30 seconds to respond or returns a `4xx`/`5xx` status, urBackend marks the delivery as failed and will retry it.
</Warning>
## Retry logic
If a delivery fails (timeout over 30 seconds, or a `4xx`/`5xx` response), urBackend will automatically retry. You can inspect every delivery attempt — including the exact payload sent and the response received — in the **Delivery History** panel of your webhook's dashboard page. You can also manually replay failed deliveries from there.

Copilot uses AI. Check for mistakes.
Comment on lines +252 to +263
**Endpoint:** `POST /api/userAuth/verify-email`

```javascript
const res = await fetch('https://api.ub.bitbros.in/api/userAuth/verify-email', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'pk_live_YOUR_KEY'
},
body: JSON.stringify({ token: 'VERIFICATION_TOKEN_FROM_EMAIL' })
});
```
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

The verify-email example posts { token: ... }, but the current /api/userAuth/verify-email endpoint expects { email, otp } (OTP stored in Redis). Please update the request body example/description to match the actual API contract.

Copilot uses AI. Check for mistakes.
Comment on lines +227 to +244
<Step title="Reset the password">
Submit the reset token (from the email link) along with the new password.

**Endpoint:** `POST /api/userAuth/reset-password`

```javascript
const res = await fetch('https://api.ub.bitbros.in/api/userAuth/reset-password', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'pk_live_YOUR_KEY'
},
body: JSON.stringify({
token: 'RESET_TOKEN_FROM_EMAIL',
newPassword: 'newSecurePassword456'
})
});
```
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

The reset-password example uses { token, newPassword }, but the current /api/userAuth/reset-password endpoint expects { email, otp, newPassword }. Update the docs so integrators send the OTP code they received, not a token field.

Copilot uses AI. Check for mistakes.
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.

2 participants