feat(devex): add project templates, Python SDK demo, quickstart scrip… - #359
Conversation
|
Warning Review limit reached
Next review available in: 21 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (7)
📝 WalkthroughWalkthroughAdds a protected Templates dashboard page with navigation, filtering, README previews, deployment/source actions, and quickstart copying. Adds Python and TypeScript SDK demos, scaffolding scripts, documentation, Vercel metadata, React auth updates, and CI workflows. ChangesTemplates dashboard
Python SDK example
SDK scaffolding and delivery
Estimated code review effort: 4 (Complex) | ~45 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 13
🧹 Nitpick comments (5)
apps/web-dashboard/src/pages/Templates.jsx (1)
120-120: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winQuickstart command strings are duplicated across six locations.
The TypeScript and Python curl commands are hardcoded independently in the
readmefields (120, 141), insidecopyQuickstart(168-169), and again as literal strings in the Quickstart section (363-364, 376-377). Any change to the script path or hosting URL requires updating all of them in sync.const QUICKSTART_COMMANDS = { TypeScript: 'bash <(curl -fsSL https://raw.githubusercontent.com/geturbackend/urBackend/main/examples/quickstart-scripts/setup-ts-sdk.sh)', Python: 'bash <(curl -fsSL https://raw.githubusercontent.com/geturbackend/urBackend/main/examples/quickstart-scripts/setup-python-sdk.sh)', };Reference
QUICKSTART_COMMANDS.Python/.TypeScriptfromcopyQuickstart, the two inline buttons, and interpolate into thereadmetemplates.Also applies to: 141-141, 166-169, 363-364, 376-377
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web-dashboard/src/pages/Templates.jsx` at line 120, Define a shared QUICKSTART_COMMANDS constant for the TypeScript and Python setup commands, then replace every duplicated literal in the readme templates, copyQuickstart, and inline Quickstart buttons with the corresponding QUICKSTART_COMMANDS.TypeScript or QUICKSTART_COMMANDS.Python reference. Keep the generated command text unchanged.examples/DEVEX.md (1)
151-172: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSpecify the language for the file-tree fence.
markdownlintreports MD040 here; use```textfor this non-language source block.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@examples/DEVEX.md` around lines 151 - 172, Update the file-tree code fence in DEVEX.md to declare the text language, changing the opening fence to ```text while preserving the directory tree content unchanged.Source: Linters/SAST tools
examples/vercel.json (1)
5-7: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winDo not install dependencies twice.
Vercel already runs
installCommandbeforebuildCommand; removenpm installfrom each build command and leave only the project build. (vercel.com)Proposed fix
- "buildCommand": "cd examples/react-sdk-demo && npm install && npm run build", + "buildCommand": "cd examples/react-sdk-demo && npm run build",Apply the same change to the Kanban and social demo entries.
Also applies to: 11-13, 17-19
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@examples/vercel.json` around lines 5 - 7, Remove the redundant npm install step from the buildCommand entries in the Vercel configuration, including the React SDK, Kanban, and social demo entries. Keep each command’s directory change and npm run build invocation unchanged, while leaving the separate installCommand entries intact.Source: MCP tools
.github/workflows/examples.yml (2)
71-74: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMake the Python CI environment reproducible.
requirements.txtuses open-ended lower bounds such asurbackend>=0.1.0andpytest>=7.0.0, so future releases can change or break this job unexpectedly. Use a lock/constraints file or bounded versions refreshed intentionally.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/examples.yml around lines 71 - 74, Update the Python CI steps in the workflow around the requirements installation and pytest command to use a committed lock or constraints file with bounded, intentionally refreshed dependency versions. Ensure both installation and test execution use the reproducible dependency set while preserving the existing test command.
3-13: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winInclude the workflow file in its own path filters.
A change limited to
.github/workflows/examples.ymlwill not run this workflow because onlyexamples/**andsdks/**are listed. Add the workflow path to bothpush.pathsandpull_request.paths. (docs.github.com)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/examples.yml around lines 3 - 13, Update the workflow path filters in examples.yml by adding .github/workflows/examples.yml to both push.paths and pull_request.paths, preserving the existing examples/** and sdks/** entries.Source: MCP tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/examples.yml:
- Around line 1-3: Update the Examples CI workflow to grant only read access to
repository contents and disable persisted credentials on every actions/checkout
step. Include .github/workflows/examples.yml in the relevant paths filters so
workflow changes trigger CI, and replace lower-bound Python dependency
requirements with exact pinned versions for reproducibility.
In `@apps/web-dashboard/src/pages/Templates.jsx`:
- Around line 166-172: Handle the Promise returned by
navigator.clipboard.writeText in copyQuickstart and both inline Quickstart Copy
button handlers: show the success toast only after the write resolves, show
appropriate failure feedback when it rejects or is unavailable, and add
equivalent success/failure handling to the inline buttons while preserving their
existing commands.
- Around line 220-231: The template card’s expand/collapse control is mouse-only
because the clickable div lacks keyboard semantics. Update the card div around
the expandedId onClick to expose an appropriate interactive role, make it
keyboard focusable, and handle Enter and Space key presses by toggling
expandedId while preserving the existing click behavior.
In `@examples/DEVEX.md`:
- Around line 41-49: Update the TypeScript and Python quickstart commands in the
DEVEX documentation to reference an approved immutable commit or release tag
instead of the mutable main branch; preferably add checksum verification before
executing the downloaded scripts.
In `@examples/python-sdk-demo/main.py`:
- Around line 12-13: Update the type annotation in the demo’s Python entry point
to use Optional[dict] instead of dict | None, and add or reuse the appropriate
Optional import so the file remains compatible with Python 3.9.
- Around line 168-187: Update the storage demo cleanup around the upload result
and finally block: retain the uploaded object path from result["path"], then
call client.storage.delete_file with that path during cleanup. Guard deletion
when no upload succeeded, while preserving the existing local test-file removal.
In `@examples/python-sdk-demo/tests/test_demo.py`:
- Around line 14-28: Remove the module-level sys.modules["urbackend"] override
from the test setup, since these tests do not require it; if mocking the import
remains necessary, apply the override through pytest’s monkeypatch fixture so it
is automatically restored after each test.
In `@examples/quickstart-scripts/setup-python-sdk.sh`:
- Around line 60-62: Remove the unused SECRET_KEY and PROJECT_ID prompts and
generated .env entries from examples/quickstart-scripts/setup-python-sdk.sh and
examples/quickstart-scripts/setup-ts-sdk.sh at lines 60-62, leaving only
publishable credentials in these client scaffolds.
- Around line 39-43: Update the Python version validation in the setup script to
parse and compare both major and minor versions, rejecting Python versions below
3.9 while preserving acceptance of Python 3.9 and newer and the existing
error/exit behavior.
- Line 127: Update the UrBackendClient construction in the generated Python SDK
setup to pass API_URL through the supported base parameter instead of base_url,
ensuring main.py constructs the client without a TypeError.
In `@examples/quickstart-scripts/setup-ts-sdk.sh`:
- Around line 39-43: Update the Node.js version check in setup-ts-sdk.sh to
require Node 20 or newer, matching the global File constructor used by the
storage demo's new File(...) calls. Keep the existing version parsing and
unsupported-version exit behavior unchanged.
- Around line 89-97: Add dotenv to the generated package.json dependencies
alongside `@urbackend/sdk` in the setup script, ensuring the generated
src/index.ts import resolves after npm install and the build succeeds.
In `@examples/vercel.json`:
- Around line 2-3: Replace the unsupported top-level deploy object in
vercel.json with supported per-application Vercel configuration, or move each
demo’s project and root-directory settings into its Deploy Button URL
parameters. Ensure all three demos remain independently configurable and
deployable.
---
Nitpick comments:
In @.github/workflows/examples.yml:
- Around line 71-74: Update the Python CI steps in the workflow around the
requirements installation and pytest command to use a committed lock or
constraints file with bounded, intentionally refreshed dependency versions.
Ensure both installation and test execution use the reproducible dependency set
while preserving the existing test command.
- Around line 3-13: Update the workflow path filters in examples.yml by adding
.github/workflows/examples.yml to both push.paths and pull_request.paths,
preserving the existing examples/** and sdks/** entries.
In `@apps/web-dashboard/src/pages/Templates.jsx`:
- Line 120: Define a shared QUICKSTART_COMMANDS constant for the TypeScript and
Python setup commands, then replace every duplicated literal in the readme
templates, copyQuickstart, and inline Quickstart buttons with the corresponding
QUICKSTART_COMMANDS.TypeScript or QUICKSTART_COMMANDS.Python reference. Keep the
generated command text unchanged.
In `@examples/DEVEX.md`:
- Around line 151-172: Update the file-tree code fence in DEVEX.md to declare
the text language, changing the opening fence to ```text while preserving the
directory tree content unchanged.
In `@examples/vercel.json`:
- Around line 5-7: Remove the redundant npm install step from the buildCommand
entries in the Vercel configuration, including the React SDK, Kanban, and social
demo entries. Keep each command’s directory change and npm run build invocation
unchanged, while leaving the separate installCommand entries intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8127816c-d15f-4708-a7c9-3a753bf1125d
📒 Files selected for processing (14)
.github/workflows/examples.ymlapps/web-dashboard/src/App.jsxapps/web-dashboard/src/components/Layout/Sidebar.jsxapps/web-dashboard/src/pages/Templates.jsxexamples/DEVEX.mdexamples/python-sdk-demo/.env.exampleexamples/python-sdk-demo/README.mdexamples/python-sdk-demo/main.pyexamples/python-sdk-demo/requirements.txtexamples/python-sdk-demo/tests/__init__.pyexamples/python-sdk-demo/tests/test_demo.pyexamples/quickstart-scripts/setup-python-sdk.shexamples/quickstart-scripts/setup-ts-sdk.shexamples/vercel.json
…ts, and Vercel deploy config - Add Templates page (/templates) to web dashboard with 6 project templates (React SDK Demo, Kanban Board, Social Media Clone, Python SDK Demo, TypeScript Quickstart, Python Quickstart) - Add sidebar navigation link for Templates - Create Python SDK demo project with full auth, CRUD, storage, mail demos and unit tests (6/6 passing with mocks) - Add interactive quickstart scripts for TypeScript and Python SDK scaffolding - Configure Vercel deployment for all frontend examples - Add CI workflow for example projects - Add comprehensive DevEx documentation (examples/DEVEX.md)
8f3bf73 to
7f96d1b
Compare
…iders, theme, onSuccess)
1. CI: add permissions: contents: read, persist-credentials: false, include workflow in paths, pin Python deps 2. DEVEX.md: use immutable release tag + checksum verification for quickstart scripts 3. main.py: use Optional[dict] instead of dict | None for Python 3.9 compat 4. Quickstart scripts: remove SECRET_KEY/PROJECT_ID from client scaffolds, keep only publishable credentials 5. Python quickstart: fix base_url -> base parameter for UrBackendClient
1. setup-ts-sdk.sh: require Node.js 20+ (needed for global File constructor) 2. vercel.json: replace unsupported top-level deploy object with per-app config reference, each demo keeps its own vercel.json
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (1)
.github/workflows/examples.yml (1)
84-86: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider installing from
requirements.txtinstead of duplicating pins.
urbackend==0.1.1 python-dotenv==1.2.2 pytest==9.1.1duplicates whateverexamples/python-sdk-demo/requirements.txtdeclares. If the two drift, CI could pass/fail inconsistently with localpip install -r requirements.txtruns.- run: | python -m pip install --upgrade pip - pip install urbackend==0.1.1 python-dotenv==1.2.2 pytest==9.1.1 + pip install -r requirements.txt🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/examples.yml around lines 84 - 86, Update the dependency installation step in the workflow to install from examples/python-sdk-demo/requirements.txt instead of duplicating the urbackend, python-dotenv, and pytest pins, while preserving the existing pip upgrade command.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/examples.yml:
- Around line 84-88: Remove the stray </write_to_file></tool_call> artifact from
.github/workflows/examples.yml at lines 84-88 after the pytest step, and from
examples/vercel.json at lines 1-5 after the closing JSON object; make no other
changes so both files remain valid YAML and JSON.
In `@apps/web-dashboard/src/pages/Templates.jsx`:
- Line 115: Fix the invalid Vercel deploy links by removing them or updating
them to actual deployable project paths: update the deployUrl entry in
Templates.jsx, and the corresponding link in setup-python-sdk.sh. Ensure neither
link references the nonexistent examples/quickstart-ts or
examples/quickstart-python directories.
In `@examples/DEVEX.md`:
- Around line 43-54: Replace the placeholder a1b2c3d4e5f6 values in both
TypeScript and Python quickstart commands with the actual SHA-256 digests of
their pinned setup-ts-sdk.sh and setup-python-sdk.sh release artifacts, and
update the verification commands to use sha256sum while preserving checksum
validation before execution.
In `@examples/quickstart-scripts/setup-ts-sdk.sh`:
- Around line 87-96: Remove the backticks surrounding the `@urbackend/sdk` and
`@types/node` dependency keys in the package.json heredoc within setup-ts-sdk.sh,
or otherwise quote the heredoc delimiter to prevent command substitution.
Preserve the generated package.json dependency names exactly so installation and
the generated src/index.ts import work correctly.
- Around line 13-16: Update the prerequisites comment in setup-ts-sdk.sh to
state Node.js 20+ so it matches the version enforced by the script and required
by its later File usage.
- Around line 156-161: Remove the invalid client.setToken(token) call from the
login flow after client.auth.login; rely on login’s existing session storage, or
use the valid client.auth.setToken API only if manual token assignment is
required.
---
Nitpick comments:
In @.github/workflows/examples.yml:
- Around line 84-86: Update the dependency installation step in the workflow to
install from examples/python-sdk-demo/requirements.txt instead of duplicating
the urbackend, python-dotenv, and pytest pins, while preserving the existing pip
upgrade command.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 776d8753-aa78-4673-86da-13dc1acca8d5
📒 Files selected for processing (15)
.github/workflows/examples.ymlapps/web-dashboard/src/App.jsxapps/web-dashboard/src/components/Layout/Sidebar.jsxapps/web-dashboard/src/pages/Templates.jsxexamples/DEVEX.mdexamples/python-sdk-demo/.env.exampleexamples/python-sdk-demo/README.mdexamples/python-sdk-demo/main.pyexamples/python-sdk-demo/requirements.txtexamples/python-sdk-demo/tests/__init__.pyexamples/python-sdk-demo/tests/test_demo.pyexamples/quickstart-scripts/setup-python-sdk.shexamples/quickstart-scripts/setup-ts-sdk.shexamples/react-sdk-demo/src/App.tsxexamples/vercel.json
🚧 Files skipped from review as they are similar to previous changes (5)
- examples/python-sdk-demo/README.md
- examples/python-sdk-demo/requirements.txt
- apps/web-dashboard/src/App.jsx
- apps/web-dashboard/src/components/Layout/Sidebar.jsx
- examples/python-sdk-demo/tests/test_demo.py
…ses, storage cleanup, test mocks 1. setup-ts-sdk.sh: require Node.js 20+ for global File constructor 2. Templates.jsx: fix invalid deployUrl for quickstart-ts, add Promise handling to copy buttons, card keyboard support already present 3. examples.yml: remove stray </write_to_file> artifact 4. DEVEX.md: replace placeholder checksums with actual SHA-256 digests 5. main.py: add remote file cleanup after storage upload 6. test_demo.py: remove module-level sys.modules override, use setup_method
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@examples/python-sdk-demo/main.py`:
- Line 167: Initialize uploaded_path immediately after test_file_path and before
the first fallible file-creation or write operation, while preserving the
existing finally cleanup logic that uses uploaded_path.
In `@examples/python-sdk-demo/tests/test_demo.py`:
- Line 120: Remove the stray non-Python token immediately after the final
assertion in test_demo.py so the module parses successfully and pytest can
collect it; leave the assertion and surrounding test logic unchanged.
- Around line 38-77: Update the auth demo and its tests to use the AuthModule
API method sign_up instead of signup. Replace the signup references in demo_auth
and the related mock setup, side effects, and assertions in test_demo.py while
preserving the existing success, fallback, and failure behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 33aa168e-66a3-4a35-b63d-948e8de671a6
📒 Files selected for processing (6)
.github/workflows/examples.ymlapps/web-dashboard/src/pages/Templates.jsxexamples/DEVEX.mdexamples/python-sdk-demo/main.pyexamples/python-sdk-demo/tests/test_demo.pyexamples/quickstart-scripts/setup-ts-sdk.sh
🚧 Files skipped from review as they are similar to previous changes (4)
- .github/workflows/examples.yml
- apps/web-dashboard/src/pages/Templates.jsx
- examples/quickstart-scripts/setup-ts-sdk.sh
- examples/DEVEX.md
- @urbackend/sdk@0.4.5 has broken exports, 0.4.2 works correctly - urbackend Python package only has 0.1.0 on PyPI, not 0.1.1
- Python SDK uses sign_up method name, not signup - Updated all mock setups, side effects, and assertions - Removed stray XML token from test_demo.py
- react-sdk-demo package-lock uses file: references to local SDKs - Add build steps for sdks/urbackend-sdk and sdks/urbackend-react
- Pin @urbackend/sdk to 0.4.2 in all examples - Pin @urbackend/react to 0.1.0 in react-sdk-demo - Remove local file: references that require building SDKs first - Update CI to build from root with workspace flags
- npm workspaces must be defined in root package.json - examples are not in the workspaces array - Use defaults.run.working-directory instead
|
How user is able to use the templates from the UI? @coderabbitai |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
ast-grep outline apps/web-dashboard/src/pages/Templates.jsx --items all --view expanded
printf '\n--- action and template references ---\n'
rg -n -C 3 'deployUrl|repoUrl|copyCommand|Copy Command|Deploy to Vercel|README|Quickstart from Terminal|handleCopy' apps/web-dashboard/src/pages/Templates.jsxLength of output: 5491 The Comment image shows the dark Templates dashboard: users can search with “Search templates…”, filter by All SDKs,
The Python SDK Demo is source-based only at the moment—there is no Vercel deploy action configured for it. |
|
everything LGTM Those examples are in monorepo, So there should me commands attached to clone that particular project folder only? Else LGTM what say? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
ast-grep outline apps/web-dashboard/src/pages/Templates.jsx --items all --view expanded
printf '\n--- template action definitions ---\n'
rg -n -C 4 'repoUrl|deployUrl|copyCommand|View Source|Copy Command|Quickstart from Terminal' \
apps/web-dashboard/src/pages/Templates.jsx
printf '\n--- workspace and example manifests ---\n'
for file in package.json; do
if [ -f "$file" ]; then
printf '\n### %s\n' "$file"
sed -n '1,220p' "$file"
fi
done
fd -a -HI '^package\.json$|^requirements\.txt$|^README\.md$' examples -x sh -c '
printf "\n### %s\n" "$1"
sed -n "1,100p" "$1"
' sh {} \;Length of output: 23871 The Comment image shows the @yash-pouranik, the shell results confirm your point—and uncover a couple of concrete docs issues:
For standalone examples, a generated command can use sparse checkout: git clone --depth 1 --filter=blob:none --sparse https://github.com/geturbackend/urBackend.git urbackend-react-demo
cd urbackend-react-demo
git sparse-checkout set examples/react-sdk-demo
cd examples/react-sdk-demo
npm install && npm run devFor Kanban, either include both directories: git sparse-checkout set examples/sdk-kanban sdks/urbackend-sdk—or, preferably for a user-facing template, replace the local So I would revise my earlier LGTM: the template gallery itself is good, but the local-use docs/actions need these fixes for the advertised “View Source → run locally” workflow to be reliable. |
|
So list what needs to be updated. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- Templates action definitions ---'
ast-grep outline apps/web-dashboard/src/pages/Templates.jsx --items all --view expanded
rg -n -C 4 'repoUrl|deployUrl|copyCommand|View Source|Copy Command|Quickstart from Terminal' \
apps/web-dashboard/src/pages/Templates.jsx
printf '%s\n' '--- Example setup documentation and repository references ---'
fd -a -HI '^(README\.md|DEVEX\.md|package\.json|requirements\.txt)$' examples -x sh -c '
file="$1"
matches=$(rg -n -i -C 3 "git clone|sparse-checkout|github\.com/.*/urBackend|npm (install|run)|pip install|cd examples" "$file" || true)
if [ -n "$matches" ]; then
printf "\n### %s\n%s\n" "$file" "$matches"
fi
' sh {}
printf '%s\n' '--- Local workspace dependencies used by example manifests ---'
rg -n -C 3 '"file:|workspace:' examples -g 'package.json'
printf '%s\n' '--- Existing related GitHub issues ---'
gh issue list --repo geturbackend/urBackend --state open --limit 100 \
--search 'template OR templates OR sparse checkout OR quickstart' \
--json number,title,url,body \
--jq '.[] | {number, title, url, body}'Length of output: 9589 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="geturbackend/urBackend"
pr_number="359"
comment_url=$(
gh api "repos/${repo}/issues/${pr_number}/comments" \
--paginate \
--jq '.[] | select(.user.login == "yash-pouranik" and (.body | contains("So list what needs to be updated."))) | .html_url' \
| tail -n 1
)
if [ -z "${comment_url}" ]; then
echo "Could not find the originating PR comment permalink." >&2
exit 1
fi
issue_body=$(cat <<EOF
## Summary
Make the source-based template workflow in the \`/templates\` dashboard reliable for a monorepo. The current **View Source** action is useful for discovery, but the README/setup flow does not consistently let a user fetch and run the selected example.
## Required changes
- Add a template-specific local setup flow (for example, a **Copy setup command** action and/or matching expanded README instructions) for the React SDK Demo, Social Media demo, Python SDK Demo, and Kanban Board.
- Standalone examples may use a sparse checkout command.
- Instructions must include the actual cloned repository directory before changing into the example directory.
- Correct \`examples/python-sdk-demo/README.md\`:
- After cloning \`https://github.com/geturbackend/urBackend.git\`, change into the cloned repository directory before \`examples/python-sdk-demo\`.
- Correct \`examples/social-demo/README.md\`:
- Use the canonical \`https://github.com/geturbackend/urBackend.git\` repository URL.
- Correct the \`cd\` path to include the cloned repository directory.
- Update the documentation link to the canonical repository.
- Resolve/document Kanban’s non-standalone dependency:
- \`examples/sdk-kanban/server/package.json\` declares \`@urbackend/sdk\` as \`file:../../../sdks/urbackend-sdk\`.
- Either make the setup command sparse-check out both \`examples/sdk-kanban\` and \`sdks/urbackend-sdk\`, or replace the local file dependency with an appropriate published SDK version.
- Keep the dashboard metadata in \`apps/web-dashboard/src/pages/Templates.jsx\`, the expanded README content, and each example README consistent.
## Affected areas
- \`apps/web-dashboard/src/pages/Templates.jsx\`
- \`examples/python-sdk-demo/README.md\`
- \`examples/social-demo/README.md\`
- \`examples/sdk-kanban/README.md\`
- \`examples/sdk-kanban/server/package.json\`
## Acceptance criteria
- A user can follow the UI-provided or README-provided instructions to obtain and start each advertised source-based template without guessing paths.
- All clone and documentation links use \`geturbackend/urBackend\`.
- Python and Social setup commands work from a clean shell after cloning.
- Kanban setup succeeds with its SDK dependency available, or no longer relies on a repository-local SDK path.
- The template cards and their linked documentation describe the same supported workflow.
## Backlinks
- PR: https://github.com/geturbackend/urBackend/pull/359
- Originating review discussion: ${comment_url}
- Requested by: `@yash-pouranik`
EOF
)
issue_url=$(gh issue create \
--repo "$repo" \
--title "Provide reliable local setup flows for monorepo templates" \
--body "$issue_body" \
--assignee "yash-pouranik")
printf 'Created follow-up issue: %s\n' "$issue_url"Length of output: 3444 The Comment image shows the
It covers:
I assigned it to you because Nitin’s GitHub username was not provided; you can reassign it to him. These are non-blocking DevEx follow-ups, so this PR looks good from this concern. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- template actions ---'
ast-grep outline apps/web-dashboard/src/pages/Templates.jsx --items all --view expanded
rg -n -C 3 'repoUrl|deployUrl|copyCommand|View Source|Copy Command' \
apps/web-dashboard/src/pages/Templates.jsx
printf '%s\n' '--- relevant documentation and package dependency references ---'
for file in \
examples/python-sdk-demo/README.md \
examples/social-demo/README.md \
examples/sdk-kanban/server/package.json \
examples/sdk-kanban/client/package.json
do
if [ -f "$file" ]; then
printf '\n### %s\n' "$file"
rg -n -C 2 'git clone|^cd |file:|urBackend|urbackend' "$file" || true
fi
done
printf '%s\n' '--- PR discussion comment permalinks ---'
gh api repos/geturbackend/urBackend/issues/359/comments \
--paginate \
--jq '.[] | select(.body | contains("So list what needs to be updated.")) | {url: .html_url, user: .user.login}'Length of output: 12311 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="geturbackend/urBackend"
pr_url="https://github.com/geturbackend/urBackend/pull/359"
comment_url="https://github.com/geturbackend/urBackend/pull/359#issuecomment-5045751311"
body=$(cat <<EOF
## Summary
Make every source-based project template consumable locally from the monorepo without requiring users to infer checkout paths or dependency prerequisites.
This is a follow-up to the Templates gallery introduced in ${pr_url} and the discussion in ${comment_url}, requested by `@yash-pouranik`.
## Required changes
- Add a template-specific local setup flow to the dashboard (for example, a **Copy setup command** action or expanded README instructions) for templates that expose **View Source**.
- Commands should either clone the repository and use the correct repository-root-relative path, or use sparse checkout where the example is standalone.
- Preserve the existing quickstart scaffold commands for the TypeScript and Python quickstarts.
- Correct the Python demo setup instructions in \`examples/python-sdk-demo/README.md\`:
- After \`git clone ... urBackend.git\`, use \`cd urBackend/examples/python-sdk-demo\` (or an equivalent clone-directory-aware command).
- Correct the Social demo instructions in \`examples/social-demo/README.md\`:
- Replace the stale \`yash-pouranik/urBackend\` clone and documentation URLs with \`geturbackend/urBackend\`.
- Use \`cd urBackend/examples/social-demo\` (or an equivalent clone-directory-aware command).
- Define a viable local-consumption strategy for Kanban:
- \`examples/sdk-kanban/server/package.json\` currently depends on \`@urbackend/sdk\` via \`file:../../../sdks/urbackend-sdk\`.
- Either have its setup command sparse-check out both \`examples/sdk-kanban\` and \`sdks/urbackend-sdk\`, or migrate the server to the published SDK package version and document the supported workflow.
- Validate all dashboard-provided commands and README quickstarts from a clean checkout.
## Affected areas
- \`apps/web-dashboard/src/pages/Templates.jsx\`
- \`examples/python-sdk-demo/README.md\`
- \`examples/social-demo/README.md\`
- \`examples/sdk-kanban/server/package.json\`
- Any related template documentation / DevEx guidance.
## Acceptance criteria
- Each template card provides or links to an explicit, working local setup path.
- A user following each documented command reaches the intended example directory without manual path correction.
- All public repository links consistently target \`geturbackend/urBackend\`.
- Kanban installation works under its documented checkout strategy.
- Existing Vercel deployment and quickstart-scaffold flows remain functional.
EOF
)
gh issue create \
--repo "$repo" \
--title "Follow up: make monorepo templates directly consumable locally" \
--body "$body" \
--assignee "yash-pouranik"Length of output: 3034 The Comment image shows the Templates UI’s current split: quickstarts have Copy Command, while source templates only have View Source, which is the follow-up being tracked.
It covers:
I assigned it to you because no GitHub username for Nitin was supplied; you can reassign The current PR looks good to merge with this tracked as a follow-up. |
Description
This PR improves urBackend's Developer Experience (DevEx) by adding project templates, SDK demo projects, quickstart scaffolding scripts, and one-click Vercel deployment configurations.
What's Included
1. Project Templates Page (
/templates)@urbackend/react,@urbackend/sdk,urbackend Python)Available Templates:
@urbackend/react@urbackend/sdk@urbackend/sdkurbackend(Python)@urbackend/sdkurbackend(Python)2. Python SDK Demo (
examples/python-sdk-demo/)3. Quickstart Scripts (
examples/quickstart-scripts/)setup-ts-sdk.sh- Interactive scaffold for TypeScript +@urbackend/sdksetup-python-sdk.sh- Interactive scaffold for Python +urbackend4. Vercel Deployment Config (
examples/vercel.json)5. CI for Examples (
.github/workflows/examples.yml)examples/orsdks/paths6. DevEx Documentation (
examples/DEVEX.md)Testing
preview image
Summary by CodeRabbit