trestletech / todotxtpp

NodeJS Application with Dropbox Integration for Managing a Todo.txt File
MIT License
77 stars 8 forks source link

Todo.txt++

This project is not actively maintained. Help yourself to fork it!

A NodeJS web application that supports interfacing with the Todo.txt protocol with Dropbox integration.

Todo.txt++ Screenshot

Features

In the Works

Running the Code

If you want to modify the software or run your own copy...

Make sure you've followed the instructions below about registering a Dropbox application. You will also need a MongoDB instance -- if it's not running locally on the default ports, you'll need to use the TODO_MONGO environment variable to point to it. Then clone this repository then from the base directory execute:

npm install
node lib/main.js

You should then be able to access the site at http://localhost:3000/.

The code should be Heroku-friendly, you'll just need to config:set the environment variables below.

Setup & Configuration

Environment Variables

For now, the application is largely controlled through environment variables rather than a configuration file. The following variables are available:

*Settings you must provide.

Persistence

For the sake of simplicity, everything (sessions, users, settings, whatever) are all stored in MongoDB. Sessions are set to expire and be reaped from the database one day from their last use.

Dropbox Application

You'll need to register a Dropbox application which can be done here. You app needs to be a "Dropbox API app" with access to all files (not only the ones it creates) but only of the "Text" type.

Once you register the app, place the key and secret in a file named dropbox.json (you can use the existing file dropbox.json.example to guide you) in this directory. Alternatively, you can set the environment variables TODO_DROPBOX_KEY and TODO_DROPBOX_SECRET. Todo.txt++ will pick up these settings the next time it starts and interact with Dropbox as the application you registered.

Session Key

Session cookies are secured using a binary file in this directory named clientSessions.key which will be generated for you (using a secure, cryptographic generator) the first time you run the application if it doesn't exist. Feel free to modify this file to specify your own key, but be aware that changing the key will invalidate all existing sessions.

External Assets

Most libraries we can load unaltered from CDNs. The Ace Editor, however, is custom as we added a Todo.txt syntax highlighter that doesn't come standard. (The highlighting regex rules were initially taken from this project.) To build this yourself, you'll need to clone the forked repo which has this custom Syntax highlighter.