Golang · Clean Architecture · REST and WebSocket
Realtime Chat
A production-oriented chat backend providing authentication, friendships, groups, and real-time messaging. Gin exposes REST endpoints, while Gorilla WebSocket maintains group subscriptions and delivers messages to connected members. JWT access tokens work with refresh tokens stored in HttpOnly cookies. Attachments are stored separately and embedded SQL migrations prepare PostgreSQL during startup.
The API entry point assembles HTTP and WebSocket delivery, use cases, domain contracts, PostgreSQL adapters, and file storage. Domain logic does not depend on Gin or GORM. A WebSocket hub manages connections and subscriptions, while repositories own persistence concerns.
Tech stack
Architecture
Clean Architecture · REST and WebSocket
The API entry point assembles HTTP and WebSocket delivery, use cases, domain contracts, PostgreSQL adapters, and file storage. Domain logic does not depend on Gin or GORM. A WebSocket hub manages connections and subscriptions, while repositories own persistence concerns.
Core capabilities
- Registration, sign-in, and automatic post-registration access
- JWT access and HttpOnly refresh tokens
- Friend requests and friendship management
- Group and membership management
- Real-time group messaging
- File uploads and message attachments
- Embedded database migrations
- CORS and delivery-layer validation