2017-12-22 20:51:07 -06:00
2017-12-22 20:51:07 -06:00
2017-12-22 02:45:07 -06:00
2017-12-22 13:43:51 -06:00
2017-12-20 15:29:54 -06:00
2017-12-22 14:42:15 -06:00
2017-12-22 16:45:48 -06:00
2017-12-22 14:42:15 -06:00
2017-12-22 20:48:18 -06:00

remark Build Status

Comment engine

Install

Backend

  • copy provided docker-compose.yml and customize for your needs
  • make sure you don't keep DEV=true for any non-development deployments
  • pull and start docker compose pull && docker compose up

Frontend

TBD

API

Authorization

  • GET /login/{provider}?from=http://url - perform "social" login with one of supported providers and redirect to url
  • GET /logout - logout
  • GET /api/v1/user - get user info, auth required
type User struct {
	Name    string `json:"name"`
	ID      string `json:"id"`
	Picture string `json:"picture"`
	Profile string `json:"profile"`
	Admin   bool   `json:"admin"`
}

currently supported providers are google and github

Commenting

  • POST /api/v1/comment - add a comment. auth required
type Comment struct {
	ID        int64           `json:"id"`      // read only
	ParentID  int64           `json:"pid"`    
	Text      string          `json:"text"`
	User      User            `json:"user"`    // read only
	Locator   Locator         `json:"locator"`
	Score     int             `json:"score"`   // read only
	Votes     map[string]bool `json:"votes"`   // read only
	Timestamp time.Time       `json:"time"`    // read only
}

type Locator struct {
	SiteID string `json:"site"`
	URL    string `json:"url"`
}
  • GET /api/v1/find?url=post-url - find all comments for given post returns list of Comment
  • GET /api/v1/last/{max} - get last {max} comments
  • GET /api/v1/id/{id} - get comment by id
  • GET /api/v1/count?url=post-url - get comment's count for {url}
  • PUT /api/v1/vote/{id}?url=post-url&vote=1 - vote for comment. vote=1 will increase score, -1 decreases. auth required
  • DELETE /api/v1/comment/{id}?url=post-url - delete comment by id. auth and admin required
  • PUT /user/{userid}?site=side-id&block=1 - block or unblock user. auth and admin required
S
Description
No description provided
Readme MIT
43 MiB
Languages
Go 69.4%
TypeScript 22.8%
CSS 3.2%
HTML 1.3%
JavaScript 1.3%
Other 2%