- Fork the repository
- Clone your fork:
git clone <your-fork-url> - Create
.envfrom.env.example - Install Go 1.19+
- Run:
docker-compose up --buildormake run
- Create feature branch:
git checkout -b feature/your-feature - Make changes
- Run tests:
make test - Format code:
make fmt - Commit with clear message
- Push and create PR (see PR Guidelines below)
- Follow Go conventions and
gofmt - Write unit tests for new functions
- Use meaningful variable and function names
- Keep functions small and focused
- Handle errors properly
- Add comments for exported functions
- Tests pass (
make test) - Code is formatted (
make fmt) - No hardcoded credentials
- WebSocket connections work
- Go.mod updated if needed
- Docker setup works
Use conventional commit format: type(scope): description
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasksperf: Performance improvements
Examples:
feat(websocket): add message rate limitingfix(connection): resolve memory leak in hubperf(database): optimize message queriesrefactor(handlers): improve error handling
- Clearly describe what changes were made
- Include performance impact if applicable
- Reference related issues using
Fixes #123 - List any breaking changes
- Mention if go.mod was updated
feature/feature-name- New featuresfix/bug-description- Bug fixesdocs/documentation-update- Documentationperf/performance-improvement- Performance optimizationsrefactor/component-name- Refactoring
- Test with multiple concurrent connections
- Verify message delivery and ordering
- Check memory usage under load
- Ensure proper connection cleanup
- Test reconnection scenarios
cmd/server/- Application entry pointinternal/config/- Configuration managementinternal/handlers/- HTTP and WebSocket handlersinternal/hub/- WebSocket connection managementinternal/models/- Data structuresinternal/database/- Database operations