Skip to main content

Technology Stack

Dokumentasi lengkap library, framework, dan tools yang digunakan di MStore Backend Go.

🎯 Core Stack

Web Framework

GoFiber v2.52

Fast HTTP framework built on Fasthttp
  • Express-like API
  • Zero memory allocation router
  • Built-in middleware support

Fasthttp v1.65

High-performance HTTP engine
  • 10x faster than net/http
  • Zero-allocation design
  • Connection pooling
Usage:

Database

GORM v1.30

ORM library untuk Go
  • Auto migrations
  • Associations & preloading
  • Hooks & callbacks
  • Soft deletes

MySQL Driver v1.8

Official MySQL driver
  • Connection pooling
  • Prepared statements
  • Transaction support
Usage:

MongoDB Driver v1.17

Official MongoDB driver
  • BSON support
  • Aggregation pipeline
  • Change streams

Redis v9.7

Redis client untuk Go
  • Pipelining
  • Pub/Sub
  • Cluster support

Authentication & Security

JWT v5.2

JSON Web Token implementation
  • HS256, RS256 support
  • Claims validation
  • Token refresh

Crypto

Go cryptography library
  • bcrypt password hashing
  • AES encryption
  • TLS support
Usage:

πŸ“‘ External Integrations

Payment Gateway

Resty v2.16

HTTP client untuk API calls
  • Automatic retry
  • Request/response middleware
  • Debug logging
Providers:
  • Xendit: QRIS, E-Wallet, VA, Credit Card
  • Midtrans: Snap API, Core API
Usage:

Message Broker

NATS v1.44

Cloud-native messaging
  • Pub/Sub
  • Request/Reply
  • Queue groups

RabbitMQ v1.10

Message queue broker
  • AMQP 0.9.1
  • Reliable delivery
  • Dead letter queues

Kafka v0.4

Event streaming platform
  • High throughput
  • Partitioning
  • Consumer groups
Usage (NATS):

IoT & Real-time

MQTT v1.5

MQTT client untuk IoT
  • QoS levels
  • Retained messages
  • Last will & testament

WebSocket v1.3

WebSocket support untuk Fiber
  • Real-time bidirectional
  • Connection pooling
  • Auto reconnect
Use Cases:
  • MQTT: QRIS payment notification real-time
  • WebSocket: Live order updates, stock alerts

πŸ” Observability (LGTM Stack)

Logging

Zap v1.27

Structured logging
  • Zero-allocation
  • JSON output
  • Log levels

ECS Zap v1.0

Elastic Common Schema
  • Standardized format
  • Loki integration
Usage:

Tracing

OpenTelemetry v1.34

Distributed tracing
  • Span creation
  • Context propagation
  • Trace sampling

Jaeger Client v2.30

Jaeger tracing client
  • Trace visualization
  • Service dependencies
  • Performance analysis
Usage:

Metrics

OpenTelemetry Metrics v1.34

Metrics collection & export
  • Counter, Gauge, Histogram
  • OTLP export to Mimir
  • Custom metrics
Usage:

πŸ› οΈ Development Tools

Code Quality

Swaggo v1.16

Swagger documentation
  • Auto-generate from comments
  • OpenAPI 3.0 support

Validator v10.23

Struct validation
  • Tag-based rules
  • Custom validators

Testify v1.10

Testing toolkit
  • Assertions
  • Mocking
  • Test suites
Usage (Validator):

Testing

Godog v0.15

BDD testing framework
  • Gherkin syntax
  • Feature files
  • Step definitions

Pact v2.4

Contract testing
  • Consumer-driven contracts
  • Provider verification
Usage (Godog):

CLI & Configuration

Cobra v1.9

CLI framework
  • Commands & subcommands
  • Flags & arguments

Godotenv v1.5

Environment variables
  • .env file loading

Env v6.10

Struct-based config
  • Tag-based parsing
Usage (Cobra):

πŸ“¦ Utilities

Data Processing

Excelize v2.9

Excel file processing
  • Read/Write XLSX
  • Formulas & styles

UUID v1.6

UUID generation
  • v4 random UUIDs

QR Code v2.2

QR code generation
  • PNG/JPEG output
  • Custom styling
Usage (Excelize):

Internationalization

go-i18n v2.4

Internationalization support
  • Message translation
  • Pluralization
  • Locale detection
Usage:

πŸ”₯ Firebase & Cloud

Firebase Admin v3.13

Firebase Admin SDK
  • Firestore
  • Authentication
  • Cloud Messaging

AWS SDK v1.55

AWS SDK untuk Go
  • S3 storage
  • SQS queues
  • SNS notifications

πŸ“Š GraphQL

gqlgen v0.17

GraphQL server library
  • Schema-first approach
  • Code generation
  • Subscriptions support
Usage:

🎨 Expression & Rules Engine

Expr v1.17

Expression language
  • Dynamic rule evaluation
  • Type-safe expressions
  • Custom functions
Usage:

πŸ“ˆ Version Matrix


πŸš€ Performance Characteristics

Benchmarks


πŸ’‘ Best Practices

DO βœ…

  • Use connection pooling untuk database & Redis
  • Implement circuit breaker untuk external APIs
  • Use context timeout untuk semua operations
  • Enable OpenTelemetry instrumentation
  • Use structured logging (Zap)
  • Implement graceful shutdown
  • Use dependency injection

DON’T ❌

  • Jangan hardcode credentials
  • Jangan skip error handling
  • Jangan block goroutines indefinitely
  • Jangan ignore context cancellation
  • Jangan log sensitive data
  • Jangan skip input validation

Service Template

Template service dengan best practices

API Styleguide

Panduan API design & conventions

Testing Guide

Unit, integration, dan E2E testing

Observability

LGTM stack setup & monitoring

Need Help? Contact backend team atau check GitHub Issues