baker-news

command module
v0.0.0-...-8f92a64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2025 License: MIT Imports: 9 Imported by: 0

README ΒΆ

baker-news

Screenshot of baker-news

A hacker news clone that I made while learning Go.

Acknowledgements

  • This projects main motivation is to be an environment to help me learn Go and try new things.
  • I intentionally didn't bother with things like security in order to speed up development.
  • I tried to follow, the "standard" Go project structure but not too strictly.
  • Someone wrote about how they only used one single git command git add --all && git commit -m "yolo 😎" && git push, so I decided to try it.
  • I tried making it "portable" | "easy to install". You should only need Go, Make, Docker and Docker Compose to run everything.
  • I've used Jupyther notebooks to help with development in other languages but the kernels for Go are all broken. I've also tried interpreters but they are also not good enough.

Running

  • docker-compose up to run dependencies
  • make db/tidy creates, migrates, dumps the schema and generate sqlc code
  • make run/live runs the application in watch mode
  • OPTIONAL make db/seed seed the database with fake data

Project Structure

Read the Makefile (make help) and the docker-compose.yml to understand how the project is put together.

.
β”œβ”€β”€ app - Contains Web Application Code
β”œβ”€β”€ cmd - Entry point for applications / scripts
β”‚   β”œβ”€β”€ app-configuration-sync - script to update DAPR configuration
β”‚   β”œβ”€β”€ baker-news - Web application
β”‚   β”œβ”€β”€ db-utils - script to help with database management
β”‚   └── seed - script to seed database with fake data
β”œβ”€β”€ commands - Operations that mutate the domain
β”œβ”€β”€ docker-compose - Dev environment docker-compose related things
β”‚   β”œβ”€β”€ dapr
β”‚   β”œβ”€β”€ gonb - Jupyther notebook kernel (not used anymore)
β”‚   β”œβ”€β”€ pgadmin
β”‚   β”œβ”€β”€ postgres
β”‚   β”œβ”€β”€ redis
β”‚   └── redis-insight
β”œβ”€β”€ docs
β”‚   └── screenshots
β”œβ”€β”€ events - Domain events definitions
β”œβ”€β”€ notebooks - I tried playing around with notebooks but I wasn't satisfied
β”œβ”€β”€ scratch - Throwaway stuff
β”œβ”€β”€ state - State (database) queries, models and migrations
β”‚   β”œβ”€β”€ seed
β”‚   └── sql
β”‚       └── migrations
└── worker - Contains async worker code

Docker-Compose

Learning Resources

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
app
auth
templ: version: v0.2.778
templ: version: v0.2.778
components
templ: version: v0.2.778
templ: version: v0.2.778
htmx
templ: version: v0.2.778
templ: version: v0.2.778
post_block
templ: version: v0.2.778
templ: version: v0.2.778
post_comments_page
templ: version: v0.2.778
templ: version: v0.2.778
posts_list_page
templ: version: v0.2.778
templ: version: v0.2.778
template_page
templ: version: v0.2.778
templ: version: v0.2.778
web_console
templ: version: v0.2.778
templ: version: v0.2.778
cmd
baker-news command
db-utils command
seed command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL