Skip to content

Make Railway root deploy compatible for nested FastAPI app - #2

Draft
DzSexton with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-railway-deployment-structure
Draft

Make Railway root deploy compatible for nested FastAPI app#2
DzSexton with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-railway-deployment-structure

Conversation

Copilot AI commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Railway build was failing because deployment config lived under Google hackthon Selling Agent/ while Railway resolves build/start config from repository root. This PR adds root-level deploy config and updates startup/module imports so the app can boot from root without breaking the existing subdirectory layout.

  • Root-level Railway config (non-breaking)

    • Added at repo root:
      • Procfile
      • requirements.txt
      • runtime.txt (python-3.13)
      • nixpacks.toml
    • Kept original copies in Google hackthon Selling Agent/ for backward compatibility.
  • Root startup path alignment

    • Updated root Procfile to point to the nested module:
      web: uvicorn "Google hackthon Selling Agent.app.main:app" --host 0.0.0.0 --port $PORT
    • Aligned root nixpacks.toml start command to the same module path.
  • Import-path hardening for root execution

    • Switched absolute from app... imports to package-relative imports in:
      • Google hackthon Selling Agent/app/main.py
      • Google hackthon Selling Agent/app/routes/analytics.py
      • Google hackthon Selling Agent/app/routes/vendors.py
      • Google hackthon Selling Agent/app/routes/group_orders.py
    • This preserves subdirectory execution while enabling root-based module resolution.
  • Representative code change

    # before
    from app.database import db
    from app.routes import vendors, analytics, group_orders, chat
    
    # after
    from .database import db
    from .routes import vendors, analytics, group_orders, chat

Copilot AI changed the title [WIP] Fix project structure for Railway deployment Make Railway root deploy compatible for nested FastAPI app Jun 11, 2026
Copilot AI requested a review from DzSexton June 11, 2026 14:53
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.

2 participants