Confucius Tasks - HLD

Get Started. It's Free
or sign up with your email address
Rocket clouds
Confucius Tasks - HLD by Mind Map: Confucius Tasks - HLD

1. Reads your schedule from Google Calendar

2. Concept

2.1. Goal

2.1.1. Reduce missed tasks

2.2. Home page

2.2.1. Stats dashboard

2.2.1.1. Average missed tasks

2.2.1.2. Average percent of missed tasks

2.2.1.3. Average tasks

2.2.1.4. Missed tasks in last week

2.2.2. Logo

2.2.2.1. Old confucius in a business suite

2.2.2.1.1. Wei Wei?

2.2.3. Slogan

2.2.3.1. Wheresoever you go, go with all your heart. (Confucius)

3. Functionality

3.1. It can also

3.1.1. Update what you plan & actually did on Google Calendar

3.1.2. Update Todoist on completion & reschedule

3.1.3. Add tasks to Todoist (provided via Google Talk)

3.1.4. Add tasks from Todoist to Google Calendar

3.1.5. Add tasks from Google Calendar to Todoist

3.1.6. Produce reports on your tasks & activities

3.1.7. Publish in FaceBook & Twitter your missed tasks

4. Service

4.1. Deployed on GAE

4.2. http://confucius-tasks.com

4.3. Can be used by any Google User

4.4. User need provide Todoist account

5. Status

5.1. I had problem generating fixtures required for running Unit Tests locally, so I didn't yet write any

5.1.1. The problem is due to a problem specifying the exact location of the database file

5.1.1.1. If you don't specify it, each type of execution of the product (e.g., runserver, debug, shell, dumpdata) will generate a different database

5.1.2. A quick solution can be to generate the initial users in the shell & then run dumpdata to generate the fixtures

5.2. So, I only made a stupid test in the home page

5.2.1. http://confucius-tasks.appspot.com/

5.2.2. If you click on the test, it will send the uncompleted tasks list of a hard-coded user (admin), whose profile has my details

5.2.3. The tasks arrive to the IM client

6. Suggested features

6.1. Update the user success rate

6.1.1. Define in cron.yaml a service invoked daily

6.1.2. The service will create QueuedTasks per each user to calculate his success rate

6.1.3. The QueuedTask per user should read his uncompleted tasks from all days before today

6.1.4. Create a DailyStats record for each historic day

6.1.4.1. Unless it already exists

6.1.5. The DailyStats model can initially contain just:

6.1.5.1. user

6.1.5.2. date

6.1.5.3. total_tasks

6.1.5.4. completed_tasks

6.1.5.5. success_rate

6.1.5.5.1. completed_tasks/total_tasks

6.1.6. While you save them, count the DailyStats records that were indeed added (didn't exist before) & their total success rate

6.1.7. Update the UserStats model for the user

6.1.7.1. Or add it, if it doesn't exist

6.1.7.2. find the UserStats for the user

6.1.7.3. add the count of added DailyStats to total_days

6.1.7.4. add the total success rate of the added DailyStats to total_success_rate

6.1.7.5. calculate the avg_success_rate

6.1.8. The UserStats model can initially contain just

6.1.8.1. user

6.1.8.2. total_days

6.1.8.3. total_success_rate

6.1.8.4. avg_success_rate

6.2. Register new users when they add [email protected] in GTalk

6.2.1. Send an initial explanation about the system

6.2.2. Ask them for their Todoist API token

6.2.3. Create User & UserProfile records

6.3. Allow users to add tasks via GTalk

6.3.1. If a message arrives starting with "add task", add a TaskDialog object to memcache

6.3.2. Send questions

6.3.3. When a message arrives, check whether a TaskDialog exists for the user in memcache

6.3.4. According to the dialog_state attribute of TaskDialog, handle the question answer & ask the next question

6.3.5. When reached the final dialog_state, use tasks_provider to add the new task, & remove the TaskDialog from memcache

6.4. Show success rate in homepage

6.4.1. The view should require login

6.4.1.1. add the @login_required decorator

6.4.2. Get the user from the request

6.4.3. Read the UserStats record for the user

6.4.4. Show the avg_success_rate in the template

6.5. Remind users about tasks that should start now

6.5.1. Define in cron.yaml a periodic service running every hour

6.5.2. The service should get the list of all online users

6.5.3. Then it should create QueuedTasks per online user to check for scheduled tasks

6.5.4. The QueuedTask per user should get the uncompleted tasks scheduled for the current hour

6.5.4.1. Define in cron.yaml a periodic service invoked daily

6.5.5. If found, it should send the user a question: Have you started working on <task content>?

6.6. Show explanation & instructions on home page

6.7. Nag users about tasks that should have been started

6.7.1. If the user answers 'no' when asked whether he started working on a scheduled task, add the task to a list of pending tasks in memcache

6.7.2. The periodic service invoked hourly should check memcache for pending tasks

6.7.3. If pending tasks found, it should ask about each of them, whether the user started working on it

6.7.4. If yes, it should be removed from the pending tasks list in memcache

6.8. If tasks aren't scheduled, ask the user when he plans to execute them

6.8.1. It should get the unscheduled uncompleted task for each online user for today

6.8.2. It should ask per task when the user plans to execute it

6.8.3. then update todoist with the time

6.8.3.1. eg

6.8.3.1.1. @10am

6.9. Show a graph of DailyStats for the user

6.9.1. In order to see the trend in completing tasks

6.9.2. Read all DailyStats records for the user

6.9.3. Generate a JSON of the data

6.9.3.1. [[day, rate], [date, rate],...]

6.9.4. In the page, add a HighCharts bar chart with the JSON data

6.10. Add SocialAuth registration

6.10.1. Users will be able to login with their social credentials

6.10.1.1. FaceBook

6.10.1.2. Twitter

6.10.1.3. Gmail

6.10.1.4. LinkedIn

6.10.1.5. Yahoo!

6.10.2. Add the django-SocialAuth pluggable app to the project

6.10.3. Add required packages:

6.10.3.1. FaceBook python SDK

6.10.3.2. openid

6.10.3.3. oauth

6.10.4. After identifying the user, check whether it has a UserProfile record

6.10.5. If not: show a form asking the user to enter his UserProfile details

6.10.5.1. create a UserProfileForm

6.10.6. Save the form

6.11. Connect to Google Calendar, to check whether scheduled tasks conflict with scheduled event

6.12. Connect to Google Calendar to update scheduled tasks in the calendar

7. Resources

7.1. Site address

7.1.1. http://confucius-tasks.appspot.com/

7.2. Todoist API

7.2.1. https://todoist.com/API/help

7.3. Todoist Python library (that some guy wrote)

7.3.1. http://myzope.kedai.com.my/blogs/kedai/227

7.4. Binfire project site

7.4.1. http://www.binfire.com/collaboration/whiteboard/