From e1791d755f85819adccdc6bcbaf5a83f6e07b026 Mon Sep 17 00:00:00 2001 From: Dmytro Bogovych Date: Sat, 3 Apr 2021 22:15:09 +0300 Subject: [PATCH] - initial work on backend side --- server/backend/README.md | 18 ++++++++++++++++++ server/sql/database.sql | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 server/backend/README.md create mode 100644 server/sql/database.sql diff --git a/server/backend/README.md b/server/backend/README.md new file mode 100644 index 0000000..bbc74a7 --- /dev/null +++ b/server/backend/README.md @@ -0,0 +1,18 @@ +The idea is to keep server simple as much as possible. + +This will serve as central endpoint to provide API. + +- list all available devices for the user. +- list all upcoming changes starting from given datetime excluding some device(s). +- put new change to backend. + +Type of changes: + +- import: initial import of texts +- text diff +- branch operation - add / delete / move / rename +- new time intervals +- delete time intervals + +All data is encrypted. Server hasn't access to changes content. Changes are treated as BLOBs. + diff --git a/server/sql/database.sql b/server/sql/database.sql new file mode 100644 index 0000000..fb875dd --- /dev/null +++ b/server/sql/database.sql @@ -0,0 +1,18 @@ +CREATE DATABASE IF NOT EXISTS litt CHARACTER SET utf8 COLLATE utf8_general_ci; + +CREATE TABLE diffs ( client_id int not null, + device_id varchar(255) not null, + created timestamp not null, + content blob not null ); + +create table clients ( client_id int not null, + username varchar(255) not null, + password varchar(255) not null); + +create table devices ( client_id int not null, + device_id int not null, + device_name varchar(255) not null, + device_platform int not null); + + +