Welcome to urBackend! This repository is an NPM Workspaces Monorepo containing three core microservices:
apps/web-dashboard: React/Vite Frontend Interfaceapps/dashboard-api: SaaS Admin Backend (Control Plane)apps/public-api: Core User API Backend (Data Plane)
All common logic is shared securely via the @urbackend/common package.
Running this entire monorepo stack on your computer is insanely simple.
- Node.js v20+
- A running MongoDB instance (or MongoDB Atlas Free cluster)
- A running Redis instance (or Redis Cloud Free instance)
-
Clone the repository:
git clone https://github.com/your-username/urBackend.git cd urBackend -
Install all dependencies globally: (Do not run inside sub-folders. This symlinks the workspaces perfectly).
npm install
-
Set up Environment Variables: Copy the example file to the root directory and fill in your actual credentials.
cp .env.example .env
-
Boot the entire stack! Run the following command at the root directory:
npm run dev
This single command will concurrently spin up the
dashboard-api(port 1234),public-api(port 1235), and the Viteweb-dashboard(port 5173).
To deploy this monorepo to production for free, you will deploy it as 3 separate cloud services.
This server exclusively manages Developer Accounts, API Keys, and Projects.
- Create a New Web Service on Render.com.
- Connect your GitHub repository.
- Apply the following crucial settings:
- Root Directory: (Leave completely Blank / Empty)
- Build Command:
npm install - Start Command:
cd apps/dashboard-api && node src/app.js
- Add all environment variables from your
.env(MongoDB, Redis, JWT Secrets etc). - Deploy and save the generated live URL.
This server handles Public Schema routing, Data Insertion, and File Storage for end-users.
- Create a Second Web Service on Render connected to the exact same repository.
- Apply the following settings:
- Root Directory: (Leave completely Blank / Empty)
- Build Command:
npm install - Start Command:
cd apps/public-api && node src/app.js
- Paste the exact same environment variables as Backend 1.
- Deploy and save the generated live URL.
This is the user interface developers use to interact with your SaaS.
- Import the repository on Vercel.
- Open "Edit" on the Root Directory setting and select:
apps/web-dashboard - Vercel will auto-detect the Vite framework.
- Under Environment Variables, add:
VITE_API_URL=<Your Dashboard API Render URL>
- Click Deploy. Vercel will automatically run
npm installat the root and build your dashboard.
If you prefer self-hosting on a VPS (like DigitalOcean, AWS EC2, or Hetzner), this repository includes battle-tested, multistage Dockerfiles and a root docker-compose.yml.
- Clone your repo onto your server.
- Ensure your
.envfile is placed exactly at the root directory. - Run the complete orchestration:
docker-compose up -d --build
This single command will automatically download the Node.js alpine images, run the workspace installations, and securely boot up MongoDB, Redis, the Dashboard API, and the Public API in perfectly isolated containers!