Skip to content
156 changes: 145 additions & 11 deletions apps/web-dashboard/src/pages/Templates.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useparticular folder cloning.

1. Clone the repository without downloading the files

git clone --no-checkout --depth 1 <repository_url> <destination_folder>

2. Enter the repository directory

cd <destination_folder>

3. Enable sparse-checkout in cone mode

git sparse-checkout init --cone

4. Specify the folder you want to clone

git sparse-checkout set <path/to/desired/folder>

5. Download the files

git checkout main

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
\`\`\`
Comment thread
coderabbitai[bot] marked this conversation as resolved.

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
`
},
{
Expand All @@ -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
\`\`\`
`
},
{
Expand All @@ -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
\`\`\`
Comment thread
coderabbitai[bot] marked this conversation as resolved.

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
\`\`\`
`
},
{
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/python-sdk-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 10 additions & 3 deletions examples/sdk-kanban/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
coderabbitai[bot] marked this conversation as resolved.
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).
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/sdk-kanban/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions examples/social-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Loading