GithubHelp home page GithubHelp logo

arcatdmz / danoweb Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 0.0 30.17 MB

Yet another distributed authoring environment built with deno

Home Page: https://danoweb.digitalmuseum.jp

License: MIT License

TypeScript 12.87% CSS 8.07% HTML 2.38% Dockerfile 0.17% JavaScript 76.51%
deno typescript web wiki webdav

danoweb's Introduction

danoweb

distributed authoring environment built with deno for the web

how to use

  1. anyone can (collaboratively) edit any served text files by appending ?mode=edit query parameter -- どのページも URL 末尾に ?mode=edit をつけると編集できます
  2. those who know the authentication token (USER_PASSWORD) can save the edits to update the served files (ask me if interested) -- 編集結果をファイルに書き戻すには USER_PASSWORD が必要です

concept

  • what you see is what you can (collaboratively) edit
    • like a WebDAV server but with a code editor that appears with ?mode=edit query parameter
    • like a Wiki site but with focus on serving raw files
  • built with Deno for Deno

backend

  1. for collaborative editing, Firebase Realtime Database is used
  2. for serving files and saving the edits, native file system is used

plans

  • see GitHub issues for short-term goals
  • Wiki-like links in the editor (currently, the code editor renders the code as-is, but there is much space for PX improvements)
  • better collaborative editing experience (e.g., asking the user to login using GitHub etc. to show collaborators)
  • TypeScript auto completion for all the Deno code on the web!

deploy

a) use pre-built Docker image

docker run --name danoweb -p 8000:8000 \
  -e API_KEY=... \
  -e AUTH_DOMAIN=... \
  -e DATABASE_URL=... \
  -e PROJECT_ID=... \
  -e STORAGE_BUCKET=bucket_id.appspot.com \
  -e MESSAGING_SENDER_ID=... \
  -e APP_ID=... \
  -e DATABASE_PREFIX=prefix_ \
  -e USER_PASSWORD=password \
  arcatdmz/danoweb

b) build docker image and run

  1. git clone
  2. see "environment variables" section and put the .env file accordingly
  3. docker build and run
git clone https://github.com/arcatdmz/danoweb.git
cd danoweb
vi ./server/.env
docker build . -t danoweb
docker build . --file Dockerfile.local -t danoweb:local
docker run --name danoweb -v ./public:/work/server/public -p 8000:8000 danoweb:local

c) deploy to Heroku

  1. git clone
  2. see "environment variables" section and put the .env file accordingly
  3. create a Heroku project
  4. run heroku config:push to save .env content as config vars
  5. git push to make the project public
git clone https://github.com/arcatdmz/danoweb.git
cd danoweb
vi ./server/.env
heroku create <your app name>
heroku stack:set container
heroku config:push -f ./server/.env
git push heroku master

environment variables

  • before starting the server, put .env file in ./server/ -- all the values except for USER_PASSWORD are related to firebase cand can be retrieved from the website
API_KEY={YOUR_FIREBASE_API_KEY}
AUTH_DOMAIN={YOUR_FIREBASE_AUTH_DOMAIN}
DATABASE_URL={YOUR_FIREBASE_DATABASE_URL}
PROJECT_ID={YOUR_FIREBASE_PROJECT_ID}
STORAGE_BUCKET={YOUR_FIREBASE_STORAGE_BUCKET}
MESSAGING_SENDER_ID={YOUR_MESSAGING_SENDER_ID}
APP_ID={YOUR_APP_ID}
DATABASE_PREFIX={PATH_PREFIX_FOR_YOUR_DATABASE(optional)}
USER_PASSWORD={PASSWORD_FOR_AUTHENTICATION}
  • optionally provide the following environment variables
  • do NOT define these variables when the application runs in a Docker container (especially Heroku that provides a unique PORT for every deploy)
USER_DIR=./public
HOST=127.0.0.1
PORT=8000

develop

build

  1. install deno (tested with v1.7.1)
  2. build client-side code (requires yarn) -- this can be skipped since the built files are included in the repo
cd client/
yarn install
yarn build

start

start the server with deno run (use deno without run for deno below v0.4.0)

cd server/
deno run --allow-env --allow-net --allow-read --allow-write --unstable server.ts

or yarn

cd server/
yarn start

https://github.com/arcatdmz/danoweb

danoweb's People

Contributors

arcatdmz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

danoweb's Issues

Implement file view

?mode=navigate query parameter shows a tree view of serving/edited files.

Serve *.ts file with MIME type 'text/plain'

Currently *.ts file is served as a video file and cannot be previewed in a web browser. Provided that danoweb is designed to help writing TypeScript files, this behavior should be fixed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.