Skip to content

Commit

Permalink
Merge pull request #2 from onfranciis/dev
Browse files Browse the repository at this point in the history
feat: add README and LEARN mds
  • Loading branch information
onfranciis authored Sep 25, 2023
2 parents bcefdcf + 15a441e commit 2981334
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
26 changes: 26 additions & 0 deletions LEARN.md
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>
17 changes: 17 additions & 0 deletions README.md
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)

0 comments on commit 2981334

Please sign in to comment.