Skip to content

Comments

Fix backend startup documentation and uvicorn execution path#300

Open
Aditya30ag wants to merge 1 commit intoAOSSIE-Org:mainfrom
Aditya30ag:fix-backend-startup-docs
Open

Fix backend startup documentation and uvicorn execution path#300
Aditya30ag wants to merge 1 commit intoAOSSIE-Org:mainfrom
Aditya30ag:fix-backend-startup-docs

Conversation

@Aditya30ag
Copy link
Contributor

@Aditya30ag Aditya30ag commented Feb 17, 2026

Closes #299

📝 Description

This pull request updates the backend setup documentation to fix incorrect server startup instructions that were causing a relative import error.

Previously, the documentation instructed users to start the backend server from inside the app/ directory using:

uvicorn main:app --reload

This caused the following error:

ImportError: attempted relative import with no known parent package

The issue occurred because running Uvicorn from inside the app/ directory prevents Python from recognizing app as a package, breaking relative imports.

This PR corrects the documentation to instruct users to run the server from the project root directory using:

uvicorn app.main:app --reload

Additionally, clarification was added regarding the requirement for __init__.py files and proper backend setup steps.

🔧 Changes Made

  • Updated backend startup instructions in README.
  • Corrected the Uvicorn command to use app.main:app.
  • Added clarification about running the server from the Backend/ root directory.
  • Added explanation of the relative import error.
  • Improved setup clarity to prevent common onboarding issues.

📷 Screenshots or Visual Changes (if applicable)

Not applicable — documentation update only.

🤝 Collaboration

Collaborated with: N/A

✅ Checklist

  • I have read the contributing guidelines.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if applicable).
  • Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

  • Documentation
    • Updated backend startup instructions to provide correct execution guidance and added clarification to prevent common setup errors.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 17, 2026

📝 Walkthrough

Walkthrough

README.md backend startup instructions were corrected to specify running Uvicorn from the Backend root directory using the command uvicorn app.main:app --reload instead of uvicorn main:app --reload from the app/ directory. A clarifying note was added explaining relative import errors from incorrect execution paths.

Changes

Cohort / File(s) Summary
Documentation Update
README.md
Corrected backend setup instructions to run Uvicorn from Backend root directory with proper module path (app.main), and added explanatory note about relative import errors when running from app/ directory.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 The docs now hop with clarity bright,
Backend setup fixed, the path set right!
From root we run, with imports so sweet,
No more errors—documentation complete! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: fixing backend startup documentation and correcting the uvicorn execution path, which aligns perfectly with the changeset.
Linked Issues check ✅ Passed The pull request fully addresses all coding/documentation requirements from issue #299: correcting the Uvicorn command, specifying the Backend/ root directory, explaining relative import errors, noting init.py requirements, and improving onboarding clarity.
Out of Scope Changes check ✅ Passed All changes in the pull request are directly related to the documentation update objectives specified in issue #299; no out-of-scope modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

@Aditya30ag
Copy link
Contributor Author

Aditya30ag commented Feb 17, 2026

@Zahnentferner I find this as an issue please have a look into this

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: 2

🧹 Nitpick comments (1)
README.md (1)

128-131: Consider improving setup workflow clarity.

The current workflow has users navigate into the app/ directory to create the .env file (line 130), but then requires them to be back in the Backend/ directory to start the server. There's no explicit instruction to navigate back, which can cause confusion.

Consider either:

  1. Option 1: Add an explicit navigation instruction after the .env setup:
 3. Navigate to the app directory:
 ```sh
 cd app
  1. Create a .env file using .env-example as a reference.

+5. Navigate back to the Backend directory:
+sh +cd .. +
+
-5. Obtain Supabase credentials:
+6. Obtain Supabase credentials:


2. **Option 2**: Eliminate the need to `cd` into `app/` by specifying the file path in the instruction:

```diff
-3. Navigate to the app directory:
-```sh
-cd app
-```
-
-4. Create a `.env` file using `.env-example` as a reference.
+3. Create a `.env` file in the `app/` directory using `app/.env-example` as a reference.

Either approach would make the workflow clearer and prevent navigation confusion.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 128 - 131, Update README.md to remove the ambiguity
around directory context after "cd app": after the step that instructs users to
"Create a .env file using .env-example" (the block that follows "cd app"), add
an explicit navigation step "cd .." so the next instruction ("Obtain Supabase
credentials") runs from the Backend directory; alternatively, if you prefer not
to change directories, replace the "cd app" + local .env creation steps with a
single instruction to "Create a .env file in the app/ directory using
app/.env-example" so users never need to change into app/—pick one approach and
update the steps accordingly to reference "cd app", "Create a .env file using
.env-example" (or "app/.env-example"), and either add "cd .." or remove the cd
entirely.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Line 182: The README's "project root" is ambiguous—update the sentence
referencing running the server from the correct location: specify that users
must run the uvicorn command from the Backend directory (where the command
`uvicorn app.main:app` should be executed) rather than the repository root, and
clarify that running from inside the `app/` directory will cause relative import
errors because `app` must be a package; replace "project root" with "Backend/
directory (project backend root)" and include the exact `uvicorn app.main:app`
example to make the intended working directory explicit.
- Around line 176-179: The README navigation is wrong and case-inconsistent:
replace the incorrect "cd Backend" step (the exact "cd Backend" command) with
"cd .." so users return from backend/app to the Backend directory before running
"uvicorn app.main:app --reload", and audit/normalize all occurrences of the
directory name (instances of "backend" vs "Backend") across the README to match
the repository's actual directory casing.

---

Nitpick comments:
In `@README.md`:
- Around line 128-131: Update README.md to remove the ambiguity around directory
context after "cd app": after the step that instructs users to "Create a .env
file using .env-example" (the block that follows "cd app"), add an explicit
navigation step "cd .." so the next instruction ("Obtain Supabase credentials")
runs from the Backend directory; alternatively, if you prefer not to change
directories, replace the "cd app" + local .env creation steps with a single
instruction to "Create a .env file in the app/ directory using app/.env-example"
so users never need to change into app/—pick one approach and update the steps
accordingly to reference "cd app", "Create a .env file using .env-example" (or
"app/.env-example"), and either add "cd .." or remove the cd entirely.

Comment on lines +176 to +179
2. Start the backend server (from the Backend directory):
```sh
uvicorn main:app --reload
cd Backend
uvicorn app.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 | 🔴 Critical

Critical: Path navigation will fail if instructions are followed sequentially.

The instruction at line 178 cd Backend won't work for users following the setup steps in order. By line 178, users are in the backend/app/ directory (from line 130: cd app), so cd Backend will fail with "directory not found."

Additionally, there's a case sensitivity inconsistency: line 119 uses lowercase backend while line 178 uses capitalized Backend. On case-sensitive filesystems (Linux/Mac), these are different directories.

🔧 Proposed fix for correct navigation and case consistency

Option 1 (Recommended): Fix the navigation command to go back to the Backend directory:

 2. Start the backend server (from the Backend directory):
 ```sh
-cd Backend
+cd ..
 uvicorn app.main:app --reload

**Option 2**: Remove the `cd` command and clarify the starting location in the instruction text:

```diff
-2. Start the backend server (from the Backend directory):
+2. Start the backend server (navigate back to the Backend directory first):
 ```sh
-cd Backend
 uvicorn app.main:app --reload

Also ensure case consistency throughout the document. Verify the actual directory name in the repository and use it consistently (either always `backend` or always `Backend`).

</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
2. Start the backend server (from the Backend directory):
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 176 - 179, The README navigation is wrong and
case-inconsistent: replace the incorrect "cd Backend" step (the exact "cd
Backend" command) with "cd .." so users return from backend/app to the Backend
directory before running "uvicorn app.main:app --reload", and audit/normalize
all occurrences of the directory name (instances of "backend" vs "Backend")
across the README to match the repository's actual directory casing.

uvicorn app.main:app --reload
```

**Important**: Do not run the server from inside the `app/` directory as this will cause relative import errors. The application must be executed from the project root so that `app` is treated as a proper Python package.
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

Clarify "project root" terminology to prevent confusion.

The phrase "project root" is ambiguous—it could refer to either the repository root (InPact/) or the Backend directory root (Backend/). Based on the uvicorn command uvicorn app.main:app, users should run from the Backend/ directory, not the repository root.

📝 Proposed fix for clearer terminology
-**Important**: Do not run the server from inside the `app/` directory as this will cause relative import errors. The application must be executed from the project root so that `app` is treated as a proper Python package.
+**Important**: Do not run the server from inside the `app/` directory as this will cause relative import errors. The application must be executed from the `Backend/` directory (the backend root) so that `app` is treated as a proper Python package.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**Important**: Do not run the server from inside the `app/` directory as this will cause relative import errors. The application must be executed from the project root so that `app` is treated as a proper Python package.
**Important**: Do not run the server from inside the `app/` directory as this will cause relative import errors. The application must be executed from the `Backend/` directory (the backend root) so that `app` is treated as a proper Python package.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 182, The README's "project root" is ambiguous—update the
sentence referencing running the server from the correct location: specify that
users must run the uvicorn command from the Backend directory (where the command
`uvicorn app.main:app` should be executed) rather than the repository root, and
clarify that running from inside the `app/` directory will cause relative import
errors because `app` must be a package; replace "project root" with "Backend/
directory (project backend root)" and include the exact `uvicorn app.main:app`
example to make the intended working directory explicit.

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.

DOCS UPDATE: Fix Backend Setup Documentation: Correct Uvicorn Execution Path

1 participant