Self-hosted HTML5 Notepad App

The modern notepad for writers, bloggers and journalists. Supports offline access and instant synchronization with your own server.

For comments and suggestions, please visit this blog post.

Download

Fork it on GitHub: github.com/kasparsd/HTML5-Notepad-with-Sync

Installation

  1. Upload files to your server. Somewhere like http://myname.com/notepad/
  2. Change the name of entries folder to something random
  3. Make that folder writable by the PHP (chmod 755 or chmod 777)
  4. Edit sync.php and specify the new DATA_DIR (the one you just renamed)
  5. Change also the username and password to something unique

Screenshots

Version 0.2 (2012)

HTML5 Notepad lists all notes

HTML5 Notepad with Markdown syntax and sync support

 

Version 0.1 (2011)

How Does it Work

The app consists of the following:

  • One HTML file with enabled offline access (cache manifest).
  • jQuery for all the Javascript and AJAX magic.
  • One PHP file with HTTP authentication for syncing with the server.

The files are stored in browser’s localStorage as key/value pairs with a unique timestamp ID as key and JSON formated content as value. An index of all files and their version timestamps is kept and used for synchronization during which all the content of localStorage is sent to sync.php in a POST request. The server reads its own index file and determines which new or edited entries need to be stored and which returned to the browser. All entries are stored on the server as JSON strings in simple text files.

1 Comment

Comments are closed.