Customer Relationship Management (CRM) service for QueueBuster. This service manages customer data including customer groups, customer information, and customer addresses.
- Customer Groups: Organize customers into logical groups with custom names and codes
- Customer Management: Full CRUD operations for customer data with flexible attributes
- Customer Addresses: Support for multiple billing and shipping addresses per customer
- RESTful API: Clean REST API design with Swagger documentation
- Go 1.25.1 or later
- PostgreSQL 15+
- Redis (optional, for caching)
cd /path/to/qb-crm
cp .env.example .env
# Edit .env with your configurationgo mod tidy# Create database
createdb qb_crm
# Run schema
psql -h localhost -U postgres -d qb_crm -f schema/schema.sql# Development mode
make run
# Or with Docker
make docker-upOpen http://localhost:8086/api/public/crm/swagger/index.html
qb-crm/
├── cmd/
│ └── main.go # Application entry point
├── internal/
│ ├── config/ # Configuration management
│ ├── dto/ # Data Transfer Objects
│ ├── helpers/ # Utility functions
│ ├── models/ # Database models
│ ├── repository/ # Data access layer
│ │ ├── postgres/ # PostgreSQL implementations
│ │ └── remote/ # Remote service clients
│ ├── services/ # Business logic
│ ├── transport/
│ │ └── http/
│ │ ├── handlers/ # HTTP handlers
│ │ └── routes/ # Route definitions
│ └── utils/ # Common utilities
├── docs/ # Swagger documentation
├── schema/ # Database schemas
├── deployment/ # Docker files
├── scripts/ # Build scripts
├── go.mod
├── go.sum
├── Makefile
└── README.md
POST /api/public/crm/v1/customer-groups- Create a customer groupGET /api/public/crm/v1/customer-groups/:id- Get a customer groupGET /api/public/crm/v1/customer-groups/organization/:organization_id- List customer groupsPUT /api/public/crm/v1/customer-groups/:id- Update a customer groupDELETE /api/public/crm/v1/customer-groups/:id- Delete a customer group
POST /api/public/crm/v1/customers- Create a customerGET /api/public/crm/v1/customers/:id- Get a customerGET /api/public/crm/v1/customers/organization/:organization_id- List customersPUT /api/public/crm/v1/customers/:id- Update a customerDELETE /api/public/crm/v1/customers/:id- Delete a customer
POST /api/public/crm/v1/customers/:customer_id/addresses- Create an addressGET /api/public/crm/v1/customers/:customer_id/addresses- List customer addressesGET /api/public/crm/v1/customers/:customer_id/addresses/:address_id- Get an addressPUT /api/public/crm/v1/customers/:customer_id/addresses/:address_id- Update an addressDELETE /api/public/crm/v1/customers/:customer_id/addresses/:address_id- Delete an address
Configuration is managed via environment variables. See .env.example for available options.
Key configurations:
SERVER_PORT- HTTP server port (default: 8086)DB_*- PostgreSQL connection settingsREDIS_*- Redis connection settings
make swaggermake testmake build-prodApache 2.0