sidebar

package module
v0.0.0-...-8c85031 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: MIT Imports: 0 Imported by: 0

README

Go Report Card license

An open source Slack alternative with an emphasis on handling brief, tangentially related discussions that arise and disrupt the overall narrative of a conversation.

Sidebar is designed to keep communication organized in the situation where there are multiple people working on different parts of the same project. Sidebar provides a way to handle short questions/comments that arise in a discussion without allowing them to derail the entire conversation. Simply create a sidebar channel based on the message you are responding to, continue the brief converstaion there, and then mark the channel "Resolved" when the conversation is over. This way both conversations can carry on independently and all users can check the resolution of the sidebar on it is marked "Resolved".

As an example, imagine a team working remotely on separate parts of a project and you are the project lead. You may call for the current status of all team members in the group's main channel. As the responses begin pouring in, you have a question about a team members report. Rather than sending your questions in the main channel where your discussion will get mixed in with the reports from all other members, you create a sidebar as a child of the message with this member's status. Now you can ask your questions in a dedicated channel focused on this member's status. Once all of your questions are answered, you mark the sidebar "Resolved". At the end of the day, you have a main channel with the call for status followed by the reports from each team member. You also have a sidebar channel where you (and any other user) can see the more detailed discussion centered on this member's status.

Frontend

The frontend is built with VueJS here. Contributions are greatly appreciated.

To-Do

  • TESTS!
  • Allow users to deploy their own instance
  • Add workspaces like Slack
  • Add private channels
  • File upload
  • Better alerts (including mute)
  • Make @ functional
  • Add roles for users

Contributing

Contributions are greatly appreciated. Feel free to create and issue or submit a pull request. There are very likely a plethora of issues that need addressing.

Installation

git clone git@github.com:tmitchel/sidebar.git

Start detached docker containers with Postgres, Adminer, and Sidebar

docker-compose up -d

Credits

Garrett Dyson - logo - Garrett Dyson Desgin

Documentation

Index

Constants

View Source
const (
	EventMessage      = 1
	EventTyping       = 2
	EventStartSpinOff = 3
)

event codes

Variables

This section is empty.

Functions

This section is empty.

Types

type Adder

type Adder interface {
	ResolveChannel(string, string) error
	AddUserToChannel(string, string, string) error
	RemoveUserFromChannel(string, string, string) error
	AddUserToWorkspace(string, string, string) error
}

type Alert

type Alert struct {
	Target  string `json:"target"`
	Message string `json:"message"`
}

Alert is used to send news of an update to users.

type Authenticater

type Authenticater interface {
	Validate(string, string, string) (*User, error)
}

Authenticater provides methods to check that a user has provided proper login information or a valid token.

type Channel

type Channel struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Details   string `json:"details"`
	Image     string `json:"display_image"`
	IsSidebar bool   `json:"is_sidebar"`
	Parent    string `json:"parent"`
	Direct    bool   `json:"direct"`
	Resolved  bool   `json:"resolved"`
}

Channel contains a chat centered around a specific topic.

type ChannelUpdate

type ChannelUpdate struct {
	Channel
	Message string `json:"message"`
}

ChannelUpdate is sent over the Websocket connection to alert users of new channels, updates to an existing channel's information, etc.

type ChatMessage

type ChatMessage struct {
	ID       string `json:"id"`
	Event    int64  `json:"event"`
	Content  string `json:"content"`
	ToUser   string `json:"to_user"`
	FromUser string `json:"from_user"`
	Channel  string `json:"channel"`
}

ChatMessage represents a message sent over the Websocket connection.

type Creater

type Creater interface {
	CreateWorkspace(*Workspace) (*Workspace, error)
	CreateUser(*User) (*User, error)
	CreateChannel(*Channel, string) (*Channel, error)
	CreateMessage(*ChatMessage) (*ChatMessage, error)
}

Creater provides methods to create new objects that will be persisted to disk.

type Deleter

type Deleter interface {
	DeleteUser(string) (*User, error)
	DeleteChannel(string) (*Channel, error)
}

type Getter

type Getter interface {
	GetWorkspacesForUser(string) ([]*Workspace, error)
	GetWorkspaces() ([]*Workspace, error)
	GetDefaultWorkspace() (*Workspace, error)

	GetUser(string) (*User, error)
	GetChannel(string) (*Channel, error)
	GetMessage(string) (*ChatMessage, error)

	GetUsers(string) ([]*User, error)
	GetChannels(string) ([]*Channel, error)
	GetMessages(string) ([]*ChatMessage, error)

	GetUsersInChannel(string, string) ([]*User, error)
	GetChannelsForUser(string, string) ([]*Channel, error)

	GetMessagesInChannel(string, string) ([]*ChatMessage, error)
	GetMessagesFromUser(string, string) ([]*ChatMessage, error)
	GetMessagesToUser(string, string) ([]*ChatMessage, error)
}

type Updater

type Updater interface {
	UpdateUserInfo(*User) error
	UpdateChannelInfo(*Channel) error
	UpdateUserPassword(string, []byte, []byte) error
}

type User

type User struct {
	ID          string `json:"id"`
	DisplayName string `json:"display_name"`
	Email       string `json:"email"`
	Password    []byte `json:"-"`
	ProfileImg  string `json:"profile_image"`
}

User represents a basic user of sidebar. They can be members of multiple channels, sidebars, etc.

type WebsocketMessage

type WebsocketMessage struct {
	// Type of message so receiver can decide how to decode
	Type string

	// information being sent
	Payload interface{}
}

WebsocketMessage represents anything that can be sent over the Websocket connection.

type Workspace

type Workspace struct {
	ID          string `json:"id"`
	Token       string `json:"token"`
	DisplayName string `json:"display_name"`
	DisplayImg  string `json:"display_image"`
}

Workspace represents a set of channels and users in one group.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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