[portfolio](https://geonwoo.kim/en/portfolio) › SSAFY

# lyricit · real-time game built on song lyrics

https://geonwoo.kim/en/portfolio/lyricit

Period: 2024.02 — 2024.04

In lyricit, players see lyric keywords each round and guess the song in real-time chat. The game uses lyrics from popular Korean songs over the years, crawled and processed in a distributed setup. I handled most of the backend work and set up the servers and CI/CD alone. I configured several deployment scenarios in Jenkins and kept refining usability through repeated QA rounds.

Backend lead for real-time chat, game messaging and infrastructure

- [github](https://github.com/lyricit/lyricit-be)

Team: 6 people · Backend 2, frontend 2, data 2

Role: Backend lead · CI/CD and infrastructure owner · Member API · WebSocket communication · Chat · Room creation and game join API · Game flow refactoring · Game timer scheduling

Java 17 · Spring Boot 3.2.1 · Spring Data JPA · WebSocket (STOMP) · MySQL 8.0.35 · Redis 7.2 · AWS EC2 · Jenkins · Docker

- Live room info updates and chat
- Room creation, game preparation and start, game mode settings
- First correct answer in chat wins the round
- Lyrics data search

## One real-time message channel per page

Problem: The game had many message channels, increasing resource use, channel management and development work. I had to choose between a channel per component and a channel per page, and the choice had to be simple enough to keep development costs down.

Solution: Combined the message channels into one per page. Responses share a common format, with message types distinguishing situations, which made channels simpler to manage. Resource use went down, and new features were added as new message types.

## Dropped sessions

Problem: Players were marked offline when their socket session dropped, not when they logged out, so room and game state in Redis had to be updated at the same time. Timeouts also caused disconnections.

Solution: An interceptor checked STOMP commands and handled each connection state, and when a player dropped mid-game, the game and room data were deleted and updated. The channel interceptor passed work to an event listener to avoid circular references. Heartbeat ping and pong frames at fixed intervals stopped timeout disconnections.

## Architecture

lyricit deployment diagram: Nginx, Next.js, Spring Boot, Redis, MySQL, Elasticsearch, Kibana, Spark and Beautiful Soup

Service servers separated from the lyric search and crawling stack

lyricit start screen with the logo and login form

lyricit start screen with the logo and login form

lyricit lobby with the game room list

lyricit game screen showing a lyric keyword and player rankings

lyricit waiting room with players and game settings

lyricit dictionary screen with song search and lyrics


[seoulpop · location-based history walks](https://geonwoo.kim/en/portfolio/seoulpop) · [jansorry · holiday nagging receipts](https://geonwoo.kim/en/portfolio/jansorry)
