Backend/ (Express + Node.js) and Frontend/ (React + Vite). You run them as separate processes.
Prerequisites
Before you begin, make sure the following are installed and running:- Node.js 18+ — required by both applications
- MongoDB — the Backend connects on startup; the process exits if the connection fails
- Redis — used for OTP storage and session management; defaults to
127.0.0.1:6379 - Git
Setup
Configure environment variables
Create a
.env file in each application directory. See Environment variables for the full list of required variables and example values.Start the Backend dev server
From the The server starts with
Backend/ directory:nodemon and reloads on file changes. You should see:Access the app
Once both servers are running, open your browser to:| Service | URL |
|---|---|
| Frontend | http://localhost:5173 |
| Backend API | http://localhost:3000/api |
Production build
To build and run both applications in production mode:Build the Backend
npm run build compiles TypeScript to dist/. npm start runs the compiled output with node dist/index.js.The Frontend includes a
vercel.json with a catch-all rewrite rule so that React Router handles client-side navigation correctly when deployed to Vercel.