Follow these steps to run the Sahayogi project locally in VS Code.
- Node.js: v18 or later (v22 recommended)
- PostgreSQL: Running on port 5433 with password
123456. - VS Code Extenions: Prisma, ESLint, Tailwind CSS IntelliSense (Recommended).
- Open the
backendfolder in VS Code or a terminal. - Ensure dependencies are installed:
npm install
- Verify your
.envfile contains:DATABASE_URL="postgresql://postgres:123456@127.0.0.1:5433/sahayogi?schema=public" JWT_SECRET="your-secret-key" - Initialize the database (one-time setup):
npx prisma migrate dev --name init npx prisma db seed
- Start the backend:
The server will run on http://localhost:3000
npm run dev
- Open the
Sahayogifolder in a new terminal/VS Code window. - Install dependencies:
npm install
- Start the development server:
The application will run on http://localhost:8081
npm run dev
You can use the built-in terminal split feature in VS Code to see both logs at once:
- Open terminal (
Ctrl + ~). - Create two tabs: one for
backendand one forSahayogi. - Run the respective
npm run devcommands.
- Database Connection: Ensure PostgreSQL is running on port 5433. If you get an authentication error, verify the password is
123456. - API URL: The frontend is configured to call
http://localhost:3000/api. Ensure the backend is running on this port.