Skip to content

Yanyu0203/ginChat

Repository files navigation

ginChat

  • Implemented a instant messaging platform using Go and WebSocket, facilitating various functionalities including user registration, login, adding contacts, message sending and reception, etc.
  • Enabled both private and group chatting, along with handling diverse message formats such as text, voice, images, and emoji.
  • Utilized the Gin and go-swagger for web API implementation and testing.
  • Employed channels and goroutines to enhance system concurrency and real-time responsiveness, ensuring a seamless user experience.
  • Leveraged MySQL for the storage of fundamental user and group information, with GORM utilized for efficient database manipulation.
  • Applied Redis for caching historical data, optimizing system performance and data retrieval efficiency.

Building Environment

go 1.20
MySQL
Redis
If you want to build and run this application in your local environment. Please make sure you have environments mentioned above. And then you should update app.yml according your environment
image
And then run build.bat (for windows, build.sh for Linux) to build the application. You can access to the system in localhost:8081

Functions

User Registration

image

User Login

image

Contacts List

image

Group Chat List

image

Chat Page

image

Test

Tools: JMeter
Test machine: personal laptop(AMD R7 4800H)
I first tested in normal case with 300 threads for 10 loops, achieving 5000+ TPS. The setting and results are as followed
set2
test1
Then I tested 300 user visited at the same time. The setting and results are as followed
set1
test2

Reference

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published