Real-time chat app built with MERN stack (MongoDB, Express.js, React.js, Node.js) and Socket.io for two-way communication between the server and the client.
Deployment: https://swellow-app.onrender.com
-
User Registration and Login: Users can register and log in to access the chat. Authentication is carried out using JWT tokens (JSON Web Tokens), providing an additional layer of security.
-
Real-Time Chat: Users can exchange messages in real time with other connected users. Messages are delivered in real time without the need to refresh the page via Socket.io, providing a fluid and immersive experience.
-
New Message Notifications: Users receive instant notifications when new messages are sent.
-
Node.js and npm installed globally on your machine.
-
MongoDB installed and running on your local machine or using a database service hosted in the cloud.
-
Clone the repository;
git clone https://github.com/mat-afk/swellow-app.git
-
Navigate to the project directory;
cd swellow-app -
Install server dependencies;
npm install
-
Copy
.env.examplefile to.envand change the environment variables to match your configuration;cp .env.example .env
-
Navigate to the client directory;
cd ./frontend/ -
Install client dependencies;
npm install
-
Start the server;
cd .. npm run server -
Start the client;
cd ./frontend/ npm run dev -
The app will be accessible at http://localhost:3000.
{
"fullName": "string",
"username": "string",
"password": "string",
"gender": "enum['male', 'female', 'non-binary']",
"profilePicture": "string",
"createdAt": "date",
"updatedAt": "date"
}{
"senderId": "string",
"receiverId": "string",
"message": "string",
"createdAt": "date",
"updatedAt": "date"
}{
"participants": ["string"],
"messages": ["string"],
"createdAt": "date",
"updatedAt": "date"
}- POST
/api/auth/register: Register a new user. - POST
/api/auth/login: Login an existing user. - POST
/api/auth/logout: Logout the current user.
-
GET
/api/messages/:id: Get all messages from the conversation between the current user and another user. -
POST
/api/messages/send/:id: Send a new message to another user.
- GET
/api/users: Get all users.
This project is licensed under the MIT License.
