A simple chat server for maya's stream.
 
 
 
 
 
Go to file
~erin 0302f816ec
Create full message object out of sent message
2021-07-18 10:34:27 -04:00
src Create full message object out of sent message 2021-07-18 10:34:27 -04:00
.gitignore Initialize repo with basic functionality 2021-07-16 10:55:07 -04:00
Cargo.lock Backport to Rocket v0.4, fix all warnings & errors 2021-07-18 01:32:57 +01:00
Cargo.toml Backport to Rocket v0.4, fix all warnings & errors 2021-07-18 01:32:57 +01:00
README.md Add info about returning json 2021-07-18 10:16:55 -04:00

README.md

Chat Registration System

The basic backend code needed to register & login to a chat system (to be built). Send it the unhashed username and pin, and it'll store it in the users.json file with the pin hashed with SHA1.

API Documentation

POST /api/register/<name>/<pin>/<pronouns> Register the username with the pin provided if it doesn't already exist

GET /api/users/<name> Check if the user exists

GET /api/users/<name>/<pin> Check if the user exists, and if the pin provided matches

POST /api/users/change/<name>/<pin>/<new-name>/<new-pin> Change a users pin/name

GET /api/about/name/<name> Get's the name of a user, probably just for checking if they exist

GET /api/about/pronouns/<name> Get's the pronouns of a user

Chat Planning

Clientside js will register & check login of users, if login is correct will ask for a random token. Backend will generate token, store it, and then send it to the client to set as a cookie. Whenever user sends a message, client will send message & token and backend will check if token matches.

To-Do:

  • Basic auth api
  • Return json instead of string
    • status is main thing to deal with, ok/fail/panic
    • reason is for more details, mainly just for debugging?
  • Basic messaging system
    • Finish up chat::create_message()
    • Create chat::read_messages()
    • Create chat::delete_message()
    • Different types of message events? eg. default, announcement, command
    • Emote support?
  • Token generation & storage
    • API to refresh token
    • Store token in json
    • API to check token?
  • Pronouns
    • Change pronouns
    • Multiple sets of pronouns
  • Some form of plural support?
  • User management (banning, etc.)
  • Blacklist words from chat/names