Local Development Setup
Prerequisites
- Node.js 18+
- npm
- Access to the Housr MySQL database (for search features)
- API credentials for Housr API v1 and v2
Installation
git clone <repo-url>
cd Housr-Webapp
npm installEnvironment Variables
Create a .env.local file in the project root. The following variables are used:
API URLs (required)
NEXT_PUBLIC_API_URL_US=https://api.us.housr.com
NEXT_PUBLIC_API_URL_UK=https://api.uk.housr.com
NEXT_PUBLIC_LEGACY_API_URL_US=https://legacy.us.housr.com
NEXT_PUBLIC_LEGACY_API_URL_UK=https://legacy.uk.housr.comThese are configured in src/config/config.ts via getApiUrl(locale) and getLegacyApiUrl(locale). They default to http://localhost:8000 and http://localhost respectively if not set.
MySQL Database (required for search)
NEXT_PRIVATE_MYSQL_HOST=
NEXT_PRIVATE_MYSQL_USERNAME=
NEXT_PRIVATE_MYSQL_PASSWORD=
NEXT_PRIVATE_MYSQL_DATABASE=
NEXT_PRIVATE_MYSQL_BILLS_DATABASE=housr_bills_devUsed by src/lib/db.ts to create a MySQL connection pool. The NEXT_PRIVATE_ prefix keeps these server-side only.
Finix Payments (perk partners)
NEXT_PUBLIC_FINIX_ENVIRONMENT=sandbox
NEXT_PUBLIC_FINIX_APPLICATION_ID=APwXqoRUZFSa7V9Ljs59CYBtContentstack CMS (blog and location content)
CONTENTSTACK_API_KEY=
CONTENTSTACK_DELIVERY_TOKEN=
CONTENTSTACK_ENVIRONMENT=productionOther
NEXT_PUBLIC_CAREER_URL=https://careers.housr.comThe Mapbox access token is hardcoded in src/config/config.ts (not an environment variable).
Running the Dev Server
npm run devThis starts the Next.js dev server with Turbopack at http://localhost:3000. The root URL / rewrites to /us (the default locale).
Verifying the Build
npm run type-check # TypeScript errors
npm run lint # ESLint errors
npm run build # Full production buildLast updated on