A template web app with a React / TypeScript frontend and a Go GraphQL backend that uses SQLBoiler alongside gqlgen for a fast, database schema driven development style.
- Golang backend server
- Postgres database
- SQLBoiler to generate Go ORM models based on database tables
- gqlgen to generate a graphQL API based on the models
- Gorilla sessions for authentication (sign up / log in / log out resolvers are implemented)
- React / TypeScript frontend
- Apollo GraphQL client
SQLBoiler and gqlgen work really well together to generate nearly an entire graphQL API from the database:
- Add Postgres table definitions to the
/migrations/folder - Generate ORM based on tables in the database
make db - Add a graphQL schema in the
/api/folder that reflects the generated ORM - Generate a graphQL server from the schema that binds to the ORM
make graphql(bonus: complete 2 & 4 withmake models) - Fill in the graphQL resolvers using the ORM in
/internal/resolvers/
- Create a new file
.env.shat the top level directory, copy in.env.example.shand fill in the missing variables - Start the React app
make run-clientand start the backendmake run-server(migrations are run automatically with golang-migrate)