https://github.com/iamrafaelmelo/gochatty
A simple Golang websocket chat powered by Fiber Framework.
https://github.com/iamrafaelmelo/gochatty
chat fiber framework golang websocket
Last synced: about 3 hours ago
JSON representation
A simple Golang websocket chat powered by Fiber Framework.
- Host: GitHub
- URL: https://github.com/iamrafaelmelo/gochatty
- Owner: iamrafaelmelo
- Created: 2024-11-02T17:52:51.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2026-04-06T22:15:16.000Z (5 days ago)
- Last Synced: 2026-04-12T03:42:24.963Z (about 3 hours ago)
- Topics: chat, fiber, framework, golang, websocket
- Language: Go
- Homepage:
- Size: 302 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go Chatty

> [!WARNING]
> This project is not production-ready, but contributions still are welcome.
## Requirements
- Go >=1.25
- Docker
- Node & NPM
- Make
## Local development
Install dependencies:
```sh
npm install # install frontend dependencies
npm run build # build React + Tailwind static assets once
npm run dev # run Vite dev server (optional)
go run ./cmd/main.go # run the Go server against built static files
# Or use the existing Make target for the Go app
make run
```
Set `APP_WEBSOCKET_URL` before building the frontend. It is required and must be a full websocket URL including protocol, for example `ws://localhost:8080/ws`.
## Setup for Production environment
The production image builds frontend assets, compiles the Go binary in a separate stage, and ships only the binary plus static assets in a minimal `scratch` runtime image.
Build the image:
```sh
docker build -t gochatty .
```
Run the container:
```sh
docker run --rm -p 8080:8080 \
-e APP_PORT=8080 \
-e APP_WEBSOCKET_URL=wss://0.0.0.0:8080/ws \
-e APP_ALLOWED_ORIGINS=http://0.0.0.0:8080 \
-e APP_ENV=production \
gochatty
```
Then access `http://0.0.0.0:8080`.
## Notes
- The production image runs as a non-root user.
- `APP_ALLOWED_ORIGINS` must include the browser origin that will open the websocket connection.
- `APP_WEBSOCKET_URL` is required for the frontend build and must be a full websocket URL, for example `ws://localhost:8080/ws` or `wss://chat.example.com/ws`.
- The current root `Dockerfile` is intended for production-style builds and deployment.