foxtrot

module
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: Apache-2.0

README

Foxtrot

CI/CD PkgGoDev Slack chat

Collaborative editing is a dance.

Before biting off the actual Operation Transform implementation we have decided to implement a very basic chat server and web client as it holds a lot of the periphery tooling we will need for the ultimate goal: Websockets, sqlite, JWT - for details see notes on google docs.

Backend

The foxtrot backend server is written in Go with a REST inspired HTTP API for chat message history and access to other resources. Websockets are used for new messages.

Development
  • Pre-requisites: go 1.16, golangci-lint, GNU make
  • Build with make
  • View build options with make help
Run foxtrot

Start the foxtrot server with a transient in-memory DB and some test sample data with make run. For more options run

make build
out/foxtrot --help

to see for instance how to specify the path to a new or existing Sqlite data store or define the authenticator secret.

Access the foxtrot API server locally with

curl 'localhost:8080/api/history?room=$Kitchen'
curl localhost:8080/api/version
DB

Foxtrot uses Sqlite3 as its data store. Interactively set up transient in memory DB with

sqlite3
.read pkg/foxtrot/sql/schema.sql
.read pkg/foxtrot/sql/sample_data.sql

Alternatively, create a persistent DB with

sqlite3 out/foxtrot.db \
  '.read pkg/foxtrot/sql/schema.sql' \
  '.read pkg/foxtrot/sql/sample_data.sql'

Frontend

The frontend is a SPA built with SvelteJS.

Development

All frontend code and build tools are contained in frontend/. To work with it first cd frontend

  • Pre-requisites: node v15.5GNU make
  • Initialise with npm install
  • Develop with npm run dev
  • Build with npm build and view output with npm run start

Docker

On every successful merge to master on GitHub, the Semver patch version number is bumped and used as git tag. Additionally cross-platform docker images are built for linux/amd64 and linux/arm/v7 and pushed to foxygoat/foxtrot with the corresponding version tag.

Directories

Path Synopsis
cmd
pkg
foxtrot
Package foxtrot provides core foxtrot data structures.
Package foxtrot provides core foxtrot data structures.

Jump to

Keyboard shortcuts

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