sketchdance
Moat is a tool for securely uploading and downloading temporary files. The goal is to allow library patrons to create content (photos, animations, green-screens, stop-motions, games, etc.) and be able to get a short URL/code which can be expressed as a QR code where they can download their content.
Programs that could benefit by having a convenient way for kids (and adults) to get their content that we now mostly throw away:
Goals
See also Moving a service from Glitch to its own server
What is in progress (Details)?
/admin/program
instead of sticking files on admin pageWhat is needed (BIG STUFF)?
Inputs/Outputs
For Sketchdance Suite: server-side integration. Key is kept on server, connects to Moat via https to push file and receive url/qrcode for file.
For non-Sketchdance programs, librarian will have to log into Moat. Generate a one-time login per program? Identify program and length? Then a file or files can be dragged to the page to upload and generate URL/QRCode.
When visiting URL, show how many downloads are left and when file will expire, ask if they want to download the file now.
Admin page, logged-in librarians only. Show usage by program, size of uploads, how many downloads, expiry dates, etc. Also allow library code to be invalidated/reset.
So far, these endpoints:
/upload
- API level, used by Sketchdance Suite
/
- Information about usage - needs design
/program
- Librarian sign-in and create a program page - needs design
/program/xxxxxxx
- Generated program page for upload(s), only accessible during program and from the same network as teacher signed in with - needs design
/admin
- Accessible only to logged-in librarian - needs design
/admin/xxxx
- Drilling down into data further - needs design
id INTEGER not null,
name TEXT not null,
start TEXT not null,
end TEXT not null
id INTEGER not null,
filename TEXT not null,
filetype TEXT not null,
filesize INTEGER not null,
program INTEGER not null,
created TEXT not null,
downloads INTEGER DEFAULT 0,
reaped INTEGER DEFAULT 0
Need separate flows:
This is the most common step for library staff who are running Moat-enabled programs.
digraph hierarchy {
nodesep=1.0 // increases the separation between nodes
node [color=black,fontname=Courier,shape=box] //All nodes will this shape and colour
edge [color=blue, style=dashed] //All the lines look like this
start [shape=oval]
start -> index [label="GET /"]
index -> list_programs [label="POST /"]
list_programs -> add_program [label="POST /program/new"]
add_program -> add_file [label="POST /program/create"]
}
Programs that aren't specifically integrated into Moat can still use it. The program page supports both a traditional form-based file upload and (soon) a drag-and-drop interface for files that works pretty much the same as the integrated version.
digraph hierarchy {
nodesep=1.0 // increases the separation between nodes
node [color=black,fontname=Courier,shape=box] //All nodes will this shape and colour
edge [color=blue, style=dashed] //All the lines look like this
start [shape=oval]
start -> index [label="GET /"]
index -> list_programs [label="POST /"]
list_programs -> add_file [label="POST /program"]
add_file -> show_file [label="POST /file/create"]
show_file -> add_file [label="POST /program"]
}
The user can visit the front page of Moat and enter a file code to get to that file's page, which lists how many downloads are remaining, how long until the file expires, and a link to download it.
digraph hierarchy {
nodesep=1.0 // increases the separation between nodes
node [color=black,fontname=Courier,shape=box] //All nodes will this shape and colour
edge [color=blue, style=dashed] //All the lines look like this
start [shape=oval]
start -> index [label="GET /"]
index -> show_file [color=red, label="GET file/[id]" ]
show_file -> download [label="POST /download"]
}
The user can bypass the front page and go straight to the file's page by using the full URL (or QR Code representation of the URL).
digraph hierarchy {
nodesep=1.0 // increases the separation between nodes
node [color=black,fontname=Courier,shape=box] //All nodes will this shape and colour
edge [color=blue, style=dashed] //All the lines look like this
start [shape=oval]
start -> show_file [color=red, label="GET file/[id]" ]
show_file -> download [label="POST /download"]
}
Programs with Moat integrations use this to list potential programs to save to. In most cases there should only be one program for a given integration in a given time slot, but we allow multiple possible targets.
digraph hierarchy {
nodesep=1.0 // increases the separation between nodes
node [color=black,fontname=Courier,shape=box] //All nodes will this shape and colour
edge [color=blue, style=dashed] //All the lines look like this
start [shape=oval]
list_available_programs [color=red]
start -> list_available_programs [color=red,label="GET /programs (as JSON)"]
}
Used when a program with Moat integrtation saves a file to retrieve later. Currently this is re-usable (a single user can save their work multiple times). If it gets abused we may want to implement limits or overwrite previous saves.
digraph hierarchy {
nodesep=1.0 // increases the separation between nodes
node [color=black,fontname=Courier,shape=box] //All nodes will this shape and colour
edge [color=blue, style=dashed] //All the lines look like this
start [shape=oval]
start -> show_file [color=red, label="POST file/create (as JSON)" ]
}
This includes integration paths used by Shimmy and other integration targets, but does not yet include administrative flow.
digraph hierarchy {
nodesep=1.0 // increases the separation between nodes
node [color=black,fontname=Courier,shape=box] //All nodes will this shape and colour
edge [color=blue, style=dashed] //All the lines look like this
start [shape=oval]
list_available_programs [color=red]
start -> index [label="GET /"]
start -> list_available_programs [color=red,label="GET /programs (as JSON)"]
start -> show_file [color=red, label="POST file/create (as JSON)" ]
index -> list_programs [label="POST /"]
index -> show_file [color=red,label="GET /file/[id]"]
list_programs -> add_file [label="POST /program"]
list_programs -> add_program [label="POST /program/new"]
add_program -> add_file [label="POST /program/create"]
add_file -> show_file [label="POST /file/create"]
show_file -> add_file [label="POST /program"]
show_file -> download [label="POST /download"]
}