Glimmer Labs

Building a To Do List

Summary: This document provides an overview of the steps involved in building a Web-based to-do list service. It assumes that the reader has a little bit of experience in Perl, SQL, and CGI.

Warning: This document is under development.

Contents:

Some Design Notes

Sharing Tasks

We are creating a kind of shared to-do list. The intent is that users may have some shared tasks and may therefore want to look at each others' tasks. Someone can only create a task for him or herself, but may indicate that the help of particular other users is needed.

I still have not decided how much access each user should have to other users' tasks.

IDs

We will try to automatically generate IDs. Since we may need to create some IDs manually, we will make the automatically generated IDs even and the manually generated IDs odd (or so we hope).

Progress

There are many ways to represent progress on a task. We could have a "percent done" meter. We could have a field that represents the time spent so far. I've chosen to keep a separate "work table" that keeps track of various work sessions spent on a task.

Tables

Users

We start with a users table that stores basic information on the users of our service.

CREATE SEQUENCE "users_uid_seq" START 0 INCREMENT 2 MINVALUE 0;
CREATE TABLE "users" (
  "uid" integer 
     DEFAULT nextval('"users_uid_seq"'::text)
     PRIMARY KEY 
, "lname" character varying(16)
, "fname" character varying(16)
, "email" character varying(32)
);

Here's a quick way of filling in the table.

COPY users FROM stdin;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
2	Brantley	Daren	brantley@grinnell.edu
4	Schmitz	Cassandra	schmitzc@grinnell.edu
6	Rebelsky	Samuel	rebelsky@grinnell.edu
\.

Tasks

The tasks table stores information about all of the tasks. The primary information is the task name. Many other kinds are optional. We use a task id (tid) to index the table.

CREATE SEQUENCE "tasks_tid_seq" START 0 INCREMENT 2 MINVALUE 0;
CREATE TABLE "tasks" (
  "tid" integer
    DEFAULT nextval('"tasks_tid_seq"'::text)
    PRIMARY KEY 
, "uid" integer 
    NOT NULL
    REFERENCES users
, "name"   character varying(32) 
    NOT NULL
, "priority" integer
    DEFAULT 9
    NOT NULL
, "difficulty" integer
    DEFAULT 9
    NOT NULL
, "length"   integer
, "added"    date
    DEFAULT 'now'
    NOT NULL
, "deadline" date
, "completed" date
);

Categories

The categories tables stores information about all the categories of tasks.

CREATE SEQUENCE "categories_cid_seq" START 0 INCREMENT 2 MINVALUE 0;
CREATE TABLE "categories" (
  "cid" integer
    DEFAULT nextval('"categories_cid_seq"'::text)
    PRIMARY KEY 
, "name" character varying(32)
, "description" text
);

Task Categories

The taskcats table stores the categories of all assigned tasks.

CREATE TABLE taskcats (
  "tid" integer references tasks
, "cid" integer references categories
);

Subtasks

CREATE TABLE "subtasks" (
  "super" integer REFERENCES tasks
, "sub" integer REFERENCES tasks
);

Prerequisite Tasks

CREATE TABLE "prereqs" (
  "primary" integer REFERENCES tasks
, "prereq" integer REFERENCES tasks
);

Work

Forthcoming.

Collaborators

Forthcoming.

Queries

List all of the Rebelsky tasks by name

select users.fname, users.lname, tasks.name from users,tasks 
  WHERE
    users.lname='Rebelsky' 
    AND users.uid = tasks.uid
  ORDER by tasks.name;

This document was generated by Siteweaver on Wed May 28 13:33:44 2003.
The source to the document was last modified on Wed May 28 13:33:43 2003.
This document may be found at http://glimmer.cs.grinnell.edu/Notes/todo.html.

You may wish to validate this document's HTML ; Valid CSS! ; Check with Bobby

Glimmer Labs: The Grinnell Laboratory for Interactive Multimedia Experimentation & Research
glimmer@grinnell.edu