For Frontend Click Here
CodeBuddy Backend is the server-side component of the CodeBuddy project, a platform designed to connect developers based on shared skills, interests, and profiles. This backend service handles user authentication, profile management, connection requests, and more.
- Secure user registration, login, and logout using JWT.
- Create, view, and edit user profiles.
- Send, review, and manage connection requests between users.
- Display profiles of other users on the platform.
- Backend: Node.js, Express
- Database: MongoDB
- Authentication: JWT
Follow these steps to set up and run the backend locally:
- Node.js
- MongoDB
- npm (Node Package Manager)
git clone https://github.com/Sandipkushwaha20/CodeBuddy.git
cd CodeBuddy/backend
npm install
npm run dev
- POST
/signup
: Register a new user. - POST
/login
: Login an existing user. - POST
/logout
: Logout the current user.
- GET
/profile/view
: View the current user's profile. - PATCH
/profile/edit
: Edit the current user's profile. - PATCH
/profile/password
: Change the current user's password.
- POST
/request/send/:status/:userId
: Send a connection request to a user.status
can beinterested
orignored
. - POST
/request/review/:status/:requestId
: Review a connection request.status
can beaccepted
orrejected
.
- GET
/user/requests
: Get the current user's connection requests. - GET
/user/connections
: Get the current user's connections. - GET
/user/feed
: Get profiles of other users on the platform.
CodeBuddy/
├── .gitignore
├── package.json
├── README.md
├── src/
│ ├── app.js
│ ├── config/
│ │ └── database.js
│ ├── middlewares/
│ │ └── auth.js
│ ├── models/
│ │ ├── connectionRequest.js
│ │ └── user.js
│ ├── routes/
│ │ ├── auth.js
│ │ ├── profile.js
│ │ ├── request.js
│ │ └── user.js
│ └── utils/
│ └── validation.js
graph TD
A[User Registration/Login] --> B[User Authentication]
B --> C[Profile Management]
C --> D[Connection Requests]
D --> E[User Feed]
E --> F[View Other User Profiles]
F --> G[Send Connection Requests]
G --> H[Review Connection Requests]
H --> I[Manage Connections]
-
Run the Server:
- Start the backend server using
npm run dev
.
- Start the backend server using
-
Test the API:
- Use tools like Postman to test endpoints such as
/signup
and/login
.
- Use tools like Postman to test endpoints such as
-
Integration:
- Connect this backend with the frontend or any client for a full-stack application.
- Add email notifications for connection requests.
- Implement real-time messaging between users.
- Add pagination and filtering options to the user feed.
- Developed by: Sandip Kushwaha