rpanic / kshare

kShare is an webbased real-time code editor and file sharing platform written in kotlin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kShare

kShare is a real-time code and file sharing platform

  • Backend written in Kotlin with javalin
  • built-in monaco editor
  • easy-to-use file upload api

A running instance of kShare can be used at rpanic.com

Build Status

Editors instances

Every new editor and file-storing instance has a unique key.
The key of a instance displayed in the url like: kshare.me/key

You can also generate a random key by going to the index.html (f.e. "kshare.me/")

Test it yourself

Install it yourself

You can either download one of our
releases
or compile it yourself with gradle.

Our releases already include the monaco and frontend resources

If you want to compile it yourself you will have to download the monaco editor and Semantic-UI manually and put the extracted files into /resources/frontend/monaco folder.

Execute the app with

java -jar kshare.jar

After executing, kshare will extract the necessary static files to the folder frontend/

You will have to pass your url as an argument, for example:
... -url myurl.com

The default port is 80, but can be changed by the port argument
... -port 80

SSH is enabled by default, disable it with
... -ssh false

When executing from an IDE append -ide true

File upload API

The File upload API is designed to be minimalistic and easy to use.
Therefore there are only 3 endpoints

  • listFiles: Lists all files related to a given key
  • uploadFile: Uploads one or multiple files
  • fileData: retrieves a file

listfiles

POST: kshare.me/listFiles

Header Parameter:

  • key: Specifies the key to which the file was saved.
    Note: The key has be specified int he HTTP Header!

Sample Result:

[{
    "name":"test.txt",
    "networkPath":"/filedata/testkey_test.txt"
}]

uploadFile

POST: kshare.me/uploadFile

Parameters:

  • key (header): Specifies the key to which the file should be saved.
  • file (body): The data of the file being uploaded

Result:
ok: If the upload was successful
failed: There were problems or your request was wrong

getFile

POST: kshare.me/getfile

Parameters:

  • key (header): Specifies the key to which the file was saved.
  • filename (header): The name of the file saved

Result:
A data stream of the files data

About

kShare is an webbased real-time code editor and file sharing platform written in kotlin


Languages

Language:Kotlin 48.5%Language:JavaScript 27.9%Language:HTML 18.3%Language:CSS 4.4%Language:Dockerfile 0.9%