Skip to content
hrrydglsPublic

About

Learn go development with me :)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

LeGo

I want to hit a btn to deploy an amazing product! This repo is still under developement! Don't use it :)

Getting started

Database

For dev env use this command for database setup:

docker compose up -d

Migrations

I use golang-migrate/migrate package for migrations. You can run it with docker:

docker run -v $PWD/database/migrations:/migrations \
  --network host \
  migrate/migrate \
  -path=/migrations \
  -database "postgres://postgres:postgres@localhost:5432/go?sslmode=disable" \
  up

Hot reloading

I use Air for live reloading. So you just need to run air in dev env to run it...

Routing

I am using chi for routing.

JWT auth

I wanna use JWT tokens for authentication:

go get github.com/golang-jwt/jwt/v5

Todo

  • Handle exceptions better
  • Refactor a bit
  • Use a package for routing
  • Create a middleware for auth
  • Write some tests
  • Use a package for env vars
  • Encrypt passwords
  • More info in the token, like name and email
  • Better logging
  • Metrics
  • Use a package for validation
  • Rate limiter for login and register

More general suggestion

Go playground

If you wanna test sth on the fly, you can do it here: https://go.dev/play/

About

Learn go development with me :)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages