Dragon-Knight/README.md
2025-08-08 21:07:46 -05:00

1.2 KiB

Dragon Knight

A hyper-performant version of Dragon Knight built with cool technologies.

Backend

We're using Go! Since Dragon Knight is a game that's purely SSR, we opt to use the best library for this purpose; fasthttp. We have our own custom radix tree router to dispatch, and all events are handled on the server with speed. To avoid difficulty while in development, though, all our static assets and non-database data are in a folder adjacent to the executable, so we lose the advantage of embedding but gain dev speed.

Database

Dragon Knight's database is small and generally doesn't see many writes. Therefore we can use a single monolith SQLite file as the database. We still use WAL and give it extra memory - performance is a blessing!

Because our backend language has no databases built-in, we have to bring in a dependency for this one - it is what it is. For this purpose, we use the CGO-free zombiezen library - which also tends to be among the most performant SQLite wrappers in Go.

To make life easier, we use an Active Record kind of pattern for database objects.

Frontend

Pure HTML, CSS and JavaScript. We enhance the frontend with AJAX where applicable. Again, these assets are adjacent to the executable for dev speed.