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
- Clone the repository
- Run
go mod download
to download the dependencies - Run
go run cmd/server/main.go
ormake server
to start the server - The server will be running on
localhost:8080
- Run
make swagger
- The doc should be on
localhost:8080/swagger
View the API documentation here