Skip to content

darcy132/StageRequest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KTVRequest - KTV Song Request System

Go Version PostgreSQL Redis License

A high-performance Go backend for KTV song request systems with multi-role support and payment integration.

FeaturesArchitectureQuick StartAPI Docs

🎵 Overview

KTVRequest is a modern, scalable backend system for KTV venues and live streaming platforms. Built with Go, it provides robust APIs for song requests, payment processing, and real-time notifications.

✨ Features

👥 Multi-Role System

  • Administrators: Manage songs, orders, performers, and analytics
  • Customers: Browse songs, make requests, process payments
  • Performers: Accept/reject requests, manage performance status

💳 Payment Integration

  • Multiple payment provider support
  • Secure transaction handling
  • Webhook processing for payment confirmation

🔧 Technical Features

  • JWT-based authentication with refresh tokens
  • Redis caching for performance
  • Kafka messaging for real-time events
  • Rate limiting and security middleware
  • Comprehensive logging and monitoring

🏗 Project Structure

ktvrequest/
├── cmd/                 # Application entry points
│   ├── server/         # Main API server
│   ├── migrate/        # Database migrations
│   ├── seed/           # Data seeding
│   └── init-db/        # Database initialization
├── internal/           # Private application code
│   ├── handlers/       # HTTP request handlers
│   ├── services/       # Business logic layer
│   ├── models/         # Data models and repositories
│   ├── middleware/     # HTTP middleware
│   ├── config/         # Configuration management
│   ├── cache/          # Redis caching
│   ├── messaging/      # Kafka event handling
│   ├── notify/         # Notification services
│   └── utils/          # Utility functions
├── pkg/                # Public library code
│   ├── database/       # PostgreSQL database layer
│   └── logger/         # Logging utilities
├── sql/                # Database schemas and seeds
├── api/                # API specifications
└── docker-compose.yaml # Development environment

🚀 Quick Start

Prerequisites

  • Go 1.21+
  • PostgreSQL 15+
  • Redis 6+
  • (Optional) Kafka for messaging

Installation

# Clone repository
git clone https://github.com/your-username/ktvrequest.git
cd ktvrequest

# Install dependencies
go mod download

# Set up environment
cp config.json.example config.json
# Edit config.json with your settings

# Initialize database
go run cmd/init-db/main.go

# Run migrations
go run cmd/migrate/main.go

# Seed initial data
go run cmd/seed/main.go

# Start development server
go run cmd/server/main.go

Using Docker

# Start all services
docker-compose up -d

# View logs
docker-compose logs -f server

Using Makefile

# Build all binaries
make build

# Run tests
make test

# Start development
make dev

# Run with hot reload (if air is installed)
make watch

⚙️ Configuration

Create config.json:

{
  "server": {
    "port": 8080,
    "env": "development"
  },
  "database": {
    "host": "localhost",
    "port": 5432,
    "user": "ktvrequest",
    "password": "password",
    "dbname": "ktvrequest",
    "sslmode": "disable"
  },
  "redis": {
    "host": "localhost",
    "port": 6379,
    "password": ""
  },
  "jwt": {
    "secret": "your-jwt-secret",
    "expiry_hours": 24
  }
}

About

Backend system for KTV venues - song requests, payments, and performer management built with Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors