No description
Find a file
2026-10-07 15:17:40 +02:00
.idea initial commit 2026-10-04 16:20:07 +02:00
bin initial commit 2026-10-07 15:17:40 +02:00
cmd/go-mad initial commit 2026-10-07 15:17:40 +02:00
docs initial commit 2026-10-04 16:20:07 +02:00
helm/go-mad initial commit 2026-10-07 15:17:40 +02:00
internal initial commit 2026-10-07 15:17:40 +02:00
web initial commit 2026-10-07 15:17:40 +02:00
.dockerignore initial commit 2026-10-04 16:20:07 +02:00
.gitignore initial commit 2026-10-07 15:17:40 +02:00
config.example.yaml initial commit 2026-10-04 16:20:07 +02:00
docker-compose.yml initial commit 2026-10-07 15:17:40 +02:00
Dockerfile initial commit 2026-10-07 15:17:40 +02:00
go.mod initial commit 2026-10-04 16:20:07 +02:00
go.sum initial commit 2026-10-04 16:20:07 +02:00
Makefile initial commit 2026-10-07 15:17:40 +02:00

go-mad

A web application for managing tenant database connections and running migration scripts.

Overview

go-mad is a Go web application that helps administrators manage database connections for multiple tenants. When a new tenant is added, the application contains all the database connection information for the applications associated with that tenant. The frontend is built with React and provides a beautiful, intuitive interface for managing tenants, applications, and database migrations.

Features

  • Tenant Management: Create and manage tenants with their database connections
  • Application Management: Register and manage applications per tenant
  • Database Connection Management: Track database connections and status per tenant
  • Migration Scripts: Run goose-style SQL migration scripts per tenant database
  • Role-Based Access Control: System administrators and tenant-specific permissions
  • Beautiful React UI: Inspired by go-loose with dark/light theme support

Quick Start

Using Docker Compose

make compose-up

This will start:

  • PostgreSQL database (postgres:15-alpine)
  • go-mad application

Access the application at http://localhost:8080

Manual Development

# Format and vet
make fmt
make vet

# Build and run
make build
./go-mad

# Or run with docker compose
make compose-up

Configuration

go-mad can be configured via environment variables or a config.yaml file:

Variable Default Description
GO_MAD_DATABASE_URL postgres://mad:mad@localhost:5432/mad?sslmode=disable PostgreSQL connection string
GO_MAD_SERVER_PORT 8080 HTTP server port
GO_MAD_JWT_SECRET change-me-to-a-32-plus-char-secret JWT secret for authentication
GO_MAD_CONFIG_PATH config.yaml Path to YAML config file

config.yaml example

server:
  host: "0.0.0.0"
  port: "8080"

database:
  url: "postgres://mad:mad@localhost:5432/mad?sslmode=disable"

jwt:
  secret_key: "your-32-plus-char-secret-here"

API Endpoints

Dashboard

  • GET /api/v1/dashboard - Get dashboard data including tenants, applications, and databases

Tenants

  • GET /api/v1/tenants - List all tenants
  • POST /api/v1/tenants - Create a new tenant

Applications

  • GET /api/v1/applications - List applications for a tenant
  • POST /api/v1/applications - Register a new application

Databases

  • GET /api/v1/databases - List databases for a tenant
  • POST /api/v1/databases - Add a database connection for a tenant
  • POST /api/v1/databases/{id}/migrations - Run migrations for a database

Authentication

  • GET /login - Login page
  • POST /api/v1/auth/login - Authenticate

Development Workflow

# Build the Go binary
make build

# Build the React frontend
make web-build

# Start with docker compose
make compose-up

# View logs
make compose-logs

# Stop
make compose-down

Docker

Build

docker build -t go-mad:latest .

Push

docker push go-mad:latest

Kubernetes

Deploy using Helm:

helm repo add go-mad ./helm/go-mad
helm install go-mad go-mad/go-mad

License

MIT