This is the backend for the Mentor Volunteer Program (MVP), providing the API for connecting mentors and mentees.
- Node.js
- Express
- PostgreSQL
- pg-promise
- bcrypt (for password hashing)
- dotenv (for environment variables)
- Node.js (v14 or higher)
- PostgreSQL (v12 or higher)
-
Clone the repository:
git clone https://github.com/yourusername/mvp-backend.git cd mvp-backend -
Install the dependencies:
npm install
-
Create a
.envfile in the root directory and add your environment variables:SECRET=your_jwt_secret DATABASE_URL=your_database_url
-
Create the database:
psql -U postgres -f db/schema.sql
-
Seed the database (if applicable):
npm run db:seed
To start the server, run:
npm startThe server will run on http://localhost:5000.
GET /users- Retrieve all usersPOST /users- Create a new userGET /users/:id- Retrieve a user by IDGET /users/:id/mentees- Retrieve mentees connected to a mentorGET /users/:id/connection-details- Retrieve connection details for a user
- User authentication and authorization
- CRUD operations for users
- Connection management between mentors and mentees
- Error handling and validation