This chat application was a learning tool to experiment with websockets and concurrency. I started it as a long-term project to make my own implementation of the matrix.org protocols based on element.io. In its present state, it is a simple chat room application with user authentication that secures critical endpoints with same-site, HTTP Only JWTs to prevent XSS.
The next step in the project will be implementing end-to-end encryption. My current plan is to utilize Go compiled to WASM in the frontend for all encryption and decryption.
It has an accompanying Next.js based frontend located here. A live demo does not yet exist.
- user authentication
- custom user avatars
- user nicknames
- persisted chat room messages
- chat room creation/deletion
- Use
docker-compose.yml
to "compose up" the Postgres container.- ENV variables: See the included .env.sample.
- Run
go build
- Run
./chat
- That's all it takes to start up the backend!
- The app utilizes GORM, so there is minimal configuration needed to get PostgreSQL running properly!
- By default, there is no user accounts made upon creation. To create one, utilize the
createClient
endpoint referenced here in therouter/router.go
package, and defined here in thehandler/client.go
package. - All user passwords are stored in the DB as a hash.
- The
.env.sample
and includeddocker-compose.yml
will work together out of the box. You will want to set your ownSECRET
variable though!
- User permissions
- Banning/booting other users
- Rooms creation/deletion
- Sending files/images via chat
- E2E encryption using Go WASM on the frontend.