shorthaul

Summary

shorthaul is an ‘uber’ for shorthault freight usage. An admin created loads which are then algorithmically assigned to available nearest drivers. The drivers, once assigned, may accept or reject a load and then fulfill the load.

The source code can be provided upon request.

Usage

Below we have an example of the application starting up. We manage database migrations, create event infrastructure (NATS) connection, create consumer(s) and subscribe them to relevant topics and then create connectrpc handlers.

The event is used for notifying the consumer to make an assignment, and for batching unassigned loads for process if they were unable to be assigned at create time.

~/github.com/hampgoodwin/shorthaul main*
shorthaul-env ❯ make up
[+] Running 5/5
 ✔ Network shorthaul_default       Created                                                                                                                                                                                                    0.0s
 ✔ Container shorthaul-db-1        Healthy                                                                                                                                                                                                    5.7s
 ✔ Container shorthaul-nats-1      Started                                                                                                                                                                                                    0.2s
 ✔ Container shorthaul-backend-1   Started                                                                                                                                                                                                    5.8s
 ✔ Container shorthaul-frontend-1  Started                                                                                                                                                                                                    5.9s

~/github.com/hampgoodwin/shorthaul main* 6s
shorthaul-env ❯ make run
{"level":"info","ts":1758671592.7026281,"caller":"cmd/shorthaul.go:52","msg":"no migrations"}
{"level":"info","ts":1758671592.708656,"logger":"load.consumer","caller":"load/consumer.go:29","msg":"consumer created"}
{"level":"info","ts":1758671592.708695,"logger":"load.consumer","caller":"load/consumer.go:35","msg":"susbscribed","subject":"load.assign"}
{"level":"info","ts":1758671592.708881,"logger":"user.service","caller":"user/connect.go:29","msg":"user server handler created","path":"/shorthaul.user.v1.UserService/"}
{"level":"info","ts":1758671592.709008,"logger":"user.service","caller":"user/connect.go:31","msg":"server handler registered","path":"/shorthaul.user.v1.UserService/"}
{"level":"info","ts":1758671592.709093,"logger":"shift.service","caller":"shift/connect.go:29","msg":"server handler created","path":"/shorthaul.shift.v1.ShiftService/"}
{"level":"info","ts":1758671592.709116,"logger":"shift.service","caller":"shift/connect.go:31","msg":"server handler registered","path":"/shorthaul.shift.v1.ShiftService/"}
{"level":"info","ts":1758671592.7092211,"logger":"load.server","caller":"load/connect.go:30","msg":"server handler created","path":"/shorthaul.load.v1.LoadService/"}
{"level":"info","ts":1758671592.709236,"logger":"load.server","caller":"load/connect.go:32","msg":"server handler registered","path":"/shorthaul.load.v1.LoadService/"}
{"level":"info","ts":1758671592.709248,"caller":"cmd/shorthaul.go:113","msg":"starting connect server","service_info":"localhost:8080"}

Below we see a screenshot of an admins crude user interface where they may create a load and see a list of all active loads

admin

And once the load is assigned, it appears in the drivers ui.

driver

Technologies

go react typescript grpc connect NATS api events