Summary

urBackend Banner

Bring your own MongoDB. Get a production-ready backend in 60 seconds. your backend β€” your database β€” your rules.

Dashboardarrow-up-right Β· Docs Β· Quick Start Β· Discordarrow-up-right

Build Status
Cron job status
License
Issues
Stars

urBackend is an Open-Source BaaS built to eliminate the complexity of backend management. It provides everything you need to power your next big ideaβ€”accessible via a unified REST API.

🟒 Powerful Features

Feature
Description

Instant NoSQL

Create collections and push JSON data instantly with zero boilerplate.

Managed Auth

Sign Up, Login, and Profile management with JWT built-in.

Cloud Storage

Managed file/image uploads with public CDN links.

BYO Database

Connect your own MongoDB Atlas or self-hosted instance.

Real-time Analytics

Monitor traffic and resource usage from a premium dashboard.

Secure Architecture

Dual-key separation (pk_live & sk_live) for total safety.


πŸš€ Quick Start

Go from zero to a live backend in under 60 seconds.

  1. Initialize: Create a project on the Dashboardarrow-up-right.

  2. Model: Visually define your collections and schemas.

  3. Execute: Push and pull data immediately using your API key.


πŸ”‘ Key Behavior: pk_live vs sk_live

Understanding which key to useβ€”and whenβ€”prevents the most common integration mistakes.

Scenario
Key
Auth Token
Result

Read any collection

pk_live

Not required

βœ… Allowed

Write to a collection (RLS disabled)

pk_live

Any

❌ 403 Blocked

Write to a collection (RLS disabled)

sk_live

Not required

βœ… Allowed

Write to a collection (RLS enabled, no token)

pk_live

Missing

❌ 401 Unauthorized

Write to a collection (RLS enabled, wrong owner)

pk_live

Token with different userId

❌ 403 Owner mismatch

Write to a collection (RLS enabled, correct owner)

pk_live

Token with matching userId

βœ… Allowed

Write to a collection (RLS enabled, no ownerField)

pk_live

Valid token

βœ… Allowed (userId auto-injected)

Access /api/data/users*

Any

Any

❌ 403 Blocked β€” use /api/userAuth/*

Rule of thumb: pk_live is for frontend reads. Use sk_live for server-side writes, or enable collection RLS to allow authenticated users to write their own data with pk_live.


πŸ›‘οΈ Row-Level Security (RLS)

RLS lets you safely allow frontend clients to write data without exposing your secret key. When enabled on a collection, pk_live writes are gated by user ownership.

How it works:

  1. Enable RLS for a collection in the Dashboard (mode: owner-write-only).

  2. Choose the owner field β€” the document field that stores the authenticated user's ID (e.g., userId).

  3. The client must send a valid user JWT in the Authorization: Bearer <token> header.

  4. urBackend enforces that the JWT's userId matches the document's owner field.

Example β€” user creates a post:

Common failure cases:

Error
Cause
Fix

403 Write blocked for publishable key

RLS is not enabled on the collection

Enable RLS in Dashboard, or use sk_live

401 Authentication required

No Authorization header provided

Add Authorization: Bearer <user_jwt>

403 RLS owner mismatch

Token's userId β‰  document's owner field

Make sure the user is writing their own data

403 Insert denied (ownerField _id)

_id is not a valid owner field for inserts

Change ownerField to userId or similar

403 Owner field immutable

Trying to change the owner field on update

Remove the owner field from the PATCH/PUT body


πŸ‘€ User Authentication

User accounts are managed through /api/userAuth/* endpoints β€” not through the data API. Direct access to /api/data/users* is blocked for security.

Both endpoints require your pk_live key in x-api-key. See the full auth docs for more.


πŸ—οΈ How it Works


πŸ—οΈ Architecture

Explore our Architecture Diagram to understand the system design, core components, and data flow in detail.


🏠 Self-Hosting

Want to run your own instance? Follow the step-by-step guide to deploy urBackend to Render (backend) and Vercel (frontend) using free-tier services β€” no Docker required.

πŸ‘‰ DEPLOYMENT.mdarrow-up-right


🀝 Community

Join hundreds of developers building faster without the backend headaches.


Contributors

arrow-up-right

Built with ❀️ by the urBackend community.

Last updated