gobb icon indicating copy to clipboard operation
gobb copied to clipboard

React and Graphql

Open alexsuslov opened this issue 7 years ago • 8 comments

Hi, What is your opinion about, use React and Graphql for the client side? image

alexsuslov avatar Nov 27 '18 09:11 alexsuslov

I looked at the code. there is

  • a problem with id (int64) (no support in js)
  • user data move to redis

image

alexsuslov avatar Dec 02 '18 09:12 alexsuslov

uid https://blog.kowalczyk.info/article/JyRZ/generating-good-unique-ids-in-go.html

alexsuslov avatar Dec 02 '18 10:12 alexsuslov

It's cool that you're interested in this, would you submit a PR?

jamesa avatar Dec 03 '18 03:12 jamesa

Standard Go Project Layout

https://github.com/golang-standards/project-layout

https://github.com/alexsuslov/gobb/tree/change_int_id_to_string

DONE

  • add graphql
  • add hello world
  • graphql type generator

DO

  • change int64 ID to string

TODO

  • [query] get post by id
  • [query] get board by id

alexsuslov avatar Dec 03 '18 04:12 alexsuslov

What do you think about using int (i.e. int32) instead of a UUID? A UUID seems like overkill for most Gobb usecases. It would still solve your js support issue I think? Just a thought. Really nice work on this!

jamesa avatar Dec 03 '18 13:12 jamesa

int32 it's more easy

alexsuslov avatar Dec 03 '18 14:12 alexsuslov

int64 -> int

Need:

  • type NullInt struct{}
  • template "admin_topbar" image

https://github.com/alexsuslov/gobb/blob/change_int64_id_to_int/TODO.md

alexsuslov avatar Dec 04 '18 03:12 alexsuslov

What do u think about:

type Post struct {
	ID          int            `db:"id"`
	Message     string         `db:"title"` // 140 char
	OwnerID     int            `db:"owner_id"`
	CreatedOn   time.Time      `db:"created_on"`
	UpdatedOn   time.Time      `db:"updated_on"`
}

type PostDescription struct {
	PostId int         `db:"post_id"`
	Description string `db:"description"`
}

// https://www.postgresql.org/docs/current/datatype-geometric.html#idm46428712347808
type PostGeo struct {
	PostId int      `db:"id"`
	Point  point 	`db:"point"`
}

type PostTag struct {
	PostId	int  	`db:"post_id"`
	TagId 	int 	`db:"tag_Id"`
}

type PostSocial struct {
	PostId	int  	`db:"post_id"`
	Starts 	int 	`db:"stars"` //0-5
	Like	bool	`db:"like"`
}

type PostFollow struct {
	PostId	int  	`db:"post_id"`
	followId int `db:"follow_id"`
}

alexsuslov avatar Dec 04 '18 15:12 alexsuslov