Skip to content

Conversation

@V4Vikaskumar
Copy link

@V4Vikaskumar V4Vikaskumar commented Dec 26, 2025

Summary

This PR adds two explicit scripts to the main package.json to improve the local development experience:

  • npm run backend – to run the backend server
  • npm run frontend – to run the frontend (Tauri app)

Why this change was needed

New contributors often face multiple issues while setting up and running the project locally.
Previously, there was confusion around how to start the backend and frontend together, which made the initial setup harder and more error-prone.

By introducing separate commands:

  • Contributors can easily run the backend and frontend independently
  • The project becomes easier to understand and operate during development
  • Contributors can focus on contributing instead of debugging the setup

Why a single command was not used

Running both the backend and frontend with a single command is not reliable in this project.

When the backend is started, it runs a long-living server process in the terminal.
Because of this, the same terminal cannot be used to start the frontend, which leads to blocking behavior and process management issues.

Due to this limitation, running both services from a single command caused repeated failures and instability.
Separating them into two commands provides a clearer, more stable, and predictable development workflow.


How to Run Backend and Frontend Locally

Two.Command.Problem.solve.mp4

Impact

  • Easier onboarding for new contributors
  • Clear and explicit development workflow
  • Fewer setup and runtime issues
  • Better overall contributor experience

This change does not alter application behavior and only improves the development setup.

issue (Fixes #837)

@github-actions
Copy link
Contributor

⚠️ No issue was linked in the PR description.
Please make sure to link an issue (e.g., 'Fixes #issue_number')

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 26, 2025

📝 Walkthrough

Walkthrough

Documentation enhancements added to YOLO utility functions with comprehensive docstrings for NMS, IoU computation, and visualization methods. Two new npm scripts introduced in package.json to independently run backend (uvicorn) and frontend (Tauri) components.

Changes

Cohort / File(s) Summary
YOLO Utility Documentation
backend/app/utils/YOLO.py
Added extensive docstrings to nine utility functions (YOLO_util_nms, YOLO_util_multiclass_nms, YOLO_util_compute_iou, YOLO_util_xywh2xyxy, YOLO_util_draw_detections, YOLO_util_draw_box, YOLO_util_draw_text, YOLO_util_draw_masks, YOLO_util_get_model_path) with no functional or control flow changes.
NPM Scripts Configuration
package.json
Added two new scripts: "frontend" (executes frontend Tauri dev) and "backend" (executes Python uvicorn server). Minor formatting adjustments; existing scripts unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 New docstrings bloom, so clear and bright,
Scripts for frontend, backend—paths made right!
No logic twisted, just words well-dressed,
DX improves—developers blessed! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes extensive docstring additions to YOLO.py, which is unrelated to issue #837's objective of adding npm scripts for backend/frontend separation. Remove the YOLO.py documentation changes and move them to a separate PR focused on code documentation improvements.
Linked Issues check ❓ Inconclusive While the PR addresses the core objective of providing separate backend/frontend commands, the linked issue proposes a combined 'dev' script using concurrently, which is not confirmed to be implemented. Clarify whether the combined 'dev' script using concurrently has been added alongside the separate 'backend' and 'frontend' scripts as proposed in issue #837.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title directly describes the main change: adding separate npm scripts for backend and frontend commands to improve contributor onboarding, which aligns with the primary objective of the PR.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

⚠️ No issue was linked in the PR description.
Please make sure to link an issue (e.g., 'Fixes #issue_number')

1 similar comment
@github-actions
Copy link
Contributor

⚠️ No issue was linked in the PR description.
Please make sure to link an issue (e.g., 'Fixes #issue_number')

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
backend/app/utils/YOLO.py (1)

94-439: Consider separating unrelated changes into a separate PR.

While the docstring additions are valuable and well-executed, they are unrelated to the PR's stated objective of improving the contributor experience with run commands. Mixing unrelated changes in a single PR can:

  • Complicate code review and make it harder to track the purpose of changes
  • Increase the risk surface if a rollback is needed
  • Make it harder to trace changes through git history

For future PRs, consider keeping documentation improvements in a separate PR from feature/tooling changes.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 81286fa and 7f94b68.

📒 Files selected for processing (2)
  • backend/app/utils/YOLO.py
  • package.json
🔇 Additional comments (2)
backend/app/utils/YOLO.py (2)

94-107: Well-written docstrings improve code maintainability.

The Google-style docstrings are comprehensive, clearly document parameters and return values, and significantly improve the developer experience when working with these YOLO utility functions.

Also applies to: 131-142, 174-183, 206-215, 229-243, 289-302, 316-332, 369-381


144-168: Helpful inline comments enhance code readability.

The inline comments effectively explain the logic flow and intent, making the code easier to understand and maintain.

Also applies to: 245-278, 334-363, 383-395

Comment on lines +7 to +8
"frontend": "cd frontend && npm run tauri dev",
"backend": "cd backend && python -m uvicorn main:app --reload",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify backend dependencies and main.py structure

echo "=== Checking for uvicorn in backend dependencies ==="
fd -t f 'requirements.txt|pyproject.toml|Pipfile' backend/ --exec rg -n "uvicorn" {} \;

echo -e "\n=== Checking for main.py in backend directory ==="
fd -t f '^main\.py$' backend/

echo -e "\n=== Verifying app instance in main.py ==="
fd -t f '^main\.py$' backend/ --exec rg -n "app\s*=.*FastAPI|app\s*=.*Starlette" {} \;

echo -e "\n=== Checking backend directory structure ==="
ls -la backend/ 2>/dev/null || echo "backend/ directory not found"

Repository: AOSSIE-Org/PictoPy

Length of output: 1147


Python command compatibility needs addressing.

The backend setup is properly configured: uvicorn is specified in requirements.txt (v0.30.1), backend/main.py exists with a FastAPI app instance. However, the npm script uses python which may fail on systems where only python3 is available. Consider using python3 instead or documenting the requirement. Note that you already have platform-specific scripts (run.sh and run-server.ps1), which suggests applying similar cross-platform considerations to the npm command would be beneficial.

🤖 Prompt for AI Agents
In package.json around lines 7-8, the backend npm script uses `python` which can
fail on systems where only `python3` is available; change the script to invoke
`python3 -m uvicorn main:app --reload` (or add a cross-platform fallback wrapper
that tries `python3` then `python`) and/or document the requirement in README so
the backend start command works reliably across platforms.

@V4Vikaskumar V4Vikaskumar changed the title Improve contributor experience by separating backend and frontend run commands Improve contributor experience by separating backend and frontend run commands issue(fixes #837) Dec 26, 2025
@github-actions
Copy link
Contributor

⚠️ No issue was linked in the PR description.
Please make sure to link an issue (e.g., 'Fixes #issue_number')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DX Improvement: No single command to run backend + frontend (onboarding friction)

1 participant