Real-time chat application.
The HTTP REST API docs illustrated via Swagger UI here.
Production REST API URL - https://artos-messanger.xyz/api/v1/
Production Websocket URL - https://artos-messanger.xyz/{namespace}
Note, you should to use socket.io to interact with it.
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.
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.
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:
When client connected and joined to the chat, the WS server is ready to listen for events and process operations.
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
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
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/.
- 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
Feel free to create issues.