Development Guide¶
Set up your local development environment.
Prerequisites¶
- Go 1.24+: Install Go
- Docker: Install Docker
- Make: Usually pre-installed on macOS/Linux
Setup¶
1. Clone Repository¶
2. Install Dependencies¶
This installs:
- Go module dependencies
- Development tools (golangci-lint, etc.)
- Git hooks
3. Start Services¶
Bash
# Start PostgreSQL and Redis
docker compose up -d postgres redis
# Or start everything including the app
make dev
4. Run the Application¶
Project Structure¶
Text Only
.
├── api/ # OpenAPI specification
├── cmd/ # Application entrypoints
│ ├── mcp-notify/ # Main server
│ ├── mcp-notify-cli/ # CLI tool
│ └── mcp-notify-mcp/ # MCP server
├── internal/ # Private packages
│ ├── api/ # HTTP server
│ ├── config/ # Configuration
│ ├── db/ # Database layer
│ ├── diff/ # Diff engine
│ ├── notifier/ # Notification senders
│ ├── poller/ # Registry poller
│ └── subscription/ # Subscription manager
├── pkg/ # Public packages
│ ├── client/ # Go SDK
│ └── types/ # Shared types
├── web/ # Frontend dashboard
└── docs/ # Documentation
Make Commands¶
| Command | Description |
|---|---|
make build | Build all binaries |
make test | Run tests |
make lint | Run linters |
make dev | Start development server |
make docker | Build Docker image |
make docs | Serve documentation locally |
make clean | Clean build artifacts |
Configuration¶
Copy the example config:
Key settings for development:
YAML
server:
port: 8080
database:
url: postgres://postgres:postgres@localhost:5432/mcp_notify?sslmode=disable
redis:
url: redis://localhost:6379
log:
level: debug
format: text
Database¶
Migrations¶
Bash
# Run migrations
make migrate-up
# Rollback
make migrate-down
# Create new migration
make migrate-create name=add_new_table
Reset Database¶
Testing¶
Unit Tests¶
Integration Tests¶
E2E Tests¶
Debugging¶
VS Code¶
Launch configuration is provided in .vscode/launch.json:
JSON
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Server",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/cmd/mcp-notify"
}
]
}
Delve¶
Documentation¶
Serve Locally¶
Build¶
Git Workflow¶
Branch Naming¶
feature/- New featuresfix/- Bug fixesdocs/- Documentationrefactor/- Code refactoring
Commit Messages¶
Follow Conventional Commits:
Text Only
feat: add telegram notification channel
fix: resolve race condition in poller
docs: update installation guide
refactor: simplify diff engine logic
Pull Request Process¶
- Create feature branch from
main - Make changes with tests
- Run
make lint test - Push and create PR
- Wait for CI and review
- Squash and merge