Contributing to Kassie
Thank you for your interest in contributing to Kassie! This guide will help you get started.
Table of Contents
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Commit Guidelines
- Pull Request Process
- Code Style
- Testing
- Documentation
Code of Conduct
- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn and grow
- Assume good intentions
Getting Started
Prerequisites
Before contributing, ensure you have:
- Go 1.24+ - Download
- Node.js 20+ - For web UI development
- protoc - Protocol Buffer compiler
- Make - Build automation
- Git - Version control
Optional but recommended:
- Docker - For integration tests
- golangci-lint - Go linter
Fork and Clone
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/kassie.git
cd kassie- Add upstream remote:
git remote add upstream https://github.com/kashifKhn/kassie.gitDevelopment Setup
Initial Setup
Install dependencies and generate code:
# Install protoc plugins and tools
make setup
# Generate gRPC code (Go + TypeScript)
make protoBuild the Project
# Build full binary with embedded web UI
make build
# Build server only (no web assets)
make build-server
# Build web UI only
make webRun in Development Mode
# Run TUI in development mode
make dev-tui
# Run web UI with hot reload
make dev-web
# Run server only
make dev-serverMaking Changes
Branch Naming
Create a branch from main:
git checkout -b <type>/<description>Branch types:
feat/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringtest/- Test additions/changeschore/- Maintenance tasks
Examples:
feat/add-pagination-controlsfix/connection-timeout-issuedocs/update-api-reference
Development Workflow
- Make your changes in your feature branch
- Write tests for new functionality
- Run tests to ensure nothing breaks:
make test- Format code:
make fmt- Run linter:
make lint- Build the project to verify it compiles:
make buildCommit Guidelines
We use semantic commit messages:
Format
<type>(<scope>): <subject>
<body>
<footer>Types
feat- New featurefix- Bug fixdocs- Documentation onlystyle- Formatting, missing semicolons, etc.refactor- Code restructuring without behavior changetest- Adding or updating testschore- Maintenance tasks, dependenciesci- CI/CD changes
Scope
Optional, indicates what part of the codebase:
tui- Terminal UIweb- Web interfaceserver- Backend serverclient- gRPC clientapi- API definitionsdocs- Documentation
Examples
feat(tui): add row copy to clipboard
fix(server): handle connection timeout properly
docs(api): update authentication examples
test(client): add token refresh tests
chore(deps): update gocql to v1.6.0Commit Message Rules
- Use imperative mood ("add" not "added")
- No period at the end of subject
- Subject line max 72 characters
- Body wraps at 72 characters
- Reference issues in footer:
Fixes #123
Pull Request Process
Before Submitting
- Sync with upstream:
git fetch upstream
git rebase upstream/main- Run full test suite:
make test
make lintUpdate documentation if needed
Test manually in both TUI and Web (if applicable)
Submitting PR
- Push your branch:
git push origin <branch-name>Open PR on GitHub with:
- Clear title following commit conventions
- Description of changes
- Screenshots (for UI changes)
- Link to related issues
Fill out the PR template
PR Requirements
- ✅ All tests pass
- ✅ Linter passes
- ✅ No merge conflicts
- ✅ Documentation updated
- ✅ Commit messages follow guidelines
Review Process
- Maintainers will review your PR
- Address feedback in new commits
- Once approved, PR will be squash merged
- Your commits will be combined into one
Code Style
Go Code Style
General Principles:
- Self-documenting code through clear naming
- No comments unless absolutely necessary
- Small focused functions (max ~50 lines)
- Max 300 lines per file
Naming:
// Packages: lowercase single word
package service // not "services"
// Interfaces: verb-based
type Reader interface {} // not "IReader"
// Functions: verb-noun
func GetUser() {} // not "UserGet"
// Variables: camelCase
var userName string
// Exported: PascalCase
type User struct {}
// Unexported: camelCase
type session struct {}Error Handling:
// Wrap errors with context
if err != nil {
return fmt.Errorf("failed to connect: %w", err)
}
// Early returns
if invalid {
return ErrInvalidInput
}Structure Example:
type Service struct {
db Database
logger Logger
}
func NewService(db Database, logger Logger) *Service {
return &Service{db: db, logger: logger}
}
func (s *Service) GetUser(ctx context.Context, id string) (*User, error) {
if id == "" {
return nil, ErrInvalidID
}
// implementation
}TypeScript Code Style
Naming:
// Components: PascalCase
Sidebar.tsx
// Hooks: useCamelCase
useSession.ts
// Utilities: camelCase
formatDate()
// Types/Interfaces: PascalCase
interface UserProfile {}Patterns:
- One component per file
- Custom hooks for logic extraction
- Functional components only
- Strict null checks enabled
Testing
Running Tests
# All tests
make test
# Unit tests only
make test-unit
# Integration tests (requires Docker)
make test-int
# Specific package
go test ./internal/server/service/...
# Specific test
go test -run TestGenerateToken ./internal/server/service/
# With coverage
go test -cover ./...
# Verbose
go test -v ./internal/server/...Writing Tests
Test Coverage Required:
internal/server/service/*- All service methodsinternal/server/db/*- Query building, connection managementinternal/server/state/*- Session and cursor storesinternal/shared/config/*- Config loading and merginginternal/client/*- Token refresh, error handling
Test Style:
func TestUserService_GetUser(t *testing.T) {
tests := []struct {
name string
userID string
want *User
wantErr bool
}{
{
name: "valid user",
userID: "123",
want: &User{ID: "123"},
wantErr: false,
},
{
name: "empty id",
userID: "",
want: nil,
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// test implementation
})
}
}Test File Naming:
*_test.gofor unit tests//go:build integrationtag for integration tests
Documentation
When to Update Docs
Update documentation when you:
- Add new features
- Change CLI commands
- Modify configuration options
- Update API endpoints
- Change keyboard shortcuts
Documentation Location
- User docs:
docs/directory (VitePress) - API docs:
docs/reference/api.md - Code comments: Only for complex algorithms
Building Docs Locally
cd docs
npm install
npm run devVisit http://localhost:5173 to preview.
Documentation Standards
- Use clear, concise language
- Include code examples
- Add screenshots for UI changes
- Keep navigation up to date
- Test all internal links
Getting Help
Resources
- GitHub Issues: Bug reports and feature requests
- Discussions: Questions and general discussion
- Documentation: https://kassie.kashifkhan.dev
Asking Questions
When asking for help:
- Search existing issues first
- Provide context (OS, Go version, etc.)
- Include error messages
- Share minimal reproduction steps
- Be patient and respectful
Areas to Contribute
Good First Issues
Look for issues labeled:
good first issue- Beginner friendlyhelp wanted- Extra attention neededdocumentation- Doc improvements
High Priority
Current focus areas:
- Web UI completion (Phase 5)
- Additional themes for TUI
- Performance optimizations
- Test coverage improvements
- Documentation enhancements
Feature Requests
Before implementing new features:
- Check if issue exists
- Create feature request issue
- Discuss approach with maintainers
- Wait for approval before coding
License
By contributing, you agree that your contributions will be licensed under the MIT License.
Recognition
Contributors will be:
- Listed in release notes
- Credited in CONTRIBUTORS file
- Mentioned in documentation (for significant contributions)
Thank you for contributing to Kassie! 🚀