A full-stack marketplace project with a React frontend and a Node.js + Express backend.
frontend/- React applicationbackend/- Node.js + Express API
- Install dependencies with
npm --prefix frontend installandnpm --prefix backend install. - Start MongoDB locally or use a MongoDB Atlas URI.
- Copy
backend/.env.exampletobackend/.envand setMONGO_URI, a long, randomJWT_SECRET, and SMTP settings (SMTP_HOST,SMTP_PORT,SMTP_SECURE,SMTP_USER,SMTP_PASSWORD, and optionallyEMAIL_FROM) so signup verification codes can be emailed. For Gmail, use an app password rather than your account password. SetCAMPUS_NAMEto enforce one university for all visitors. When it is omitted, signed-in students are scoped by the college name supplied during registration; public browsing is not locked to one campus. - Run
npm run devfrom the project root. The backend serves the API and Vite-powered frontend athttp://localhost:6002by default. ChangePORTinbackend/.envif that port is already in use. If you run the frontend separately on Vite (usually port5173), keep the backend running on port6002; the frontend connects to it automatically. For a custom backend port, setVITE_BACKEND_PORTin the frontend environment or setVITE_API_URLto the full API URL.
- Browse live listings, search and filter by category and price.
- Register with a university name and an email verification code. Passwords must be at least 10 characters and include an uppercase letter, a number, and one of
@,,,., or/. Then sign in, list an item with up to five photos, and manage its live/sold state in the dashboard. - Verification codes expire after 10 minutes. For security, each code allows five attempts, resend requests have a one-minute cooldown, and no more than five codes can be sent per hour.
- Reset a forgotten password from the login page using an email code, then set a new password that follows the same password rules.
- Buyers sign in to message the student seller. After they finalize the deal, the buyer can send an "I bought this item" request from its detail page. The listing stays available until the seller confirms the sale from their dashboard; then LocalKart marks it sold and notifies the buyer in chat. Conversations are visible to both participants and update while the chat is open.
- Seed 50 sample campus listings and 10 demo sellers by setting
DEMO_SEED_PASSWORDinbackend/.envand runningnpm run seed:demo. Demo listings are shown only until a real student listing is available for that campus, then real listings replace the demo feed automatically. The homepage refreshes listings every 15 seconds and when the browser tab gets focus. Demo seller logins areseller01@localkart-demo.testthroughseller10@localkart-demo.test; all use the configured demo password. Keep these demo credentials local and change them before deployment. - Agree on payment and a safe campus handover directly with the other student before either side requests or confirms the sale. LocalKart does not process online payments or provide delivery.
- Listing photos are stored locally and served from
/uploads; Cloudinary can optionally be configured for hosted images.
For production, build the frontend with npm run build and start the backend with NODE_ENV=production npm start from backend/. Configure the same CAMPUS_NAME in the backend for strict single-university access, and use a managed MongoDB URI and strong JWT secret.