Dockerized (postgres + nginx + golang + react) starter kit
Only implements users
, sessions
, password_resets
, and a toy post
type to demonstrate basic CRUD.
- Hot-reload, front and back, including a test-runner for golang changes
- golang-migrate already configured for easy migrations
- sqlc for auto-generated sql bindings
- golang-jwt cookies with automatic refresh: ready for horizontal
- React dev server
- React Router for front-end routing
- React Context for global user state
- Semantic UI React for component library with functional theme variables and hot-reload
Install docker
&& docker-compose
# clone the repo
git clone git@github.com:vineetsgr07/ecommerce-golang.git
# copy the .env template for your local version
cp .env.example .env
# build and start the containers
docker-compose up
- Visit
http://localhost:4500
- Make changes to go, sql, or react code, and enjoy hot-reload goodness!
docker-compose exec react npm run test
Migrations are created and run using simple wrappers around go-migrate.
# create files for a new migration
postgres/new my_migration_name
# execute any new migrations (this is also run automatically the container is created)
postgres/migrate up
# go down 1 migration
postgres/migrate down 1
# goto a migration by index
postgres/migrate goto 3
# remember to use \q to exit
postgres/psql