Skip to content

Backend for Online TicTacToe game - invite friends to play TicTacToe on a board of any size and winning condition! Built wit Gin-Gonic, MongoDB, Pusher and Vercel.

Notifications You must be signed in to change notification settings

gowth6m/online-tictactoe-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Online TicTacToe Backend

Description

This is a backend for the Online TicTacToe project - you can play TicTacToe with your friends online by inviting them to your game. Can set up a game with board of any size and any winning condition in a row! The game is turn-based and you can play with multiple friends at the same time. The game is real-time and you will get a notification when it's your turn to play. Uses DFS to check for winning conditions.

It's built with Go, Gin-Gonic, MongoDB driver and Pusher. Uses MongoDB to store game objects, users, etc and Pusher for push notifications. There is also a Cron job that runs at 05:00 AM (UTC), every 2 days to reset games database. The architecture is a serverless approach using Vercel's serverless functions.

View the frontend repository here and the live demo here

How to run server

  1. Clone the repository
  2. Run go mod download to download the dependencies
  3. Run go run cmd/server/main.go or make server to start the server
  4. The server will be running on localhost:8080

How to generate swagger documentation

  1. Run make swagger
  2. The doc should be on localhost:8080/swagger

Swagger documentation

View the API documentation here

Preview

Preview

Preview

Preview

About

Backend for Online TicTacToe game - invite friends to play TicTacToe on a board of any size and winning condition! Built wit Gin-Gonic, MongoDB, Pusher and Vercel.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published