| <!-- -->Christopher Leggett's Portfolio and Blog<!-- -->

Grindlists

August 13, 2021

Check it out on Github!

Grindlists is a web application designed to help gamers organize their grinding sessions. For any readers who don't know what that means, sometimes a game requires a player to collect materials to complete a quest or craft an item. Sometimes those items also require crafting intermediate items, and it can be a lot to keep track of. The goal of Grindlists is to help gamers keep track of what items they need, how many they need, and where those items can be found.

Grindlists is comprised of a React Frontend and a GraphQL backend. It currently uses JWT token-based authentication (with plans to implement OAuth support), a PostgresQL database for storage, and a Redis server for caching. The main thing I experimented with when building this project is code generators, which I will elaborate on below.

The Backend for Grindlists is written in Go. The GraphQL server was generated gqlgen, which handles most of the boilerplate code for you, but leaves the non-trivial resolvers (basically anything that needs to interact with the database) for the developer to implement themselves. Said database interaction code was generated by sqlc, which generates database code based on a schema file written in SQL, and a file describing SQL queries, written in SQL with some extra comments. The generated code is then wrapped up in an interface that can add additional methods for any database operations that are easier written in Go by combining other existing database queries (Creating an Item and adding it to a list at the same time, for example).

The Frontend is written in React with Typescript. The code generation happening here is with graphql-codegen, which generates code to interface with the GraphQL API and properly assign types to the response data. The rest of it is a fairly standard React + Next.js app.

There is currently no live demo for Grindlists, and not all of the API functionality has been implemented in the frontend yet. However, feel free to check it out on GitHub, if you have Docker, docker-compose and Make, then the dev environemnt setup is pretty simple to do.