Skip to content

agiladis/websocket-chatApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

websocket-chatApp

This project is created to fulfill Binar Javascript Challenge 7.

Project Support

Introduction

ChatApp is an open source platform that enable users send message to other user in real-time.

Project Support Features

  • Users can signup and login to their accounts
  • Verified user can access /api/v1/chats endpoint to start send message

Installation Guide

  • Clone this repository here.
  • The main branch is the most stable branch at any given time, ensure you're working from it.
  • Run npm install to install all dependencies
  • You can either work with cloud database or use your locally installed PostgreSQL. Do configure to your choice in the application entry file.
  • Create an .env file in your project root folder and add your variables. See .env.example for assistance.

Railway Project

This project is available on Railway, use this base URl on your postman :

LINK

OR

USE

Usage

  • Run npm start to start the application.
  • Connect to the API using Postman on port according to your configuration.

Column Data Type

Column Data Type Value Description
name String Required user name
email String Required user email (unique)
password String Required user password
phoneNumber String Required user phone number (unique)
dob DateTime Required date of birth
profilePhoto String Default null profile photo url
isVerified Boolean Default false acccount status
role Enum (ADMIN, USER) Default USER account role
receiverPhoneNumber String - phone number to receive message
message String - a message

API Endpoints

HTTP Verbs Endpoints Payload Action
POST /api/v1/auth/register name, email, password, phoneNumber, dob To sign up a new user account
POST /api/v1/auth/login email, password To login an existing user account (do email verification first)
POST /api/v1/auth/forgot-password email To request reset password
POST /api/v1/auth/reset-password/:resetToken email, password To reset old password
POST /api/v1/chats receiverPhoneNumber, message To start send message to other user

Socket.IO Endpoints

Events Endpoints Action
receiver phone number / To listen message from /api/v1/chats

Technologies Used

  • NodeJS This is a cross-platform runtime environment built on Chrome's V8 JavaScript engine used in running JavaScript codes on the server. It allows for installation and managing of dependencies and communication with databases.
  • ExpressJS This is a NodeJS web application framework.
  • PostgreSQL This is a open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
  • Prisma Is a modern database toolkit that simplifies and accelerates database workflows. It provides a type-safe and auto-generated query builder that allows developers to interact with databases using programming languages like TypeScript, JavaScript, and others..

Authors

License

This project is available for use under the MIT License.