This repository contains the Honestgig frontend (React + Vite) and a backend folder with the API (Node/Express + MongoDB).
- Frontend: React 18 + Vite
- Backend: Node.js + Express (in
backend/) - Database: MongoDB (local or remote)
- Node.js v18+ (or as specified by project)
- npm or yarn
- MongoDB running locally (default:
mongodb://127.0.0.1:27017/honestgig) or setMONGODB_URI
- Install dependencies:
cd s:\honestgig-frontend
npm install- Start dev server:
npm run dev
# Frontend will be served on http://127.0.0.1:5174 by default- Install and start backend dependencies:
cd s:\honestgig-frontend\backend
npm install
npm start
# Backend listens on port 5000 by default- Environment variables (create
.envinbackend/):
PORT=5000
MONGODB_URI=mongodb://127.0.0.1:27017/honestgig
JWT_SECRET=your_jwt_secret_here
FRONTEND_URL=http://localhost:5174
-
CORS errors (
Access-Control-Allow-Origin):- If frontend uses
127.0.0.1but backend CORS allowslocalhost(or vice-versa), you'll see preflight errors. Make surebackendCORSoriginincludes bothhttp://localhost:5174andhttp://127.0.0.1:5174, or setFRONTEND_URLto match the address you use.
- If frontend uses
-
HMR / WebSocket connection failures in Vite:
- If you see errors about failing to connect to websocket, configure
vite.config.jsserver.hmr host/port. Using127.0.0.1instead oflocalhostoften resolves Windows issues. Example:
- If you see errors about failing to connect to websocket, configure
server: {
host: '127.0.0.1',
port: 5174,
hmr: { host: '127.0.0.1', port: 5174 },
watch: { usePolling: true }
}- Port already in use: use
netstat -ano | findstr :5000thentaskkill /PID <pid> /Fto free the port.
- Start backend and frontend.
- Open
http://127.0.0.1:5174/freelancer-registration. - Fill registration steps. If you see
Validation failedorRegistration failed, open browser DevTools → Network → POST /api/auth/register → Response JSON to inspect theerrorsarray (the backend returns validation errors with field & message).
- Keep API URL consistent: frontend calls
http://localhost:5000by default, backend binds to port 5000. - Add environment variables to
.envand do NOT commit them (we added.gitignoreto ignore.env).
If you'd like, I can also:
- Commit the
.gitignoreandREADME.mdwith a message. - Add usage examples for the authentication API endpoints. <<<<<<< HEAD
Honestgig is a web application frontend built with React, Vite, and Tailwind CSS. It provides an interface for freelancers to manage their profiles and dashboards, as well as explore key features of the platform.
- Responsive design using Tailwind CSS
- Client-side routing with React Router
- Modular component structure
- MetaMask wallet connection for blockchain functionality
- React 18
- Vite
- Tailwind CSS
- React Router
- MetaMask API
- Node.js (>=14.x)
- npm (>=6.x) or yarn (>=1.x)
- Clone the repository:
git clone https://github.com/amisha-cloud/Honestgig.git
- Navigate to the frontend directory:
cd honestgig-frontend - Install dependencies:
or
npm install
yarn install
To start the development server with hot module replacement:
npm run devor
yarn devOpen your browser and go to http://localhost:5173 to view the application.
This repository contains the HonestGig project (frontend + backend). The frontend is a React + Vite app and the backend is a Node/Express API that uses MongoDB.
This README provides a concise, accurate setup and troubleshooting guide for local development on Windows (PowerShell).
- frontend/ → React + Vite frontend (development starts here)
- backend/ → Node.js + Express API
- public/ → static assets used by the frontend
- README.md → this file
- Node.js v18+ and npm (Windows PowerShell)
- MongoDB (local or remote). Default local URI: mongodb://127.0.0.1:27017/honestgig
Create a .env file inside backend/ with at least:
PORT=5000
MONGODB_URI=mongodb://127.0.0.1:27017/honestgig
JWT_SECRET=your_jwt_secret_here
FRONTEND_URL=http://127.0.0.1:5174
Do NOT commit .env — it is ignored by .gitignore.
- Backend
# from project root
cd S:\honestgig-frontend\backend
npm install
# start in dev mode (if package.json has a dev script) or use start
npm run dev; # or 'npm start' depending on scripts- Frontend
cd S:\honestgig-frontend\frontend
npm install
npm run dev
# Vite will report the local URL, usually http://127.0.0.1:5174Open the frontend URL shown by Vite (prefer 127.0.0.1 to avoid localhost/WSC mismatch on Windows).
-
CORS mismatch between
localhostand127.0.0.1- If the browser reports
Access-Control-Allow-Originmismatch, ensure the backend CORS origin list includes bothhttp://localhost:5174andhttp://127.0.0.1:5174, or setFRONTEND_URLto exactly what you use in the browser.
- If the browser reports
-
Vite HMR / WebSocket failures on Windows
- Use
127.0.0.1invite.config.jsserver.hmr host and in theserver.hostsetting. Example:
- Use
server: {
host: '127.0.0.1',
port: 5174,
hmr: { host: '127.0.0.1', port: 5174 },
watch: { usePolling: true }
}-
Port in use (e.g. backend 5000)
- Find processes:
netstat -ano | findstr :5000 - Kill by PID:
taskkill /PID <pid> /F
- Find processes:
-
Deleting root
node_moduleswhen files are locked- Stop any running dev server(s) first (close terminals or kill node processes):
# Find node processes
Get-Process node -ErrorAction SilentlyContinue
# Kill all node processes (be careful, this kills all Node instances):
taskkill /IM node.exe /F- Then remove the folder safely:
# from project root
Remove-Item -Recurse -Force .\node_modules- Frontend expects the API at
http://localhost:5000(you can change this in the front-endapiclient). If you run backend on a different host/port, update the frontend config orbackend/.envFRONTEND_URLaccordingly. - Registration and authentication endpoints return structured validation errors. Inspect the JSON response body to see
errorsand field messages. - MetaMask support exists in the frontend under
frontend/src/components/wallet/. Use MetaMask connected to the appropriate network when testing blockchain features.
- Start MongoDB (local or ensure
MONGODB_URIpoints to a running DB). - Create
backend/.envwith aJWT_SECRETandMONGODB_URI. - Install & run backend, then install & run frontend (see commands above).
Open issues or PRs. Please follow project code style and include a short description of any breaking changes.
If you want, I can also:
- add brief API usage examples (endpoints + sample payloads)
- add a small local integration test or a tiny script to confirm the backend is accepting requests
- push local branch changes or help clean up the remaining root
node_modulesif you confirm it's safe to kill running node processes on your machine.
Generated: November 1, 2025