portfolio / yugioh
Yu-Gi-Oh! Simulator
A web app for playing with cards you made yourself: upload the images, build decks and play out a duel.
- Built with
- Go, MySQL, JavaScript
- When
- 2023
What you can do
- Make an account. Register with a username, email and password. Passwords are stored as bcrypt hashes.
- Bring your own cards. Upload an image for each custom card and sort your cards into decks.
- Duel. Pick a deck and an extra deck and start with 8000 Life Points on an empty field. Draw, play cards to the field, flip them, change their position and send them to the graveyard. Open a second window to play against someone.
How it's built
The server is written in Go. It renders the pages, handles logins, stores uploaded card images, and answers the duel screen's requests with JSON: which cards a player owns, which decks they have, and which cards are in a deck. The data lives in MySQL, and the tables are created from the Go structs.
The test suite covers the user, card and deck code against a separate test database, and there is an acceptance test for logging in and out.