Introduction • Installation Guide • API Reference • Credits • License • Contributors
Chat Application that you can chat with application's users using MERN STACK.
Authentication process is performed using OAuth 2.0
.
For Client Side see: Mern Stack Chat App Client
To clone and run this application, you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line:
# Clone this repository
$ git clone https://github.com/Ctere1/mern-stack-server
# Go into the repository
$ cd mern-stack-server
# Install dependencies
$ npm install
# Run the app
$ npm start
Do not forget setup
.env
file for MongoDB connection and Google Signin.
See Postman Collection Json for detailed information.
HTTP Verb | Endpoint | Description |
---|---|---|
POST |
api/auth/login |
User Login |
DELETE |
api/auth/logout |
User Logout |
POST |
api/auth/googleLogin |
Login with Google's Credentials |
POST |
api/auth/googleSignup |
Signup with Google's Credentials |
POST |
api/auth/refreshToken |
For OAuth 2.0 |
HTTP Verb | Endpoint | Description |
---|---|---|
POST |
api/user/signup |
User signup |
GET |
api/user/all |
Returns Users |
DELETE |
api/user/delete |
Deletes the User |
PUT |
api/user/update |
Updates the User |
PUT |
api/user/referral |
Updates user's point |
HTTP Verb | Endpoint | Description |
---|---|---|
GET |
api/room |
Returns Rooms |
{
"_id": "63b06ea4afbce25ff3e6fe91",
"createdAt": "2022-12-31",
"name": "Test",
"email": "test@gmail.com",
"picture": "http://res.cloudinary.com/dyzuhnuw6/image/upload/v1672507041/xgiokrhmylqzwblq7hql.png",
"status": "online",
"points": 0,
"referralCode": "gYSTs",
"referralFromCode": "",
"newMessages": {},
"__v": 0
}
[
"general",
"welcome",
"events",
"meeting"
]
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2CJleHAiOjE2NzI1OTEwNjF9.7M0htpNmxcgAJuAMC0E_tWn3FMvSgJi5qZ9lD0ZvsNY",
"refreshToken": "eyJhbGciOiJIUI1NiIsInR5cCI6IkpXVCJ9.eyJ1cTYxLCJleHAiOjE2NzI1OTEzNjF9.kx0Cg8gIKc0by6o14zoVp0FRoWDcx0PI44wvfk0CNlk"
}
This software uses the following open source packages: