# Introduction This project aims to create a AMA style page using `react` on frontend and `go` on backend. ## Initialize project ```bash $ go mod init forgejo.home.viniciussouza.me/learning/go-react-server ``` ## Database migrations ### Installing tern ```bash $ go install github.com/jackc/tern/v2@latest ``` ### Creating migrations ```bash $ tern new --migrations ./internal/store/pgstore/migrations create_rooms_table $ tern new --migrations ./internal/store/pgstore/migrations create_messages_table ``` ### Wrapper around tern `tern.config` does not read `.env` file directly so a wrapper was created to be able to load environment variables. ### Installing sqlc ```bash $ go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest ``` ### Generate sql types ```bash $ sqlc generate -f ./internal/store/pgstore/sqlc.yaml ```