simpleshout/README.md

66 lines
1.7 KiB
Markdown
Raw Normal View History

2024-09-24 14:09:38 +00:00
# SimpleShout
2024-09-24 14:06:01 +00:00
2024-09-24 14:09:38 +00:00
A small chat box API for use on public websites.
## Features:
- Basic permissions: admin vs everyone else
- Message creation
2024-09-24 14:19:38 +00:00
- Discord style emoji: [example](https://github.com/NervN/discord-emojis/blob/main/assets/UnicodeEmojis.json), [emojibase](https://emojibase.dev/)
2024-09-24 14:09:38 +00:00
- Message deletion (admin)
- Message sanitization
- Keyword filtering
- Responsive web UI
2024-09-24 15:40:13 +00:00
- Embed/iframe-able
2024-09-24 19:47:36 +00:00
## Deps
- rocket
- sled
- snowflake id
2024-09-24 15:40:13 +00:00
## API
2024-09-24 19:47:36 +00:00
- init: takes a cookie, returns a session (previous username, current channel, etc) if exits, else require login
- login: takes a username and IP, returns a session cookie
- create_channel: takes a cookie, channel name, and motd, returns a channel id
- channels: takes a cookie returns a list of channels and a preview message for each
- join: takes a cookie and channel id, returns `init_scrollback` previous messages, a sync rate, and a client identifier, or an error if username exists/is not allowed, or channel does not exist
- sync: takes a cookie and a last message id and returns all unseen messages.
2024-09-24 15:40:13 +00:00
- send: sends a message, returns a status
- login: accepts password, gives client admin perms if password is correct
- delete: takes an admin client identifier and a message id
- ban: bans a client
## Structs
- config
- admin_password
- ratelimit (req/min)
2024-09-24 19:47:36 +00:00
- `[reserved_username:ip_address]`
2024-09-24 15:40:48 +00:00
- `[banned_words]`
- `[banned_usernames]`
- `[banned_ips]`
2024-09-24 15:40:13 +00:00
- init_scrollback
- sync_rate
2024-09-24 19:47:36 +00:00
- channel
- id
- name
- motd
2024-09-24 15:40:13 +00:00
- message
2024-09-24 19:47:36 +00:00
- id
- channel_id
2024-09-24 15:40:13 +00:00
- client_id
- timestamp
- body
- client
- client_id
- username
- ip_address
- admin_perms
- banned
2024-09-24 19:47:36 +00:00
- ratelimit
- last_channel_id