Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Deployment Guide

This guide will help you self-host your own instance of **urBackend** by deploying the backend and frontend to popular cloud platforms.

## 1. Deploying the Backend
You can deploy the `backend/` directory to platforms like **Render** or **Railway.app**.

### Prerequisites
- **MongoDB Atlas**: Create a free cluster and obtain your `MONGO_URI`.
- **Redis**: Use a service like [Upstash](https://upstash.com/) for a managed Redis instance.

### Steps
1. Connect your GitHub repository to Render/Railway.
2. Set the root directory to `backend/`.
3. Add the following **Environment Variables** in the platform's dashboard:
```bash
PORT=3000
MONGO_URI=your_mongodb_connection_string
REDIS_URL=your_redis_connection_url
JWT_SECRET=your_secure_random_string
# Add other variables from .env.example
```
4. Set the Start Command to: `npm start` (or `node index.js`).
5. Deploy and save the resulting URL (e.g., `https://your-backend.onrender.com`).
Comment on lines +6 to +24

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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== deployment directories referenced by DEPLOYMENT.md =="
fd '^backend$' -t d -H
fd '^frontend$' -t d -H

echo
echo "== package.json files and scripts =="
fd '^package\.json$' -H -E node_modules | while read -r file; do
  echo "--- $file ---"
  python - "$file" <<'PY'
import json, pathlib, sys
path = pathlib.Path(sys.argv[1])
data = json.loads(path.read_text())
print("name:", data.get("name"))
print("scripts:", json.dumps(data.get("scripts", {}), indent=2, sort_keys=True))
PY
done

echo
echo "== env example files =="
fd '^\.env(\.example)?$' -H

Repository: yash-pouranik/urBackend

Length of output: 591


Update the documented start command: the backend entry point is app.js, not index.js.

The deployment guide recommends node index.js as an alternative start command, but backend/package.json defines the start script as node app.js. Replace the suggested command to use npm start only, or if specifying the file directly, use node app.js instead of node index.js. The npm start approach is preferred and will work correctly.

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

In `@DEPLOYMENT.md` around lines 6 - 24, The documented start command is
incorrect: replace the alternative `node index.js` with the correct entrypoint
used by the backend (either rely on the existing npm start script defined in
package.json or explicitly use `node app.js`); update the DEPLOYMENT.md steps so
Step 4 only suggests `npm start` or, if naming the file, `node app.js` instead
of `node index.js` and ensure the text references app.js as the backend
entrypoint.


---

## 2. Deploying the Frontend
The `frontend/` directory is a Vite/React application, ideal for **Vercel** or **Render**.

### Steps
1. Import your repository into Vercel.
2. Set the Root Directory to `frontend/`.
Comment on lines +29 to +33

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.

⚠️ Potential issue | 🟡 Minor

Align the frontend platform wording with the actual steps.

This section says the frontend is suited for Vercel or Render, but the numbered instructions only cover Vercel. Either add the Render flow here or narrow the wording so users are not sent looking for steps that do not exist.

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

In `@DEPLOYMENT.md` around lines 29 - 33, The wording in DEPLOYMENT.md currently
states the frontend/ directory is ideal for "Vercel or Render" but the steps
only show a Vercel flow; update the text to make it consistent by either (A)
adding the Render deployment steps for the frontend/ Vite/React app (e.g.,
import repo, set root to frontend/, build/start settings) or (B) change the
sentence to only recommend Vercel if you intend to keep the existing numbered
steps—modify the line that references "frontend/" and "Vercel or Render"
accordingly so the guide and the steps match.

3. Set the Build Command to: `npm run build`.
4. Set the Output Directory to: `dist`.
5. **Required Environment Variables**:
- `VITE_API_BASE_URL`: Set this to the backend URL you generated in the previous step (e.g., `https://your-backend.onrender.com`).
6. Deploy the project.

---

## 💡 Tips
- Always keep your `.env` variables secure.
- For production, ensure you set up CORS settings in your backend to allow requests only from your deployed frontend domain.
46 changes: 2 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<a href="https://urbackend.bitbros.in"><strong>Dashboard</strong></a> ·
<a href="docs/introduction.md"><strong>Docs</strong></a> ·
<a href="docs/getting-started.md"><strong>Quick Start</strong></a> ·
<a href="DEPLOYMENT.md"><strong>Self-Hosting</strong></a> ·
<a href="https://discord.gg/CXJjvJkNWn"><strong>Discord</strong></a>
</p>

Expand Down Expand Up @@ -48,47 +49,4 @@ Go from zero to a live backend in **under 60 seconds**.

1. **Initialize**: Create a project on the [Dashboard](https://urbackend.bitbros.in).
2. **Model**: Visually define your collections and schemas.
3. **Execute**: Push and pull data immediately using your Instant API Key.

```javascript
// Power your UI with zero backend boilerplate
const res = await fetch('https://api.urbackend.bitbros.in/api/data/products', {
headers: { 'x-api-key': 'your_pk_live_key' }
});
```

---

## 🏗️ How it Works (The Visual Flow)

```mermaid
graph LR
A[1. Connect MongoDB] --> B[2. Define Collections]
B --> C[3. 🚀 Instant REST APIs]
C --> D[4. Scale & Monitor]
```

---

## 🏗️ Architecture

Explore our [Architecture Diagram](ARCHITECTURE_DIAGRAM.md) to understand the system design, core components, and data flow in detail.

---
## 🤝 Community

Join hundreds of developers building faster without the backend headaches.

- [GitHub Issues](https://github.com/yash-pouranik/urbackend/issues): Report bugs & request features.
- [Discord Channel](https://discord.gg/CXJjvJkNWn): Join the conversation.
- [Contributing](CONTRIBUTING.md): Help us grow the ecosystem.

---

## Contributors

<a href="https://github.com/yash-pouranik/urbackend/graphs/contributors">
<img src="https://contrib.rocks/image?repo=yash-pouranik/urbackend" />
</a>

Built with ❤️ by the **urBackend** community.
3. **Execute**: Push and pull data immediately using your

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.

⚠️ Potential issue | 🟠 Major

Restore the truncated README content.

Line 52 now ends mid-sentence, so the README renders as incomplete and drops the rest of the landing-page documentation. If the later sections were intentionally moved, please at least finish this step and add an explicit pointer to DEPLOYMENT.md instead of leaving the document cut off.

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

In `@README.md` at line 52, The third bullet in README (the line starting with "3.
**Execute**: Push and pull data immediately using your") was truncated; restore
the full sentence so the step reads completely (e.g., "3. **Execute**: Push and
pull data immediately using your preferred CLI or SDK to verify functionality.")
and, if deployment details were moved, append a clear pointer like "For
deployment instructions, see DEPLOYMENT.md" (or replace the rest of the
landing-page content with that pointer) to ensure the README no longer ends
mid-sentence and links readers to the moved documentation.