Skip to content

mat-afk/swellow-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cover

Swellow App

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

MongoDB Express.js React NodeJS Socket.io

Features

  • 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.

Getting Started

Prerequisites

  • 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.

Installation and Configuration

  1. Clone the repository;

    git clone https://github.com/mat-afk/swellow-app.git
  2. Navigate to the project directory;

    cd swellow-app
  3. Install server dependencies;

    npm install
  4. Copy .env.example file to .env and change the environment variables to match your configuration;

    cp .env.example .env
  5. Navigate to the client directory;

       cd ./frontend/
  6. Install client dependencies;

    npm install
  7. Start the server;

    cd ..
    npm run server
  8. Start the client;

    cd ./frontend/
    npm run dev
  9. The app will be accessible at http://localhost:3000.

Database Schema

User

{
  "fullName": "string",
  "username": "string",
  "password": "string",
  "gender": "enum['male', 'female', 'non-binary']",
  "profilePicture": "string",
  "createdAt": "date",
  "updatedAt": "date"
}

Message

{
  "senderId": "string",
  "receiverId": "string",
  "message": "string",
  "createdAt": "date",
  "updatedAt": "date"
}

Conversation

{
  "participants": ["string"],
  "messages": ["string"],
  "createdAt": "date",
  "updatedAt": "date"
}

HTTP Routes

Auth

  • POST /api/auth/register: Register a new user.
  • POST /api/auth/login: Login an existing user.
  • POST /api/auth/logout: Logout the current user.

Messages

  • 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.

Users

  • GET /api/users: Get all users.

License

This project is licensed under the MIT License.

About

Real-time chat app built with MERN stack and Socket.io

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published