Skip to content

KR1470R/artos-messenger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Artos Messenger

Fast, simple, connectable


Documentation Content

  1. About
  2. Demo
  3. Supported Systems
  4. API
    1. HTTP API
    2. Websockets API
      1. /messages
        1. join_chat
        2. leave_chat
        3. CRUD events
          1. create_message
          2. update_message
          3. delete_message
          4. find_many_messages
  5. Usage
    1. Installation
    2. Running using Docker
    3. Running without Docket
  6. ERD Diagram
  7. TODO
  8. Contribution
  9. License

About

Real-time chat application.

Requirements

Supported systems

Demo

https://artos-messanger.xyz

API

HTTP API

The HTTP REST API docs illustrated via Swagger UI here.
Production REST API URL - https://artos-messanger.xyz/api/v1/

Websockets API

Production Websocket URL - https://artos-messanger.xyz/{namespace}
Note, you should to use socket.io to interact with it.

messages namespace

This application uses websocket gateway for real-time messages exchange between chat members.

Diagrams below illustrates test-cases, when members communicate with each other in the same chat, what events they should emit and what events they should subscribe.

join_chat event:

Bind user to a chat in the system.
First of all, when user opens a chat, the client should connect to the WS, and ask the server to join the target chat.

leave_chat event:

Unbind user from a chat in the system.
When user disconnects from the socket, the server automatically deletes from the joined(binded) sockets related to the chat and the user, thus events of any manipulation with the chat messages will be stopped.

The user can also manually leave from the chat:

CRUD events

When client connected and joined to the chat, the WS server is ready to listen for events and process operations.

create_message event:

update_message event:

delete_message event:

find_many_messages event:

Usage

Installation

git clone git@github.com:KR1470R/artos-messenger.git
cd artos-messenger

Create an .env.development file with variables in the following format(see ./backend/configs/.env.example):

APP_PORT=3000
DB_NAME=artosdb
DB_HOST=127.0.0.1
DB_PORT=3306
DB_USER=artos
DB_PASS=root
DB_MIN_CONN=1
DB_MAX_CONN=10
JWT_TOKEN_SECRET=secret
JWT_REFRESH_TOKEN_SECRET=secret

Running using Docker

Create docker container:

export NODE_ENV=development && docker-compose -f docker/docker-compose.yml --env-file .env.development up --build

Run database migrations when container is running:

export NODE_ENV=development && npm run migrate:up

Running without Docker

Install dependencies for frontend side and build it:

cd frontend
npm install
npm run build

Install dependencies for backend side:

cd ../backend
npm install

Run database migrations when DB is running(don't forget put your local DB creds into the created .env above):

export NODE_ENV=development && npm run migrate:up

Now run the application:

npm run build && npm run start:dev

After running the commands above, access http://localhost:3000/.

ERD Diagram

TODO

  • Create base Nest.js project
  • Create base React.js project
  • Create Docker container and build there the whole application
  • Implement DB schema & migrations
  • Implement App Authentication via JWT tokens on back-end side
  • Implement App Authentication via JWT tokens on front-end side
  • Implement endpoints for manage users, groups, chats, messages
  • Implement UI for manage users, groups, chats, messages
  • Implement chat websocket channel for real time messages sharing between users
  • Implement jwt guards over messages sockets
  • Implement files attachments(i.e photos, files, etc) (optionally)
  • Implement fully adaptive UI/UX
  • Create ERD Diagram
  • Integrate Swagger
  • Deploy the application demo to the server

Contribution

Feel free to create issues.

License