This is the backend app for the Social Connect. It is a video calling app that allows users to connect with each other. It is built with NestJS and Firebase. It uses WebRTC for video calling and Socket.io for real-time communication. It also uses Redis for caching and Elasticsearch for searching.
This API was developed with the following technologies:
- NodeJS
- NestJS
- Firebase
- Firestore
- WebRTC
- Socket.io
- Redis
- Elasticsearch
Pre-requisites
- Node(LTS version)
- NPM v9.0.0 or higher
- MongoDB
You can get the latest version of NodeJS from here or you can check the version you have installed on your machine by running the following command in your terminal
node -v
You can get the latest version of NPM from here or you can check the version you have installed on your machine by running the following command in your terminal
npm -v
Clone the project
git clone [email protected]:vicodevv/social-connect-backend.git
Go to the project directory
cd social-connect-backend
Install dependencies
npm install
Run the code
npm run dev
To run tests, run the following command
npm run test
This API uses JWT for authentication. To get a token, you need to register and login. The token is valid for 24 hours. You can use the token to access protected routes. To access authenticated routes, set your authorization header to Bearer [ token ]. Read postman documentation for further details
To run this project, you will need to add the following environment variables to your .env file
- PORT=your port number
- MONGO_URI=your mongodb uri
- JWT_SECRET=your jwt secret
Method | Description | Endpoints |
---|---|---|
POST | Login a user | /api/auth/login |
POST | Register a user | /api/auth/register |
GET | Get all users | /api/users |
GET | Get a single user | /api/users/:id |
POST | Create a user | /api/users |
GET | Get all links | /api/links |
GET | Get a single link | /api/links/:id |
GET | Get all links by a user | /api/links/user/:id |
POST | Create a link | /api/links/create |
PUT | Update a link | /api/links/update/:id |
DELETE | Delete a link | /api/links/delete/:id |