-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from onfranciis/dev
feat: add README and LEARN mds
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Chatvoid Server | ||
|
||
<p style="background-color: #ff3333; color: white; font-style: italic; width: fit-content; padding: 1px 7px; border-radius: 5px">No socket.io</p> | ||
|
||
--- | ||
|
||
For you to understand this, a basic knowledge of TypeScript and web socket is required. | ||
|
||
<br> | ||
|
||
For every new connection, a new user is created via the class User and the connection details alongside the ID generated via uuid is sent to the users object in `/utils/user.ts` and a stringified json is sent to all connected clients. Data sent or received are in this format | ||
|
||
``` | ||
{ | ||
type: "users" | "message" | "notification" | "to_everyone", | ||
message: string | ||
} | ||
``` | ||
|
||
When a client disconnects, the currently connected users is sent to all available clients and the previous client property is deleted from the users object in `/utils/user.ts` | ||
|
||
<br> | ||
|
||
<p align="center" style="background-color: rgba(255,255,255, 0.2); border-radius: 3px" > | ||
Kindly give this repo a star 🌟 | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Chatvoid Server | ||
|
||
<p style="background-color: #ff3333; color: white; font-style: italic; width: fit-content; padding: 1px 7px; border-radius: 5px">No socket.io</p> | ||
|
||
--- | ||
|
||
This repository contains the source code for a chatroom web socket built in TypeScript for a NodeJs server without socket\.io. Feel free to glance through this project and suggest changes via issues. Learn how this works [here](./LEARN.md) | ||
|
||
Kindly give this repo a star :star: | ||
|
||
## Tools | ||
|
||
![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white) | ||
![Nodemon](https://img.shields.io/badge/NODEMON-%23323330.svg?style=for-the-badge&logo=nodemon&logoColor=%BBDEAD) | ||
![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white) | ||
![VS Code Insiders](https://img.shields.io/badge/VS%20Code%20Insiders-35b393.svg?style=for-the-badge&logo=visual-studio-code&logoColor=white) | ||
![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black) |