diff --git a/apps/web-dashboard/src/pages/Templates.jsx b/apps/web-dashboard/src/pages/Templates.jsx index 965d7b3d4..6c632cffd 100644 --- a/apps/web-dashboard/src/pages/Templates.jsx +++ b/apps/web-dashboard/src/pages/Templates.jsx @@ -21,13 +21,39 @@ const TEMPLATES = [ A minimal React app demonstrating \`@urbackend/react\` components. ## Setup -1. Copy \`VITE_URBACKEND_PK\` from your project's API keys -2. Deploy with the button above or run locally: - \`\`\`bash - cd examples/react-sdk-demo - npm install - npm run dev - \`\`\` + +### Option 1: Full Clone +\`\`\`bash +git clone https://github.com/geturbackend/urBackend.git +cd urBackend/examples/react-sdk-demo +npm install +\`\`\` + +### Option 2: Sparse Checkout (Recommended) +Clone only this template folder without downloading the entire repository: +\`\`\`bash +# Clone repository without files +git clone --no-checkout --depth 1 https://github.com/geturbackend/urBackend.git react-sdk-demo +cd react-sdk-demo + +# Enable sparse-checkout +git sparse-checkout init --cone + +# Checkout only the react-sdk-demo template folder +git sparse-checkout set examples/react-sdk-demo + +# Download the files +git checkout main +\`\`\` + +After cloning, navigate to the template directory and install dependencies: +\`\`\`bash +cd examples/react-sdk-demo +npm install +\`\`\` + +1. Copy \`VITE_UR_PUBLIC_KEY\` from your project's API keys and place it in the client \`.env\` file +2. Run \`npm run dev\` to start the development server ` }, { @@ -47,10 +73,51 @@ A minimal React app demonstrating \`@urbackend/react\` components. A Kanban board app using \`@urbackend/sdk\` for data and auth. ## Setup + +### Option 1: Full Clone +\`\`\`bash +git clone https://github.com/geturbackend/urBackend.git +cd urBackend/examples/sdk-kanban +\`\`\` + +### Option 2: Sparse Checkout (Recommended) +Clone only this template folder without downloading the entire repository: +\`\`\`bash +# Clone repository without files +git clone --no-checkout --depth 1 https://github.com/geturbackend/urBackend.git sdk-kanban +cd sdk-kanban + +# Enable sparse-checkout +git sparse-checkout init --cone + +# Checkout only the kanban template folder +git sparse-checkout set examples/sdk-kanban + +# Download the files +git checkout main +\`\`\` + +After cloning, navigate to the template directory and set up the project: +\`\`\`bash +cd examples/sdk-kanban +\`\`\` + 1. Enable Auth in your urBackend project -2. Create \`boards\` and \`tasks\` collections with RLS -3. Copy \`VITE_URBACKEND_PK\` from your API keys -4. Deploy or run locally. +2. Create collections with RLS: + - \`boards\`: \`name\` (String, Required), \`ownerId\` (String, Required). Mode: \`private\`, ownerField: \`ownerId\` + - \`tasks\`: \`title\` (String, Required), \`description\` (String), \`status\` (String, Default: \`Todo\`), \`boardId\` (String, Required), \`ownerId\` (String, Required). Mode: \`private\`, ownerField: \`ownerId\` +3. Configure environment variables: + - Copy \`server/.env.example\` to \`server/.env\` and set \`URBACKEND_SECRET_KEY=sk_live_...\` + - Copy \`client/.env.example\` to \`client/.env\` and set \`VITE_URBACKEND_PK=pk_live_...\` + - Note: Vite-loaded environment changes require restarting the client server +4. Run the application: + \`\`\`bash + # Terminal 1: Start server + cd server && npm install && npm start + + # Terminal 2: Start client (from sdk-kanban folder) + cd client && npm install && npm run dev + \`\`\` ` }, { @@ -70,10 +137,49 @@ A Kanban board app using \`@urbackend/sdk\` for data and auth. A full Twitter/X.com clone built on urBackend. ## Setup + +### Option 1: Full Clone +\`\`\`bash +git clone https://github.com/geturbackend/urBackend.git +cd urBackend/examples/social-demo +\`\`\` + +### Option 2: Sparse Checkout (Recommended) +Clone only this template folder without downloading the entire repository: +\`\`\`bash +# Clone repository without files +git clone --no-checkout --depth 1 https://github.com/geturbackend/urBackend.git social-demo +cd social-demo + +# Enable sparse-checkout +git sparse-checkout init --cone + +# Checkout only the social-demo template folder +git sparse-checkout set examples/social-demo + +# Download the files +git checkout main +\`\`\` + +After cloning, navigate to the template directory and set up the project: +\`\`\`bash +cd examples/social-demo +\`\`\` + 1. Enable Auth with GitHub/Google social login 2. Create required collections: \`posts\`, \`profiles\`, \`comments\`, \`likes\`, \`follows\` 3. Configure RLS for each collection -4. Deploy or run locally. +4. Configure environment variables: + - Copy \`client/.env.example\` to \`client/.env\` and set \`VITE_PUBLIC_KEY=pk_live_...\` + - Copy \`server/.env.example\` to \`server/.env\` and set \`API_KEY=sk_live_...\` +5. Run the application: + \`\`\`bash + # Terminal 1: Start proxy server + cd server && npm install && npm start + + # Terminal 2: Start client + cd client && npm install && npm run dev + \`\`\` ` }, { @@ -93,8 +199,36 @@ A full Twitter/X.com clone built on urBackend. A CLI-based demo of the urbackend Python SDK. ## Setup + +### Option 1: Full Clone +\`\`\`bash +git clone https://github.com/geturbackend/urBackend.git +cd urBackend/examples/python-sdk-demo +\`\`\` + +### Option 2: Sparse Checkout (Recommended) +Clone only this template folder without downloading the entire repository: +\`\`\`bash +# Clone repository without files +git clone --no-checkout --depth 1 https://github.com/geturbackend/urBackend.git python-sdk-demo +cd python-sdk-demo + +# Enable sparse-checkout +git sparse-checkout init --cone + +# Checkout only the python-sdk-demo template folder +git sparse-checkout set examples/python-sdk-demo + +# Download the files +git checkout main +\`\`\` + +After cloning, navigate to the template directory and set up the project: \`\`\`bash cd examples/python-sdk-demo +\`\`\` + +\`\`\`bash pip install -r requirements.txt cp .env.example .env # Edit .env with your API keys diff --git a/examples/python-sdk-demo/README.md b/examples/python-sdk-demo/README.md index d178ac691..8e5dbe2f9 100644 --- a/examples/python-sdk-demo/README.md +++ b/examples/python-sdk-demo/README.md @@ -14,7 +14,7 @@ A minimal Python application demonstrating the `urbackend` Python SDK for databa ```bash # Clone the repo git clone https://github.com/geturbackend/urBackend.git -cd examples/python-sdk-demo +cd urBackend/examples/python-sdk-demo # Create virtual environment python -m venv venv diff --git a/examples/sdk-kanban/README.md b/examples/sdk-kanban/README.md index 144c95bc3..ec5ccfbb1 100644 --- a/examples/sdk-kanban/README.md +++ b/examples/sdk-kanban/README.md @@ -9,7 +9,14 @@ A modern Kanban Board application demonstrating the official `@urbackend/sdk`. ## 🚀 Getting Started -### 1. Dashboard Setup +### 1. Clone the Repository + +```bash +git clone https://github.com/geturbackend/urBackend.git +cd urBackend/examples/sdk-kanban +``` + +### 2. Dashboard Setup 1. **Enable Auth**: Go to 'Auth' in your urBackend project and toggle it on. 2. **Create Collections**: - `boards`: Add field `name` (String, Required) and `ownerId` (String, Required). @@ -18,7 +25,7 @@ A modern Kanban Board application demonstrating the official `@urbackend/sdk`. - `boards`: Set Mode to `private`, ownerField to `ownerId`. - `tasks`: Set Mode to `private`, ownerField to `ownerId`. -### 2. Environment Variables +### 3. Environment Variables #### Server (`server/.env`) ```env @@ -32,7 +39,7 @@ VITE_URBACKEND_PK=pk_live_... VITE_NOTIFY_SERVER_URL=http://localhost:4001 ``` -### 3. Installation & Run +### 4. Installation & Run ```bash # Terminal 1: Server diff --git a/examples/sdk-kanban/server/package.json b/examples/sdk-kanban/server/package.json index 99eed6d91..af8050306 100644 --- a/examples/sdk-kanban/server/package.json +++ b/examples/sdk-kanban/server/package.json @@ -9,7 +9,7 @@ "dev": "nodemon index.js" }, "dependencies": { - "@urbackend/sdk": "file:../../../sdks/urbackend-sdk", + "@urbackend/sdk": "0.4.2", "cors": "^2.8.5", "dotenv": "^16.4.5", "express": "^4.19.2" diff --git a/examples/social-demo/README.md b/examples/social-demo/README.md index 0305f1888..8e588e6b1 100644 --- a/examples/social-demo/README.md +++ b/examples/social-demo/README.md @@ -34,8 +34,8 @@ A **full-featured X.com (Twitter) clone** built entirely on the **urBackend** Ba ### 2. Installation ```bash # Clone the repository -git clone https://github.com/yash-pouranik/urBackend.git -cd examples/social-demo +git clone https://github.com/geturbackend/urBackend.git +cd urBackend/examples/social-demo # Install dependencies for both Client and Proxy Server cd client && npm install @@ -283,4 +283,4 @@ For each writable collection (`posts`, `comments`, `likes`, `follows`, `profiles --- Built with ❤️ by the **urBackend** Community. -[Discord](https://discord.gg/CXJjvJkNWn) | [Documentation](https://github.com/yash-pouranik/urBackend/tree/main/docs) +[Discord](https://discord.gg/CXJjvJkNWn) | [Documentation](https://github.com/geturbackend/urBackend/tree/main/docs)