From 18c6f00cea5b97022d22496ba7db35c610142c87 Mon Sep 17 00:00:00 2001 From: Pangea 3 Date: Sun, 8 Mar 2026 16:31:27 +0000 Subject: [PATCH] fix: docs: add DEPLOYMENT.md and link in README (fixes #42) --- DEPLOYMENT.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 46 ++-------------------------------------------- 2 files changed, 46 insertions(+), 44 deletions(-) create mode 100644 DEPLOYMENT.md diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md new file mode 100644 index 000000000..b824847c5 --- /dev/null +++ b/DEPLOYMENT.md @@ -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`). + +--- + +## 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/`. +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. \ No newline at end of file diff --git a/README.md b/README.md index ad4aece66..725b3e41f 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Dashboard · Docs · Quick Start · + Self-Hosting · Discord

@@ -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 - - - - - -Built with ❤️ by the **urBackend** community. +3. **Execute**: Push and pull data immediately using your \ No newline at end of file