Skip to content

atomkernel0/procto-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProctoChat

MIT License

Procto-Chat is a chat app that uses React, Hapi, MongoDB and socket.io

This app has a Login page, a Register page, it has also an avatar system. You can chat with multiple people!

Run Locally

Clone the project

  git clone https://github.com/atom1488/procto-chat.git

Go to the public directory and install dependencies

  cd public
  yarn install

Then go back to the root and go to the server directory, create a .env file and install dependencies

  cd ../server
  echo "MONGO_URL = " > .env
  yarn install

And start the server

  yarn start

Then, go to the public directory and start the app

  cd ../public
  yarn start

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

PORT (not required, default port is 2000)

MONGO_URL

API Reference

Register account

  POST /api/auth/register
Parameter Type Description
username string Required. Username of the account
email string Required. E-Mail of the account
password string Required. Password of the account

Login to an account

  POST /api/auth/login
Parameter Type Description
username string Required. Username of the account
password string Required. Password of the account

Set an avatar image

  POST /api/auth/setAvatar/{id}
Parameter Type Description
id string Required. Id of the user
image string Required. Base64 encoding of the image

Get all users

  GET /api/auth/allUsers/{id}
Parameter Type Description
id string Required. Id of a user

Send message

  POST /api/messages/addmsg
Parameter Type Description
from string Required. Id of the user sending the message
to string Required. Id of the user that is recieving the message
message string Required. Message to send

Send message

  POST /api/messages/getmsg
Parameter Type Description
from string Required. Id of the user sending messages
to string Required. Id of the user that is recieving messages

About

Chat app using React, Hapi, MongoDB and socket.io

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published