Skip to content

[Frontend][Tech-debt] Env var sprawl and mismatched defaults — NEXT_PUBLIC_BACKEND_URL points at port 5000 while the backend defaults to 3001 #472

Description

@Penielka

Overview

frontend/.env.example documents several overlapping backend URLs with inconsistent defaults:

  • NEXT_PUBLIC_BACKEND_URL defaults to http://localhost:5000
  • NEXT_PUBLIC_API_URL defaults to http://localhost:3001
  • NEXT_PUBLIC_WS_URL defaults to ws://localhost:3001

Meanwhile backend/src/index.ts defaults to PORT = process.env.PORT || 3001. Features that read NEXT_PUBLIC_BACKEND_URL will point at a dead port in a default local setup, and it is unclear which var each feature should read.

Evidence

  • frontend/.env.example — the three URL vars and defaults
  • backend/src/index.tsconst PORT = process.env.PORT || 3001;

Acceptance Criteria

  • Consolidate to a single backend base-URL var (derive WS/API URLs from it)
  • Fix defaults to match the backend's actual default port
  • Add a startup check logging the resolved API/WS URLs

Files to Modify

  • frontend/.env.example
  • frontend/src/lib/ (API client config)
  • backend/src/index.ts (if port default changes)

Priority: Low

Activity

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

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignfrontendFrontend UI/UX issuestech-debt

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions