Requirements content: - student interests - activities - scrapbook - sample papers - ecbananas needs: - search - pages * links * data * title * version - version # - diffs * editor - language/syntax (could just be HTML) - users * authentication wants: - diffs - live preview - develop custom syntax - advanced search system * autocomplete - theme support - likes View: User Interface Sketches - 4 intro pages - 4 or 5 "normal" content pages - 4 editing pages Model: Data stored database: - SQLite data: - users * name * email * permissions * ip * encrypted password * salt * edited pages - index of page content (for searching) - pages * name/title/id * links (ingoing, outgoing) * page views * created by * date created * versions/revisions - changes per revision - edited by - edited on * content Controller: How the data and view are connected signup: - data involved: from user: username, password, email from server: session cookie - view1: present form for username, password, email - action1: (client) send data to server via POST with new view (not ajax) - action2: (server) save information to DB; trigger error if unsuccessful - action3: (server) if successful, log user in and send back session cookie - view2: show "success" or "error" message, if success, mark user as logged in login: - data involved: from user: username, password from server: session cookie - view1: present form for username and password - action1: (client) send credentials to server via POST with new view (not ajax) - action2: (server) authenticate user: look up username/password in DB - action3: (server) is successful, log user in, send back session cookie, otherwise, send error message - view2: show intro screen, with user marked as logged in logout: - data involved: from client: session cookie - view1: logout button in any view - action1: (client) send request with credentials to server via GET with new view - action2: (server) log user out, revoke cookie - action3: (server) send success or error message back - view2: Login page view page: - data involved: from user/client: page request (url with page title) session cookie (optional) from server: page content - pre-view: URL request (either from a clicked link or from direct user URL input) - action1: (server) generate view with content of requested page, or a 404 error if page does not exist (should happen automatically); logged in/out should be based on the presence of a valid cookie - view1: the requested page create / edit page: - data involved: from user/client: page request (url with page title) session cookie with permissions new version on server: current version of page (if exists) version details - pre-veiw: URL request (either from a clicked link or from direct user URL input) - action1: (sever) check if page exists (or send back error) action 1.1: if so, create edit view with current content action 1.2: otherwise, create new page (adding new page details, username, date), create edit view with blank content - view1: edit page with content and submission button - action2: (client side) send new edits to server - action3: (server side) re-authenticate, save edits with details - action4: generate "success" or "failed" view - view2: success/fail view search: -data involved: from user/client: query (search phrase) from server: index of content (for fast search) search results - view1: search page (or any view with a search bar) - action1: (client) send search query to server - action2: (server) run the query against the content index - action3: (server) gather results and format, creating search results view -- just show the title, no description - view2: search results page Views ------ Persistent bar: - login/out button - search Pages: - signup page: present form for username, password, email - signup success/error page: show "success" or "error" message, if success, mark user as logged in - login page: present form for username and password (no bar) - intro screen: show intro screen, with user marked as logged in - content page: the requested page - page editor: edit page with content and submission button - page edits saved: success/fail view - search results: page of search results