Musix-Backend
Cloud-native Go microservices backend for music streaming, powered by gRPC, Kubernetes, and full observability.
Go
Postgres
kubernetes
elastic search
AWS
GraphQL
grafana
Musix-Backend
A cloud-native microservices backend engineered in Go for a music streaming platform.
Musix decouples core streaming domains—content ingestion, catalog indexing, user accounts, personalized preferences, and audio playback—into independent services communicating over HTTP and gRPC. Built for both rapid local development and production Kubernetes deployments via Helm, the platform integrates Elasticsearch for search, PostgreSQL for relational persistence, and Prometheus with Grafana for end-to-end observability.
Technology Stack
- Backend & RPC: Go, gRPC
- Containerization & Orchestration: Docker, Docker Compose, Kubernetes, Helm, Bash
- Data & Search: PostgreSQL, Elasticsearch, Kibana (ELK / ECK Stack)
- Observability: Prometheus, Grafana
Architecture
Musix follows a domain-driven microservices architecture where each service owns a specific capability and exposes HTTP and/or gRPC interfaces depending on latency and internal communication needs.
Services
| Service | Protocol / Port | Responsibility |
|---|---|---|
service-content | HTTP (3333) | Content management and ingestion |
service-catalog | HTTP (3334) | Music catalog indexing and discovery |
service-user | HTTP (3335) / gRPC (3336) | User authentication, profiles, and internal user RPCs |
service-userchoice | HTTP (3337) / gRPC (3001) | User preferences, likes, playlists, and recommendation signals |
service-playback | HTTP (3338) | Audio streaming and playback session handling |
Infrastructure & Observability
- Elasticsearch & Kibana: Full-text music search, ingestion pipelines, and log exploration.
- PostgreSQL: Primary relational data store for user accounts, preferences, and metadata.
- Prometheus & Grafana: Metrics scraping, service health monitoring, and real-time performance dashboards.
Getting Started
Running the Full Stack (Docker Compose)
Start the entire application stack using the initialization script inside cmd:
cd cmd
./init up appLoading Content into Elasticsearch
- Generate an API key from Elasticsearch and add it to your environment configuration files under
envs/*. - Execute the
.httprequest files located inelastic/elastic-setupto initialize indices, ingestion pipelines, and sample catalog resources.
Local Development Setup
For active development on individual microservices without rebuilding containers:
- Boot up the Elasticsearch (ECK) infrastructure dependencies:
cd cmd
./init up eck- Navigate to the target microservice directory and run it locally with live reloading using
air:
airService Endpoints
Depending on your deployment environment, services are reachable via the following internal and external endpoints:
Host Machine (Local)
| Service | Endpoint |
|---|---|
service-content | http://localhost:3333 |
service-catalog | http://localhost:3334 |
service-user | http://localhost:3335 |
service-user-grpc | tcp://localhost:3336 |
service-userchoice | http://localhost:3337 |
service-playback | http://localhost:3338 |
elasticsearch | http://localhost:9200 |
kibana | http://localhost:5601 |
grafana | http://localhost:3000 |
prometheus | http://localhost:9090 |
Docker Compose Network
| Service | Internal Endpoint |
|---|---|
service-content | http://service-content:3000 |
service-catalog | http://service-catalog:3000 |
service-user | http://service-user:3000 |
service-user-grpc | service-user:3001 |
service-userchoice | http://service-userchoice:3000 |
service-userchoice-grpc | http://service-userchoice:3001 |
elasticsearch | http://elastic:9200 |
postgres-db | db:5432 |
grafana | http://grafana:3000 |
prometheus | http://prometheus:9090 |
Kubernetes Cluster (Helm / ECK)
| Service | Cluster DNS |
|---|---|
service-content | http://svc-content.default.svc.cluster.local |
service-catalog | http://svc-catalog.default.svc.cluster.local |
service-user | http://svc-user.default.svc.cluster.local |
service-userchoice | http://svc-userchoice.default.svc.cluster.local |
elasticsearch | https://elasticsearch-es-default.eck.svc.cluster.local:9200 |
postgres-db | postgres-postgresql.default.svc.cluster.local:5432 |
grafana | https://grafana.monitoring.svc.cluster.local |
prometheus | https://prometheus.monitoring.svc.cluster.local |