|
| 1 | +# urBackend 🚀 |
| 2 | + |
| 3 | +urBackend is an instant **"Backend-as-a-Service" (BaaS)** platform designed for frontend developers. It empowers you to create projects, define database schemas, manage authentication, and handle file storage without writing a single line of backend code. |
| 4 | + |
| 5 | +Stop writing boilerplate. Get an instant Database, Authentication, and Storage API for your next big idea. |
| 6 | + |
| 7 | +## ✨ Features |
| 8 | + |
| 9 | +- **⚡ Instant NoSQL Database**: Create collections and push JSON data instantly. No server setup required. |
| 10 | +- **🛡️ Authentication**: Built-in User Management (Sign Up, Login, Profile) secured with JWT. |
| 11 | +- **📂 Cloud Storage**: Upload, manage, and delete files/images with public CDN links. |
| 12 | +- **📊 Real-time Analytics**: Monitor API usage, traffic, and storage limits via the dashboard. |
| 13 | +- **🛠️ Visual Schema Builder**: Define table columns (String, Number, Boolean, Date) through an intuitive UI. |
| 14 | +- **🔒 Security**: API Key-based access control and Row Level Security. |
| 15 | + |
| 16 | +## 🛠️ Tech Stack |
| 17 | + |
| 18 | +### Frontend |
| 19 | +- **React.js (Vite)** |
| 20 | +- React Router DOM |
| 21 | +- Axios |
| 22 | +- Lucide React (Icons) |
| 23 | +- Recharts (Analytics) |
| 24 | + |
| 25 | +### Backend |
| 26 | +- **Node.js & Express** |
| 27 | +- MongoDB (Mongoose) |
| 28 | +- JWT (JSON Web Tokens) |
| 29 | +- Multer (File Handling) |
| 30 | +- Supabase (Cloud Storage) |
| 31 | + |
| 32 | +## 🚀 Getting Started |
| 33 | + |
| 34 | +Follow these instructions to set up the project locally. |
| 35 | + |
| 36 | +### Prerequisites |
| 37 | +- Node.js (v18+) |
| 38 | +- MongoDB Atlas Connection URL |
| 39 | +- Supabase Account (for Storage) |
| 40 | + |
| 41 | +### 1. Backend Setup |
| 42 | + |
| 43 | +```bash |
| 44 | +cd backend |
| 45 | +npm install |
| 46 | +``` |
| 47 | + |
| 48 | +Create a `.env` file in the `backend` folder: |
| 49 | + |
| 50 | +```env |
| 51 | +PORT=1234 |
| 52 | +MONGO_URL=your_mongodb_connection_string |
| 53 | +JWT_SECRET=your_super_secret_key |
| 54 | +SUPABASE_URL=your_supabase_url |
| 55 | +SUPABASE_KEY=your_supabase_anon_key |
| 56 | +``` |
| 57 | + |
| 58 | +Start the server: |
| 59 | + |
| 60 | +```bash |
| 61 | +npm start |
| 62 | +# Server will run on http://localhost:1234 |
| 63 | +``` |
| 64 | + |
| 65 | +### 2. Frontend Setup |
| 66 | + |
| 67 | +```bash |
| 68 | +cd frontend |
| 69 | +npm install |
| 70 | +``` |
| 71 | + |
| 72 | +Update `frontend/src/config.js` (if necessary): |
| 73 | + |
| 74 | +```javascript |
| 75 | +export const API_URL = 'http://localhost:1234'; |
| 76 | +``` |
| 77 | + |
| 78 | +Start the client: |
| 79 | + |
| 80 | +```bash |
| 81 | +npm run dev |
| 82 | +# App will run on http://localhost:5173 |
| 83 | +``` |
| 84 | + |
| 85 | +## 📖 API Usage Guide |
| 86 | + |
| 87 | +Once your project is created in the dashboard, use your **Public API Key** to make requests. |
| 88 | + |
| 89 | +### 1. Database API |
| 90 | + |
| 91 | +**Insert Data:** |
| 92 | + |
| 93 | +```javascript |
| 94 | +await fetch('http://localhost:1234/api/data/products', { |
| 95 | + method: 'POST', |
| 96 | + headers: { |
| 97 | + 'Content-Type': 'application/json', |
| 98 | + 'x-api-key': 'YOUR_API_KEY' |
| 99 | + }, |
| 100 | + body: JSON.stringify({ |
| 101 | + name: "MacBook Pro", |
| 102 | + price: 1299, |
| 103 | + inStock: true |
| 104 | + }) |
| 105 | +}); |
| 106 | +``` |
| 107 | + |
| 108 | +**Fetch Data:** |
| 109 | + |
| 110 | +```javascript |
| 111 | +const res = await fetch('http://localhost:1234/api/data/products', { |
| 112 | + headers: { 'x-api-key': 'YOUR_API_KEY' } |
| 113 | +}); |
| 114 | +const data = await res.json(); |
| 115 | +``` |
| 116 | + |
| 117 | +### 2. Authentication API |
| 118 | + |
| 119 | +**Register User:** |
| 120 | + |
| 121 | +```javascript |
| 122 | +await fetch('http://localhost:1234/api/userAuth/signup', { |
| 123 | + method: 'POST', |
| 124 | + headers: { |
| 125 | + 'Content-Type': 'application/json', |
| 126 | + 'x-api-key': 'YOUR_API_KEY' |
| 127 | + }, |
| 128 | + body: JSON.stringify({ |
| 129 | + email: "user@example.com", |
| 130 | + password: "securePassword123" |
| 131 | + }) |
| 132 | +}); |
| 133 | +``` |
| 134 | + |
| 135 | +### 3. Storage API |
| 136 | + |
| 137 | +**Upload File:** |
| 138 | + |
| 139 | +```javascript |
| 140 | +const formData = new FormData(); |
| 141 | +formData.append('file', fileInput.files[0]); |
| 142 | + |
| 143 | +const res = await fetch('http://localhost:1234/api/storage/upload', { |
| 144 | + method: 'POST', |
| 145 | + headers: { 'x-api-key': 'YOUR_API_KEY' }, |
| 146 | + body: formData |
| 147 | +}); |
| 148 | +// Returns { url: "..." } |
| 149 | +``` |
| 150 | + |
| 151 | +## ⚠️ Limits & Quotas |
| 152 | + |
| 153 | +- **Rate Limit**: 100 requests / 15 mins per IP. |
| 154 | +- **Database Size**: Max 50MB per project. |
| 155 | +- **File Storage**: Max 100MB per project (5MB max per file). |
| 156 | + |
| 157 | +## 🤝 Contributing |
| 158 | + |
| 159 | +1. Fork the Repository |
| 160 | +2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) |
| 161 | +3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) |
| 162 | +4. Push to the Branch (`git push origin feature/AmazingFeature`) |
| 163 | +5. Open a Pull Request |
| 164 | + |
| 165 | +--- |
| 166 | + |
| 167 | +Built with ❤️ by **Yash Pouranik** |
0 commit comments