Database Tables and Code issues
This is still a bit half baked, but it gives some idea of how things in
the backend will work.
Some kind of tag on things is needed to indicate whether it has been used
to update user ratings, In the middle of the night we want to use user
ratings to update other ratings.
- users: user_id, password, cookie, handle, email, first and last
names, address data, rating, image, sorting preference, probably
more stuff connected with computing ratings, what is public (all
but handle and extra is private by default, password, cookie,
and rating are always private.
- ip: Link ip addresses to users, count of log in's, May want to mask
out low order fields of addresses to avoid duplicates due to dhcp.
- comment: comment_id, comment_url, user_id, text, rating, votes
- commentv: link comment id to user and vote.
- commetnr: link comment id to user and rating.
- poll: poll_id, text, counts for each choice.
- pollu: poll_id, connect, user_id, and choice for each poll item.
- vote: For preference voting, pref_id, text
- votu: prefs_id, connect, user_id and preferences.
- followc: user_id, comment_id (for comments user wants to follow.)
- followp: user_id, poll_id
- followv: user_id, vote_id
- followu: user_id, user_id want to follow.
- lookup: word comment_id, poll_id, vote_id (To enable search on words)
Internal urls could have the form: <type><high level
index>.<next level index> ...
Code probably should have templates for various types of lookups.
Need pages to register/log in.
Each page needs a search box, and a way to change user prefs.
Home page should have links to site data, and show user's handle,
number registered, number of user actions today, It
should then display the top level hierarchy, Links sent out in emails
will take user straight to the relevant place.
Page to add comment/poll/vote (Probably users don't get to choose the
last 2) as when a poll/vote is suggested, it would be useful to have
feedback on the form it should take prior to starting the poll/vote.
Page to preview postings prior to submission.
Way to edit after submission? I think not, but perhaps user could ask
webmaster to correct a spelling error or minor mistake.
Page to display search results (includes link for next if needed).
Sort default results: highest rated first, highest rated last, most
recent first, most recent last, Have a limit of about 20 per page
with a <next> button.
Start with a separate code to create the tables, Code will be in C
for interface to the database, Despite experience with mysql, I will
switch to postgresql as I believe if the site should get huge that
would be a better choice.
Need subroutine to parse input strings.
Last modified: Tue Aug 2 16:08:11 PDT 2011