A real-time chat application built with Go (Fuego) backend and a modern frontend.
microchat/
├── app/ # Frontend application
├── cmd/ # Application entry points
│ ├── server/ # API server
│ └── cli/ # CLI tool
├── internal/ # Private application code
│ ├── handlers/ # HTTP request handlers
│ ├── models/ # Data models
│ ├── services/ # Business logic
│ ├── repository/ # Data storage
│ ├── middleware/ # HTTP middleware
│ └── config/ # Configuration
├── pkg/ # Public packages
│ └── client/ # API client library
├── static/ # Built frontend files (served by API)
├── scripts/ # Build and deployment scripts
├── Dockerfile # Docker configuration
├── docker-compose.yml # Docker Compose configuration
└── Makefile # Build automation
- Go 1.23+
- Node.js 20+
- Docker (optional)
- Install dependencies:
make install- Copy environment variables:
cp .env.example .envRun in development mode (frontend dev server + Go server):
make devBuild everything:
make buildRun the server:
make runOr build and run specific components:
make build-frontend
make build-server
make build-cliPull and run the latest image:
docker pull ghcr.io/ewenquim/microchat:latest
docker run -p 8080:8080 ghcr.io/ewenquim/microchat:latestBuild Docker image:
make docker-buildRun with docker-compose:
make docker-upStop:
make docker-downThe CLI tool allows you to interact with the chat API from the command line.
Send a message:
./bin/cli -cmd send -room general -user john -message "Hello, world!"List messages in a room:
./bin/cli -cmd list -room generalList all rooms:
./bin/cli -cmd roomsGET /api/rooms- List all chat roomsGET /api/rooms/:room/messages- Get messages from a roomPOST /api/rooms/:room/messages- Send a message to a room
PORT- Server port (default: 8080)ENV- Environment (development/production)
The project includes GitHub Actions workflows for:
-
CI (
ci.yml): Runs on PRs and pushes- Tests Go code (server & CLI)
- Builds frontend
- Runs with race detection and coverage
-
Lint (
lint.yml): Go code linting with golangci-lint- Strict on PRs (blocks merge on issues)
- Warnings only on main/master
-
Docker Publish (
docker-publish.yml): Builds and pushes to GHCR- Triggers on push to main/master or version tags
- Automatic tagging:
latest,v1.0.0,v1.0,v1 - Published to:
ghcr.io/ewenquim/microchat
To create a new release:
git tag v1.0.0
git push origin v1.0.0This will automatically build and push the Docker image with version tags.
Remove build artifacts:
make clean