This guide explains how to run CareerPilot locally for development while preserving the hosted server configuration.
- Node.js (v16 or higher)
- npm or yarn
- MongoDB (local or cloud)
cd server
npm install
npm run devThe server will start on http://localhost:5000
cd client
npm install
npm run devThe client will start on http://localhost:3000
To switch between local and hosted backend, edit client/src/config/config.js:
// For local development
CURRENT_ENV: "LOCAL" // Uses http://localhost:5000
// For production/hosted
CURRENT_ENV: "HOSTED" // Uses https://careerpilot-jizf.onrender.comThe application automatically detects the environment and uses the appropriate backend URL.
npm run dev- Start server with auto-reload (development)npm start- Start server without auto-reload (production)
npm run dev- Start development servernpm run dev:local- Start development server in local modenpm run build- Build for productionnpm run build:local- Build for local development
The backend provides the following API endpoints:
/api/profile- User profile management/api/goals- Daily and weekly goals/api/applications- Job application tracking/api/resumes- Resume management/api/ai- AI-powered features
The server is configured to accept requests from both:
http://localhost:3000(local development)https://careerpilot-jizf.onrender.com(hosted frontend)
If port 5000 is already in use, you can change it in server/src/index.js:
const PORT = process.env.PORT || 5001; // Change to 5001 or another portEnsure MongoDB is running and accessible. Check the connection string in your environment variables.
If you encounter CORS issues, verify that the frontend URL is included in the CORS configuration in server/src/app.js.