Skip to content

cagribuyuk/LiveOps_EventEnrollment

Repository files navigation

LiveOps Backend - Event Enrollment

📝 Overview

LiveOps Event Join API is a high-performance, concurrency-safe backend service designed to handle player join requests for online events. The service ensures correct group assignment, prevents race conditions, supports horizontal scaling, and provides robust error handling with retry mechanisms.

Backend: Go + PostgreSQL

⚡ Features

  • Submit join requests for events with player details.
  • Assign players to groups based on level category (bronze, silver, gold).
  • Concurrency-safe handling to prevent duplicate enrollments.
  • Retry mechanism for transient database errors.
  • Graceful handling of database outages.
  • Full testing support (unit tests, integration tests, concurrent join tests).
  • Dockerized application for easy deployment.
  • Machine-readable API specification via OpenAPI v3.

🛠️ Technologies & Protocols

  • Programming Language: Go 1.23
  • Web Framework: Fiber v2
  • Database: PostgreSQL 15
  • API Specification: OpenAPI v3 (liveops_api.yaml)
  • Containerization: Docker, Docker Compose
  • Testing: Go unit tests, integration tests, concurrency tests
  • Build & Automation: Makefile for building, testing, and managing environments
  • Protocols: HTTP/REST, JSON for request/response payloads

Installation

Production Environment

To run in production mode using Docker Compose:

  docker compose up --build

Application will run on: localhost:3000

PostgreSQL will be available on: localhost:5432

Test Environment

  make build
  then
  make up

Application will run on: localhost:3001

PostgreSQL will be available on: localhost:5433

  make down -> Stop the container
  make test -> Run tests

In case Make is not installed, use docker compose -f docker-compose.test.yml up --build

API Usage Example

Join Event

POST /v1/events/{event_id}/join Content-Type: application/json Body: { "playerId": "player10", "level": 27 }

Sample cURL

curl -X POST http://localhost:3000/v1/events/1/join
-H "Content-Type: application/json"
-d '{ "playerId": "player7", "level": "51" }'

About

LiveOps Event Join API is a high-performance, concurrency-safe backend service designed to handle player join requests for online events.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors