~philipwhite/webpad

A minimal collaborative plaintext editor - notepad.exe for the internet
Abstract logic that requires the user to be an owner
13eb1e12 — Linux User 4 years ago
Make username use stronger type
21fa466e — Linux User 4 years ago
Use stronger type for user IDs.

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~philipwhite/webpad
read/write
git@git.sr.ht:~philipwhite/webpad

You can also use your local clone with git send-email.

#WebPad: notepad.exe for the internet

The best part of Windows is notepad.exe. It opens instantly and has a minimal, exactly-what-I-wanted interface; its simplicity is its greatest strength. In contrast, Google Docs is so much more than I want for keeping track of lists or writing notes. Those tasks do not require the functionality of a word processor, and Google Docs comes with the cost of slower load times and more data transferred in total (which especially matters when you don't have an unlimited data plan).

However, Docs has one major benefit: documents are available everywhere with no extra effort (you don't even have to save the document). This is a such a huge benefit that it's worth the pain of dealing with Docs in order to obtain it. Docs additionally allows sharing of documents so that more than one person can edit the document; this is also a very useful feature that makes Docs an extremely useful program.

This project intends to provide the same major benefits of Google Docs, while also providing a simple, notepad-like experience. In addition, there should be no reason to avoid using the software heavily on a very limited data plan (for example, a 1 GB/month).

#Goals

  • Single executable server; easily self-hostable
  • Documents stored as plaintext files for easy exporting of data
  • Low amount of data to transfer
  • As easy-to-use as notepad.exe
  • Documents are sharable
  • Documents save automatically
  • Useful for me personally
  • Private by default, but not to the extent that it would compromise the user experience or the simplicity of the implementation.
  • Provide a good experience even with javascript disabled

#Non-Goals

  • Pretty and "modern" interface
  • Formatting and word processing features
  • Simultaneous editing by multiple people
  • Become popular
  • Make money

#Development

This project has a modest list of dependencies in build-depends, but a much smaller list of native dependencies. All that is required to be installed on the host OS is zlib and sqlite (and GHC and cabal-install of course). If you are a Nix user (I personally run NixOS), then you can just execute nix-shell --command "cabal build" since Nix will ensure the availability of all the dependencies, as described in shell.nix.

The tests are a Selenium python script in test.py. Running run_tests.sh deletes the database, starts the chromedriver program that automates the browser, starts the haskell server, and runs the test script. run_tests.sh requires the python selenium library and the chromedriver program, both of which are in shell.nix, so you can run nix-shell --command "./run_tests.sh". The test script uses a test database and test directory for files, so you don't have to worry about it resetting same database that is used when you execute cabal run.

Contributions are welcome! However, I would suggest contacting me before doing something too substantial, just to make sure that I am not already working on it or am not opposed to adding the feature itself. Contributions should use 4-space indent for Haskell (since it is whitespace sensitive), and single-tab indent for JS/CSS/HTML. It would also be helpful to add tests for any added functionality as well.

Feature requests are also welcome! It would be cool if people started using using this. Let me know if there are any blocking issues for hosting your own site.

#How Can I Help?

Here are some ways you can help out with this project:

  • Currently, the CSS styles for this project very bare-bones. I'd like to make the pages look better, so this is an easy way to help out with the project. Unfortunately, editing styles for the site does require knowledge of Haskell, since I am using Lucid to generate the page structure.

    The pages on this site are the following:

    • The admin page which allows adding a deleting users - /users
    • The user dashboard page which allows adding documents - /
    • The document editing page; this is the only one I am close to happy with the styles of - /document/<document-id>
  • Send an email to the mailing list asking how to help. I'll let you know what I'm working on and what would be most helpful in the moment.

  • Let me know how this README could be improved.

Send patches, feedback, comments, and salutations to the mailing list - ~philipwhite/webpad@lists.sr.ht. I want to hear if you are interested in this.

#Document Access Rules

Documents may be public or private, and additionally may have any number of users assigned one of three roles on the document. The roles include "owner", "editor", and "viewer". A user may view a document if the document is public, or if they have a role on the document. A user may edit a document only if they have the "editor" or "owner" role. Only owners may delete or add roles on a document.

If a user attempts to update both the title (or body) and the publicity, but they are only and editor (and thus cannot update the publicity), then neither the title nor the publicity will update, even though the user has permission to update the title. This is only a concern in the server API, since the only controls available in the UI will be controls that the user is authorized to use.