Skip to content

Commit 45667be

Browse files
Merge pull request #362 from Nitin-kumar-yadav1307/fix/template-clone-instructions
fix: update clone instructions and SDK dependencies for all examples
2 parents cbdb5f1 + ca8a587 commit 45667be

5 files changed

Lines changed: 160 additions & 19 deletions

File tree

apps/web-dashboard/src/pages/Templates.jsx

Lines changed: 145 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,39 @@ const TEMPLATES = [
2121
A minimal React app demonstrating \`@urbackend/react\` components.
2222
2323
## Setup
24-
1. Copy \`VITE_URBACKEND_PK\` from your project's API keys
25-
2. Deploy with the button above or run locally:
26-
\`\`\`bash
27-
cd examples/react-sdk-demo
28-
npm install
29-
npm run dev
30-
\`\`\`
24+
25+
### Option 1: Full Clone
26+
\`\`\`bash
27+
git clone https://github.com/geturbackend/urBackend.git
28+
cd urBackend/examples/react-sdk-demo
29+
npm install
30+
\`\`\`
31+
32+
### Option 2: Sparse Checkout (Recommended)
33+
Clone only this template folder without downloading the entire repository:
34+
\`\`\`bash
35+
# Clone repository without files
36+
git clone --no-checkout --depth 1 https://github.com/geturbackend/urBackend.git react-sdk-demo
37+
cd react-sdk-demo
38+
39+
# Enable sparse-checkout
40+
git sparse-checkout init --cone
41+
42+
# Checkout only the react-sdk-demo template folder
43+
git sparse-checkout set examples/react-sdk-demo
44+
45+
# Download the files
46+
git checkout main
47+
\`\`\`
48+
49+
After cloning, navigate to the template directory and install dependencies:
50+
\`\`\`bash
51+
cd examples/react-sdk-demo
52+
npm install
53+
\`\`\`
54+
55+
1. Copy \`VITE_UR_PUBLIC_KEY\` from your project's API keys and place it in the client \`.env\` file
56+
2. Run \`npm run dev\` to start the development server
3157
`
3258
},
3359
{
@@ -47,10 +73,51 @@ A minimal React app demonstrating \`@urbackend/react\` components.
4773
A Kanban board app using \`@urbackend/sdk\` for data and auth.
4874
4975
## Setup
76+
77+
### Option 1: Full Clone
78+
\`\`\`bash
79+
git clone https://github.com/geturbackend/urBackend.git
80+
cd urBackend/examples/sdk-kanban
81+
\`\`\`
82+
83+
### Option 2: Sparse Checkout (Recommended)
84+
Clone only this template folder without downloading the entire repository:
85+
\`\`\`bash
86+
# Clone repository without files
87+
git clone --no-checkout --depth 1 https://github.com/geturbackend/urBackend.git sdk-kanban
88+
cd sdk-kanban
89+
90+
# Enable sparse-checkout
91+
git sparse-checkout init --cone
92+
93+
# Checkout only the kanban template folder
94+
git sparse-checkout set examples/sdk-kanban
95+
96+
# Download the files
97+
git checkout main
98+
\`\`\`
99+
100+
After cloning, navigate to the template directory and set up the project:
101+
\`\`\`bash
102+
cd examples/sdk-kanban
103+
\`\`\`
104+
50105
1. Enable Auth in your urBackend project
51-
2. Create \`boards\` and \`tasks\` collections with RLS
52-
3. Copy \`VITE_URBACKEND_PK\` from your API keys
53-
4. Deploy or run locally.
106+
2. Create collections with RLS:
107+
- \`boards\`: \`name\` (String, Required), \`ownerId\` (String, Required). Mode: \`private\`, ownerField: \`ownerId\`
108+
- \`tasks\`: \`title\` (String, Required), \`description\` (String), \`status\` (String, Default: \`Todo\`), \`boardId\` (String, Required), \`ownerId\` (String, Required). Mode: \`private\`, ownerField: \`ownerId\`
109+
3. Configure environment variables:
110+
- Copy \`server/.env.example\` to \`server/.env\` and set \`URBACKEND_SECRET_KEY=sk_live_...\`
111+
- Copy \`client/.env.example\` to \`client/.env\` and set \`VITE_URBACKEND_PK=pk_live_...\`
112+
- Note: Vite-loaded environment changes require restarting the client server
113+
4. Run the application:
114+
\`\`\`bash
115+
# Terminal 1: Start server
116+
cd server && npm install && npm start
117+
118+
# Terminal 2: Start client (from sdk-kanban folder)
119+
cd client && npm install && npm run dev
120+
\`\`\`
54121
`
55122
},
56123
{
@@ -70,10 +137,49 @@ A Kanban board app using \`@urbackend/sdk\` for data and auth.
70137
A full Twitter/X.com clone built on urBackend.
71138
72139
## Setup
140+
141+
### Option 1: Full Clone
142+
\`\`\`bash
143+
git clone https://github.com/geturbackend/urBackend.git
144+
cd urBackend/examples/social-demo
145+
\`\`\`
146+
147+
### Option 2: Sparse Checkout (Recommended)
148+
Clone only this template folder without downloading the entire repository:
149+
\`\`\`bash
150+
# Clone repository without files
151+
git clone --no-checkout --depth 1 https://github.com/geturbackend/urBackend.git social-demo
152+
cd social-demo
153+
154+
# Enable sparse-checkout
155+
git sparse-checkout init --cone
156+
157+
# Checkout only the social-demo template folder
158+
git sparse-checkout set examples/social-demo
159+
160+
# Download the files
161+
git checkout main
162+
\`\`\`
163+
164+
After cloning, navigate to the template directory and set up the project:
165+
\`\`\`bash
166+
cd examples/social-demo
167+
\`\`\`
168+
73169
1. Enable Auth with GitHub/Google social login
74170
2. Create required collections: \`posts\`, \`profiles\`, \`comments\`, \`likes\`, \`follows\`
75171
3. Configure RLS for each collection
76-
4. Deploy or run locally.
172+
4. Configure environment variables:
173+
- Copy \`client/.env.example\` to \`client/.env\` and set \`VITE_PUBLIC_KEY=pk_live_...\`
174+
- Copy \`server/.env.example\` to \`server/.env\` and set \`API_KEY=sk_live_...\`
175+
5. Run the application:
176+
\`\`\`bash
177+
# Terminal 1: Start proxy server
178+
cd server && npm install && npm start
179+
180+
# Terminal 2: Start client
181+
cd client && npm install && npm run dev
182+
\`\`\`
77183
`
78184
},
79185
{
@@ -93,8 +199,36 @@ A full Twitter/X.com clone built on urBackend.
93199
A CLI-based demo of the urbackend Python SDK.
94200
95201
## Setup
202+
203+
### Option 1: Full Clone
204+
\`\`\`bash
205+
git clone https://github.com/geturbackend/urBackend.git
206+
cd urBackend/examples/python-sdk-demo
207+
\`\`\`
208+
209+
### Option 2: Sparse Checkout (Recommended)
210+
Clone only this template folder without downloading the entire repository:
211+
\`\`\`bash
212+
# Clone repository without files
213+
git clone --no-checkout --depth 1 https://github.com/geturbackend/urBackend.git python-sdk-demo
214+
cd python-sdk-demo
215+
216+
# Enable sparse-checkout
217+
git sparse-checkout init --cone
218+
219+
# Checkout only the python-sdk-demo template folder
220+
git sparse-checkout set examples/python-sdk-demo
221+
222+
# Download the files
223+
git checkout main
224+
\`\`\`
225+
226+
After cloning, navigate to the template directory and set up the project:
96227
\`\`\`bash
97228
cd examples/python-sdk-demo
229+
\`\`\`
230+
231+
\`\`\`bash
98232
pip install -r requirements.txt
99233
cp .env.example .env
100234
# Edit .env with your API keys

examples/python-sdk-demo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ A minimal Python application demonstrating the `urbackend` Python SDK for databa
1414
```bash
1515
# Clone the repo
1616
git clone https://github.com/geturbackend/urBackend.git
17-
cd examples/python-sdk-demo
17+
cd urBackend/examples/python-sdk-demo
1818

1919
# Create virtual environment
2020
python -m venv venv

examples/sdk-kanban/README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ A modern Kanban Board application demonstrating the official `@urbackend/sdk`.
99

1010
## 🚀 Getting Started
1111

12-
### 1. Dashboard Setup
12+
### 1. Clone the Repository
13+
14+
```bash
15+
git clone https://github.com/geturbackend/urBackend.git
16+
cd urBackend/examples/sdk-kanban
17+
```
18+
19+
### 2. Dashboard Setup
1320
1. **Enable Auth**: Go to 'Auth' in your urBackend project and toggle it on.
1421
2. **Create Collections**:
1522
- `boards`: Add field `name` (String, Required) and `ownerId` (String, Required).
@@ -18,7 +25,7 @@ A modern Kanban Board application demonstrating the official `@urbackend/sdk`.
1825
- `boards`: Set Mode to `private`, ownerField to `ownerId`.
1926
- `tasks`: Set Mode to `private`, ownerField to `ownerId`.
2027

21-
### 2. Environment Variables
28+
### 3. Environment Variables
2229

2330
#### Server (`server/.env`)
2431
```env
@@ -32,7 +39,7 @@ VITE_URBACKEND_PK=pk_live_...
3239
VITE_NOTIFY_SERVER_URL=http://localhost:4001
3340
```
3441

35-
### 3. Installation & Run
42+
### 4. Installation & Run
3643

3744
```bash
3845
# Terminal 1: Server

examples/sdk-kanban/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dev": "nodemon index.js"
1010
},
1111
"dependencies": {
12-
"@urbackend/sdk": "file:../../../sdks/urbackend-sdk",
12+
"@urbackend/sdk": "0.4.2",
1313
"cors": "^2.8.5",
1414
"dotenv": "^16.4.5",
1515
"express": "^4.19.2"

examples/social-demo/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ A **full-featured X.com (Twitter) clone** built entirely on the **urBackend** Ba
3434
### 2. Installation
3535
```bash
3636
# Clone the repository
37-
git clone https://github.com/yash-pouranik/urBackend.git
38-
cd examples/social-demo
37+
git clone https://github.com/geturbackend/urBackend.git
38+
cd urBackend/examples/social-demo
3939

4040
# Install dependencies for both Client and Proxy Server
4141
cd client && npm install
@@ -283,4 +283,4 @@ For each writable collection (`posts`, `comments`, `likes`, `follows`, `profiles
283283
---
284284

285285
Built with ❤️ by the **urBackend** Community.
286-
[Discord](https://discord.gg/CXJjvJkNWn) | [Documentation](https://github.com/yash-pouranik/urBackend/tree/main/docs)
286+
[Discord](https://discord.gg/CXJjvJkNWn) | [Documentation](https://github.com/geturbackend/urBackend/tree/main/docs)

0 commit comments

Comments
 (0)