https://github.com/paradoxinversion/chat-app-client-experiment
Created with CodeSandbox
https://github.com/paradoxinversion/chat-app-client-experiment
Last synced: about 1 year ago
JSON representation
Created with CodeSandbox
- Host: GitHub
- URL: https://github.com/paradoxinversion/chat-app-client-experiment
- Owner: paradoxinversion
- Created: 2020-01-25T07:37:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T05:48:03.000Z (over 3 years ago)
- Last Synced: 2025-01-20T05:51:12.627Z (over 1 year ago)
- Language: CSS
- Homepage: https://codesandbox.io/s/github/paradoxinversion/chat-app-client-experiment
- Size: 1.84 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chat Client
This is a client for a simple chat room, using socketio. Right now there is one main room, and users can send private messages to other users.
## Development
Install dependencies via `npm` or `yarn`.
## Environment
Copy .env.example and change values as necessary. This version uses .env for local development and now.json for env vars on production in Zeit.
### Scripts
#### start
Starts the server in development mode
## Socket Events
This project interacts with socketio via `socket.io-client`.
### on-events
`connection`: Add a new chat client
`chat-message-broadcast`: Fires when the server emits `chat-message-broadcast` (when a user has posted a message to general chat)
`user-connected`: Fires when a user has been connected, returned data is the socket's corresponding user object.
`room-user-change`: Fires when a user enter or leaves the main chat.
`pm`: Adds a pm to the client's privateChatMessages map
### emit-events
`chat-message-sent`: sends a chat message to the server-- whether it is private or public depends on whether ot not `to` is defined in the message object.
`private-chat-initiated` (socket): Sends an event to initiate a private chat, which includes the socketid of the user to chat with
## AuthN/AuthZ
The chat is authorized via json webtokens secured on a cookie. _Needs work_.
## TODO
- Blocking of PMs
- All Users
- Individual users
- Filtering Messages in chat
- By User
- By text in message
- Moderation
- Word filter
- Word