MiniChat is a chat server that is both lightweight to host and easy to use. There are no accounts, so it can be spun up as an easy way to chat with friends whom you might not be able to message otherwise. Perfect for messaging your friends during class! (use wisely)
Features:
- Chat history and persistance: The last 100 messages are saved in memory
- Autolinking: Links and Images are automatically converted to their HTML representation
The chat uses WebSockets for transport and has a Rust backend.
No followers yet
Once you ship this you can't edit the description of the project, but you'll be able to add more devlogs and re-ship it as you add new features!
I replaced the markdown support with a simpler autolinking implementation that's lighter, doesn't have the same vulns, is easier to use, and just generally works better.
I added Markdown support! I used the comrak parser because it had most of the features I wanted. It took a couple of attempts to get the rendering working in a way that wouldn't look super ugly. The solution I have rn is a bit jank, but it works.
(i just realised that due to the way I've been coding it, not having the markdown feature enabled actually opens up a big attack vector. I should probably fix that...)
A few small changes! Added some stuff to communicate to the user when the client is disconnected. Also reverted some stuff with the layout that was causing a bug.
I added support for push notifications, as well as made some changes to make it work a little better on mobile (there's still some jank though). I feel comfortable shipping the program as most of the core features are here. Go check out the demo!
I added a settings menu! I was also going to add notifications but it turns out you need to be in a secure context (meaning HTTPS) so I'll wait until I have a public instance I can test with before I work on that.
I added chat history! MiniChat now saves the last n (by default 100) chat messages and system events in a VecDeque that gets sent to the client when they first join. This could also be useful to implement behaviours for if the client's connection gets dropped.
Added a bunch of small features! A lobby that's always available, chat scrolling, a new home page, and remembering the last username you used.
I made the chat page look a lot nicer based on the Figma designs and some client feedback. It should be usable on mobile as well!
Used Figma to make some layout designs! I can only upload one, but there's another potential layout
I ended up going with the second option - using one WS endpoint with the query params. I think this was probably the most elegant design overall.
I've now added a room list that shows all the current rooms. The room names automatically encode special characters, so you can use non-latin characters. It's kinda ugly but that will be the next thing I work on.
Was busy for a week, but I'm back! Implemented the room system as a JSON message that gets sent to the server internally. I'm not sure which of these systems I prefer most... I'll probably mull it over for a little bit.
Changed the system from the last devlog to use one WS endpoint, and get the room code from query parameters. I think I prefer having just one endpoint...
(ignore my bad code)
Added the basics of a multi-room system where each room has it's own WS endpoint /room/roomname/ws. I'm not sure if I want to go with this or using some parameters, either in the http query params or sent other as JSON when you first connect (that's how I'm currently sending username info)
Added a list that keeps track of the people in a room. To do this in a memory-safe way, I used a Mutex, which only allows one thread/task to access memory at a time, and prevents poisoning. The way Rust does this took me a bit to get used to; the Mutex drops access to the data at the end of the current block, so I found I had to { enclose some of my code in it's own block } to get things to work right. I might be doing something wrong here, though.
Switched to using JSON for structured data :)
The Event enum implements Into so it's even more ergonomic than using Strings!
I've got a basic example working! I'm using Axum as a web framework and have pilfered most of the code from the 'chat' example. I understand how most of it works, but I think I should leave some notes for myself.