myapp-backend-go

command module
v0.0.0-...-fbda54b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2021 License: MIT Imports: 17 Imported by: 0

README

Development Notes

Initial module

go mod init github.com/diep-it-dn/fullstack-go-angular/myapp-backend-go

Create the project skeleton with gqlgen

go get github.com/99designs/gqlgen
go run github.com/99designs/gqlgen init
go run github.com/99designs/gqlgen generate
Note:
- If error is occured, try to run this to fix: `go get github.com/vektah/gqlparser/v2@v2.1.0`, then rerun: `go run github.com/99designs/gqlgen generate`
- We should add git ignore for generated code.

Installation ent

go get entgo.io/ent/cmd/ent

Create Schemas by ent

ent init User
ent init PermissionGroup
ent init ContentSetting
ent init Tag
ent init Post

GraphQL Integration

Refer GraphQL Integration

Run codegen for your ent project

go generate ./...

Development server

At the first time, run make before-dev to prepare eveything. See the make file for more information. Rerun it when the code changed during the development.

Then in Visual Studio Code, press F5, choose "Launch debugger for myapp-backend-go server".

(You can also run make docker-compose-dev to start the application inside the docker container)

Then browse to http://localhost:9999/playground to send/test queries.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
ent
graph
internal
pkg
jwt
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL