https://github.com/alextanhongpin/chat-playground
Simple standalone chat app with shareable link, inspired by go-playground
https://github.com/alextanhongpin/chat-playground
chat chat-server go golang gorilla websocket
Last synced: 3 months ago
JSON representation
Simple standalone chat app with shareable link, inspired by go-playground
- Host: GitHub
- URL: https://github.com/alextanhongpin/chat-playground
- Owner: alextanhongpin
- Created: 2018-10-28T10:45:59.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-01T16:07:25.000Z (almost 7 years ago)
- Last Synced: 2025-03-24T16:38:33.069Z (7 months ago)
- Topics: chat, chat-server, go, golang, gorilla, websocket
- Language: JavaScript
- Size: 102 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# chat-playground
A stateless chat app that is inspired by play.golang, with sharable links for others to join the room. Once all users leave the room, the room and the messages will be deleted.

## Requirements
Functional requirements:
- System should allow users to chat with another user
- System should store the conversations of the users
- System should notify users when another user join the group
- System should tolerate refresh from frontendNon-functional requirements:
- System should be stateful (no database, just in-memory)Extended requirements:
- Should encrypt conversations (e.g. with Signal Protocol)
- Should notify users when another user is typing
- Should send notification to user that is offline
- Should allow users to upload files## Capacity Estimation and Constraints
We can easily interpolate the results by just taking a base estimate of 100 msg/second and msg size of 72 bytes (can be estimated by taking the `unsafe.Sizeof(msgStruct)`).
Amount:
```
1 second = 100 msgs
1 month = 259,200,000 msgs (259.2M)
```Traffic Read/Write:
```
read:write ratio = 100:1
10,000 msg/s : 100 msg/s
```Storage:
```
Not required, as everything is in-memory
```Bandwidth:
```
read:write ratio = 100:1
write: 7KB/s
read: 0.7MB/s
```Memory:
```
Persisted for one day
100 * 86400 * 72 bytes ~= 595MB
```