Skip to content

Chat application with ranges, ban, multiple rooms, mongodb database system

License

Notifications You must be signed in to change notification settings

Darosss/ChatApplication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chat application

Table of Contents
  1. About The Project
  2. Getting Started
  3. Roadmap
  4. License
  5. Contact

About the project

Chat apllication where you can

Create trigger

  • as user:
    • chat with others in chat rooms,
    • create your own chat rooms with your own permissions for users / roles
  • addidionaly as administrator:
    • create/delete ranges,
    • edit other users profiles,
    • add ranges to other users,
    • ban and unban users from chat

Built with

  • React
  • MongoDB
  • SocketIO
  • Node

(back to top)

Getting started

Prerequisites

npm install npm@latest -g

Installation

  1. Clone the repo
git clone https://github.com/Darosss/ChatApplication.git
  1. Navigate to server folder and install NPM packages
cd app
npm install
  1. Navigate to frontend folder and install NPM packages
cd frontend
npm install

Configuration

The app requires several environment variables to be set in the .env file. You can use the .env.example (should be in root directory) file as a template:

BACKEND_PORT=5000(whatever port u can use)
FRONTEND_URL=<fe. http://localhost:3000>
DATABASE_URL=<fe. mongodb url>

COOKIE_SECRET=<cookie secret>
JWT_SECRET_KEY=<jwt secret>

VITE_BACKEND_URL=<fe. http://localhost:5000/api/v1 >
VITE_SOCKET_ENDPOINT=<fe. http://localhost:5000 >

VITE_BACKEND_URL - must contain <backend url with port>/api/v1 something like this. It's only route designed

Both COOKIE_SECRET and JWT_SECRET_KEY are random 32 bytes string. I've used: crypto.randomBytes(32).toString('hex')

(back to top)

Testing

  • backend:

    1. For test backend first we need to recreate testEnv file in app/src/tests/settings (in this folder should be testEnv.example which can be used for example)
    process.env.BACKEND_PORT = 5001;
    process.env.DATABASE_URL = ""; //fe. mongodb://127.0.0.1:27017/testdb, could be online cluster too
    process.env.COOKIE_SECRET = ""; //fe. 32 bytes hex string:
    //require("crypto").randomBytes(32).toString('hex')
    
    process.env.JWT_SECRET_KEY = ""; //fe. 32 bytes hex string:
    //require("crypto").randomBytes(32).toString('hex')
    process.env.NODE_ENV = "test";
    1. Then just run from app folder
    npm test
  • frontend: 1.simply navigate to frontend folder and run:

    npm test

Roadmap

  • Add chat rooms
  • Add login / register system
  • Add ban / unban system
  • Add ranges system
  • Improve for mobiles
  • [] Add shop with privileges

(back to top)

License

Distributed under the MIT License. See LICENSE.md for more information.

(back to top)

Contact

Darosss - darosss12@proton.me

Project Link: https://github.com/Darosss/ChatApplication

(back to top)

Releases

No releases published

Packages

No packages published

Languages