This project uses
go-chi/v5for routinggolang-migrate/migratefor database migrations
You can also install gin for hot-reloading during development:
go install github.com/codegangsta/gin@latestTo install the dependencies, run:
go mod tidyYou will also need to run the migrations before starting the project:
make migrate-upTo rollback the last migration, run:
make migrate-downTo create a new migration, run:
make migrate-create name=<migration_name>This project uses PostgreSQL as the database. You can use Docker to run a PostgreSQL container:
make docker-upTo stop the container, run:
make docker-downTo run the project, run the following commands: Dev:
make runDevelopment with hot-reload:
make devBuild:
make buildProd:
make prodTo create a new table:
migrate create -ext sql -dir storage/migrations -seq create_todos_table
To run migrations:
migrate -source file://storage/migrations -database $POSTGRESQL_URL up