Skip to content

ichtrojan/cook

Repository files navigation

Cook

Keep Building


Sir Cook Alot (2025)

What's included

Usage

Create .env from template

cp .env.example .env

Populate .env with appropriate values and run the server

go run server.go

Cook would be available on port 6666

Why does this exist?

I build a lot of random projects—most of them never make it past localhost. Eventually, I felt the need to pull out the commonly used pieces and turn them into a more structured template.

This setup probably won’t work for everyone—or maybe even most people writing Go—but I’m putting it out there anyway. It’s mainly for my own sanity, to help me spin up new projects faster.

Who should use this?

  • Lazy people
  • Non-vibe coders

Time for some devsplaining

I would use this section to explain some not so obvious items.

Go Validator

You can find more details in the original documentation on the package’s GitHub page. That said, I’ve added a few custom validation rules of my own:

  • array: checks that the JSON attribute is a valid array
  • base64: checks that it’s a valid base64-encoded string
  • uuid_array: checks that it’s an array of valid UUIDs
  • array_unique_uuid: checks that it’s an array of unique UUIDs
  • valid_future_timestamp: checks that it’s a valid timestamp in the future

Olympian for migrations

In my (not-so-long) stint writing Go, I haven't found a migration library I actually like. I've tried a bunch—most of them expect you to write raw SQL like a caveman. Thing is, I came to Go after years of being pampered by Laravel's migration system.

Originally, I used a stripped-down Laravel project in a misc folder just to handle migrations. Eventually, I built Olympian—a proper Go migration tool that gives you that Laravel-style migration experience without the embedded PHP mess.

It's what this template uses by default, but you can swap it out for whatever you're more comfortable with.

Asynq/Asynqmon

Asynq is available by default when you run the server. However, the Asynqmon monitoring dashboard isn’t enabled out of the box. To turn it on, set the ASYNQMON_SERVICE key to true in your .env file. After that, restart the server, and Asynqmon will be available at port 6660.

Closing remarks

This README was written while listening to LOCKED IN by Maison2500 (Apple Music, Spotify) not like it matters. There are a bunch of things I don't have the time to explain but I'm sure you'd figure out as you attempt to use this template.


Before Nothing, there was me
Trojan 𓂀

About

Golang Web Application Template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published