diunuge / TodoMore

Top-level organizing module for TodoMore(TM), a geekish ToDo application.

Home Page:http://darwinsys.com/TodoMore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TodoMore

"To Do More, you must know what needs doing, and when"

ToDoMore is a Java geek’s TODO list application. It has a command-line interface, a server-centric (JSF) web interface, an Android application, and, well, more. Maybe an Ember.js or Angular.js interface, for example.

It is not, however, the be-all and end-all, and no aspirations to become what this person is on about: http://www.wired.com/2016/03/best-to-do-list-app/

As of late 2015, it is NOT ready for non-geek users; there are some things you still have to do "manually" in the SQL database, like, maintaining your list of Todo Categories. And, right now, most of it will only work for one user per installation.

It was written after the original author Ian Darwin tried using 5 or 6 different ToDo apps, both free and commercial, and found something lacking in each.

It is divided into sub-projects, each of which is currently a separate github module, so you don’t have to check out ones you don’t want (one of my peeves about git!):

  1. ToDoModel - the data model classes, in Java, Annotated for JPA (so would work with Hibernate too). All the other modules need this (see minimal build instructions below).

  2. TodoREST - the REST services.

  3. TodoJSF - the JSF web application.

  4. TodoAndroid - the Android client; uses an Android SyncAdapter to keep device and server in sync.

  5. TodoAndroidFirebase - demo Android client for Google’s FireBase; standalone, works but does not interoperate with the other modules.

There will be More. Someday. Maybe you will write some More.

No lock-in

The TodoService module’s JSF page can Export your Todo items in "standard" ToDoTxt.com format; there are numerous other ToDo apps that can also process this format.

Security

At present the TodoService module it is set up for one user, and depends on JavaEE container managed security. Like most REST services, uses HTTP BASIC Auth, so you MUST enforce use of HTTPS when you install it facing the internet! Caveat lector. You have been warned. Actually, this warning will self-destruct in a few years, when public HTTP goes away altogether. Remember if you heard it here first: http on the public internet will be gone by 2020. Because routers are not secure.

Building/Running

Pre-reqs

  1. Java 8 (the current Java release as of this writing)

  2. Maven 2 or 3

  3. If you want to run your own TodoService:

    1. A JavaEE server (Wildfly 8 used)

    2. A relational database (PostgreSQL used)

If you want to change the EE server or DB used, knock yourself out. If it works without drastic changes, please send me the config file changes via an github pull request.

The Data Model

All the other Java modules need the DataModel, so build it first.

git clone https://github.com/IanDarwin/TodoDataModel
cd TodoDataModel
mvn install

Maven will download some pre-reqs, build the classes, run some self-tests there, package the entire data model into a Jar file, and install it in your personal Maven repo, so the other modules can find it. BUILD SUCCESS -→ Done.

Breaking change: 1.1.1 of DataModel removes our custom Date class and uses the standard Java LocalDate. Now that Java 12 is here, there is no reason to be using Java 7 or earlier. If you need to drag this code back into the stone age (sorry!), stop on the way to the cave and pick up a copy of the pre-Java-8 JodaTime package.

The REST and JSF Services

You need the REST service for the Android client!

for d in TodoJSF TodoREST
do
	git clone https://github.com/IanDarwin/${d}
	cd ${d}
	mvn package
done

Now you need to set up your database and app server. For Postgres, the database setup is something like this:

psql
create role todouser with password 'top secret here' login nosuper;
create database todo owner todouser;
\q

I don’t create tables by hand, since JPA will do this automatically in "update" mode.

Now tell the app server about it. For me, this meant adding the following datasource to $WILDFLYHOME/standalone/configuration/standalone.xml:

                <datasource jndi-name="java:jboss/datasources/TodoDataSource" pool-name="TodoPool" enabled="true" use-java-context="true">
                    <connection-url>jdbc:postgresql:todo</connection-url>
                    <driver>postgres</driver>
                    <security>
                        <user-name>todouser</user-name>
                        <password>top secret here</password>
                    </security>
                </datasource>

I already had the Postgres driver installed; this is a bit of a pain point in Wildfly as of this writing, so best google that to see if they’ve fixed it.

Now you can install the app and begin todo-ing. For my setup this is just:

  1. Run the Wildfly user installer $WILDFLYHOME/bin/add-user.sh (or .bat if you’re on a batty operating system) to create an "application" user and put them in role "todouser"

  2. Edit src/main/webapp/WEB-INF/jboss-web.xml

  3. Run mvn wildfly:deploy in the two modules listed above.

This uses the Wildfly Maven plugin to deploy the webapp into the application server. There are skeletal plugin installations in pom.xml for others (at least Glassfish and TomEE) but they are NOT tested. Again, if you get another EE server working, please submit the changes so others may benefit.

If it works, visit some URL like https://localhost/todolist and see a login page. Login and see a list of tasks. Easy!

The Android Client

This is currently the least developed. IF you have the Android SDK installed, and either an emulator running or a device connected, try this:

git clone https://github.com/IanDarwin/TodoAndroid
cd TodoAndroid
mvn package android:deploy android:run

Go into Settings, configure your username, password, server, path, etc. Use the Test button to see if you can talk to the server. Turn on Syncing. Tasks should flow between your server and your mobile. Now you can get back to doing your tasks and checking them off!

Summary

May all your todo items be completed someday. Or not.

Ian

About

Top-level organizing module for TodoMore(TM), a geekish ToDo application.

http://darwinsys.com/TodoMore

License:BSD 2-Clause "Simplified" License


Languages

Language:TSQL 100.0%