Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emilebui/GBP_BE_WS
Back-end application for a multiplayer ban pick game for Genshin Impact
https://github.com/emilebui/GBP_BE_WS
ban-pick game genshin genshin-impact pubsub redis web-game web-game-dev websocket
Last synced: 3 months ago
JSON representation
Back-end application for a multiplayer ban pick game for Genshin Impact
- Host: GitHub
- URL: https://github.com/emilebui/GBP_BE_WS
- Owner: emilebui
- Created: 2023-02-07T07:21:02.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-30T03:51:06.000Z (over 1 year ago)
- Last Synced: 2024-07-12T02:05:10.042Z (4 months ago)
- Topics: ban-pick, game, genshin, genshin-impact, pubsub, redis, web-game, web-game-dev, websocket
- Language: Go
- Homepage: https://genshinbanpick.top
- Size: 92.8 KB
- Stars: 10
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Genshin Ban Pick - Websocket Server (GBP_WS)
- This is the websocket backend server for Genshin Ban Pick
- Tech stack:
- gorilla/websocket
- redis
- spf13/viper## Installation Instructions
### Requirements
- git
- golang 1.19### Initial setup
- Install dependencies:
- Run: `go mod download`### Run application
- **RUN**:
- `go run cmd/ws/main.go`- **Note**:
- You may need to run redis database and config them first to run the app
- Check `docker-compose.yaml` and `config.yaml`### Docker
- Build: `docker build -t gbp_ws:latest .`
- To build and run the entire stack (gbp_ws and redis):
- Run: `docker-compose up -d`### Testing
- Run: `go test ./internal/test/... -cover -coverpkg ./...`
### Project Structure
- `cmd`: This contains all the run commands for the app
- `ws/main.go`: run the websocket server
- `pkg`: Contains all the pkg, helper modules to build the app
- `conf`: Contains helper function for app configurations
- `conn`: Contains helper functions to connect to redis
- `global`: Contains singleton global configuration
- `gstatus`: Contains enums, global structs
- `helper`: Contains general helper functions
- `internal`: Contain endpoint and logic for each API. The structure of this module is as follows:
- `handler`: Handle the all the endpoints of the application (take request, get input and pass it to logic layer)
- `logic`: Logic Layer, all the logic of the service are handled here
- `broker`: All the websocket messages are translated to input for logic functions