[Catalyst] User Generated Content (project collaboration)

Roman roman at fili.ca
Mon Aug 14 22:33:05 CEST 2006


Hi,


I emailed an attachment, and it was put in queue for moderation. It's 
been a while, so I figured I'd repost it in as a plain text version.

I am glad people are interested and even more important have experience 
with this sort of thing. I've also built a similar system already. Twice 
:) . Second time mostly copy-paste. That is why I figured it'd be useful 
to have something instantly reusable.

I already started working on the draft outline for the framework. I've 
pasted the RTF file with what I've brainstormed so far. It's really 
rough though and everything is open for discussion.

John has a good point about meeting on IRC and discussing this in 
greater detail. I think it'd be also a good idea to setup a wiki and I 
can transfer my ideas from the RTF file there so that others can 
contribute on those ideas.

----

General Ideas

* User single registration system/database for several sites
* Have site settings in the master database table and in the site 
specific table, and cascade down on the settings.
* I18N everything
* While programming:
1. Recreate the structure outline as described in Catalyst controllers, 
but do not code.
2. Write all the man pages restating what has been written for each 
point in the outline, but expand on the actual functionality.
3. Write test plans (at least try).
4. Code.
* Have different hooks in different places for plug-ins
* 4 date sets from “content” could be in a separate table and referenced 
from various places in the framework, e.g. user’s creation, modification 
time, comment creation, modification time, etc…
* Store all dates in GMT and have proper time zone in the config, 
calculate on the fly, that means when adding new items, the dates must 
be specifically written, rather than relying on the DB to insert dates
* Shared table for storing BLOB (check File::BLOB) images and reference 
to that table from various parts of the project. As a matter of fact, 
that could be a Model all by itself. Also have a controller that 
responds to different image paths parameters (e.g. 
/image/id_width_height) – like amazon does.

Philosophy

* Build less, underdo
* No meaningless documents
*

Structure Outline

* User [/user]
o Registration (username, email, password) [/user/register]
o Registration information change (email, password) [/user/change]
o Profile edits (first & last name, avatar) [/user/profile]
o Profile view [/user/about/username]
o Login [/user/login]
o Logout [/user/logout]
o Forgot password [/user/remind]
o Ban [/user/ban/username]
o Delete [/user/delete/username]
* Rating [/rating]
o Rating content [/rating/rate/content-id]
o Reset [/rating/reset/content-id]
o Top [/rating/top]
o Bottom [/rating/bottom]
* Comment [/comment]
o Content (subject, body) [/comment/leave/content-id]
o Edit [/comment/edit/comment-id]
o Delete [/comment/delete/comment-id]
* Tag [/tags]
o View [/tag/view/tag]
o Edit [/tag/edit/content-id]
* Content [/content]
o Add
o View
o Delete
o List
* Admin
o Users
o Content
o Comments
o Block usernames, emails, IPs

User

Registration

* Ask for minimum information.
* Require email confirmation.
* Use CAPTCHA.
* Checkbox for confirming the agreement (can be a hidden field on sites 
where this is not needed).
* Use pass-through registration. I.e. if user hits an area that requires 
login or registration, then save user action and data, ask to register, 
confirm, and then put the user to the exact spot he or she was at before 
registration with all data filled out properly.
* If user registered and had some data submitted before the reg, then 
don’t just commit the action right away, put the user back into the 
confirmation screen where he/she can edit what they submitted before 
registration.
* Preserve username case during registration; lowercase when all uppercase.
* Registration at Recipe Zaar is very nice: 
http://www.recipezaar.com/members/login/

Registration information change

* Allow password change, require to enter the old password
* Allow email change; require confirmation before the changes commit. 
Change request expires after N days.

Profile edits

* Allow users to add and/or change additional information.
o First and Last name
o Avatar (user image)
o Birthday
* Allow for categories of grouped profile options (like in vB) – 
sidebar. Could be all on one page split into <fieldset>s, and then 
controlled with JS to split into separate “pages” i.e. tabs.

Profile view

* Show user details.
*

Login

* Use pass-through login. When user submits a request that requires 
authentication, then login the user and put user back to the state user 
was before requiring the login. Put into the same action with the same data.
* Limit number of bad retries. Lock user out for N minutes.
* Allow users to be always logged in.

Forgot password

* Allow to enter username or email (in the same field)
* Send a confirmation email (like vB). If email is ignored, the password 
does not change. If email is confirmed, the user is required to enter a 
new password.

Ban

* Ban user by username.
* Change status to “ban”, but do not delete the user.

Delete

* Delete user by username
* Give option to “hard delete” and “soft delete”:
o Hard delete will delete the user from the system completely, including 
all the related stuff
o Soft delete will only set user status to “deleted”, but will not 
actually remove user data
*

Rating

Rating content

* Allow users to submit ratings
* Rating allowed only for logged in users
* Rating allowed only once per user. Log user ratings in the database, 
but purge the log every N days.
* Calculated rating cache is stored in the “content” table for quick access
* Rating algorithm will consist of several variables, such as user 
rating, date content was added, number of views, and others.

Reset

* Allows admin to reset ratings.

Top

* Shows top N content items
* N can be defined in the settings

Bottom

* Displays bottom N content items
* N can be defined in the settings

Comment

Comment Content

* Users can leave comments on the pieces of content
* Comment will consist of subject and body
* Database will also store date and time, user, IP.
* Have a flag that tells whether the comment was approved by 
administrator or not
*

Edit

* Edit comment subject and body.
* Save “edited by” and edited date & time.

Delete

* Allow hard and soft delete
* Show soft-deleted comments to admins (color code)

Tag

View

* Display a list of content for the particular tag
* Use top N tags as categories for content. Just list them in the order 
of popularity and link to that tag
* Have a “tag cloud”
*

Edit

* Users are allowed to add tags
* Amazon has a nice inline tag feature

Content

Add

* Allow registered users to add content.
* Framework will contain only basic content elements:
o Title
o Path segment (part of URI), steal from WP
o Status (0 – new, not approved; 1 – approved; 2 – deleted). Store 
status constants in the model, and export them into the main app i.e. 
use Content qw/:flags/;
o Date added
o Date modified
o Date approved
o Date released
o Owner (user)
o Rating (cache)
o Comment count (cache)
o Views (count)
*

View

* Use path for the URI when viewing [/content/view/path]
* Count number of views
* Use Regex attribute and forward() all requests from the root to this 
view, e.g. /very_cool_path -> /content/view/very_cool_path.

Delete

* Allow soft and hard delete
*

List

* Pagination (maybe like google, not show all of the pages at once)
* Sort by year/month/day [/content/chronology/year/month/day] ... not 
sure about this one. Same as in listing, forward everything that starts 
with 4 digits to the proper controller.



Yours sincerely,

Roman Filippov.



Zbigniew Lukasiak wrote:
> Hi,
> 
> Our new, still unreleased,  version of InstantCRUD shall have 
> authentication
> included.  I am thinking about it as a kind of framework going in the
> direction that you are talking about.  I admit it moves with a bit slow 
> pace
> and is still a bit experimental, but I hope you can find it useful.
> 
> -- 
> Zbyszek
> 
> On 8/14/06, Jason Crummack <jason.crummack at easysoft.com> wrote:
>>
>> Thomas Hartman wrote:
>>
>> I'm just in the prototyping stage of writing something very similar and
>> would be more than willing to contribute.
>>
>> Jason
>> > something like this would be really helpful to me.
>> >
>> > 2006/8/14, John Napiorkowski <jjn1056 at yahoo.com
>> > <mailto:jjn1056 at yahoo.com>>:
>> >
>> >     BTW, to respond directly to your thoughts on creating a
>> >     registration system, I have a good start on this as well, with a
>> >     system that sends an email for verification and all, however it's
>> >     quite messy and am thinking of fixing it up.
>> >
>> >     One other peice that is often needed is management of your friends
>> >     circle.  So you need invite a friend to join functionality as well
>> >     as a way to see if your friends are online and quick links to
>> >     their personal in system homepage.  --john
>> >
>> >     ----- Original Message ----
>> >     From: John Napiorkowski <jjn1056 at yahoo.com 
>> <mailto:jjn1056 at yahoo.com
>> >>
>> >     To: The elegant MVC web framework <catalyst at lists.rawmode.org
>> >     <mailto:catalyst at lists.rawmode.org>>
>> >     Sent: Monday, August 14, 2006 10:28:42 AM
>> >     Subject: Re: [Catalyst] User Generated Content (project
>> collaboration)
>> >
>> >     I'm working on something right now for a client with this.  He is
>> >     okay with me returning code to the community that is not part of
>> >     his core business, so stuff like wiki's, forums, moderation
>> >     (voting and karma), tagging, lightweight CMS, etc he is cool
>> >     with.  However I've already been working on this for a bit and may
>> >     not be taking the direction you might vision.
>> >
>> >     What I am doing is building a portal type framework and a group of
>> >     custom controllers for each of the basic content types.  I've
>> >     already done a lot of html/css javascript for this and am using
>> >     the dojo library.
>> >
>> >     Let me know what you think.  You are in canada, right?  I'm in
>> >     Beijing now but will be in the USA NYC time zone next week.  If We
>> >     have a few interested participants maybe we can setup a
>> >     brainstorming session on IRC or something like that.
>> >
>> >     --john
>> >
>> >     ----- Original Message ----
>> >     From: Roman <roman at fili.ca <mailto:roman at fili.ca>>
>> >     To: catalyst at lists.rawmode.org <mailto:catalyst at lists.rawmode.org>
>> >     Sent: Monday, August 14, 2006 1:01:25 AM
>> >     Subject: [Catalyst] User Generated Content (project collaboration)
>> >
>> >     I have an idea for a great Catalyst based project that can really
>> show
>> >     the power of Catalyst and spawn some extra projects from this and
>> >     give
>> >     Catalyst some coverage.
>> >
>> >     The idea is to build a framework for "User Generated Content" type
>> of
>> >     websites. All of those website usually have many features in 
>> common.
>> >     Usually the only difference is the type of content users generate
>> >     (pictures, texts, links, etc...).
>> >
>> >     The flow usually goes somewhat like this:
>> >
>> >        1. Register
>> >        2. Login
>> >        3. Participate in content generation
>> >        4. Modify profile
>> >        5. User interaction
>> >        6. Content votes, comments
>> >
>> >     But there are also a few "background" tasks such as:
>> >
>> >         * Content administration
>> >         * Moderation
>> >         * User management
>> >         * Website administration
>> >
>> >     The framework would have most of the features ready to go
>> >     out-of-the-box, and abstract the "content" part that can be
>> >     expanded and
>> >     adopted to specific projects.
>> >
>> >     Anyone interested?
>> >
>> >     _______________________________________________
>> >     List: Catalyst at lists.rawmode.org 
>> <mailto:Catalyst at lists.rawmode.org>
>> >     Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
>> >     Searchable archive:
>> >     http://www.mail-archive.com/catalyst@lists.rawmode.org/
>> >     Dev site: http://dev.catalyst.perl.org/
>> >
>> >
>> >
>> >
>> >     _______________________________________________
>> >     List: Catalyst at lists.rawmode.org 
>> <mailto:Catalyst at lists.rawmode.org>
>> >     Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
>> >     Searchable archive:
>> >     http://www.mail-archive.com/catalyst@lists.rawmode.org/
>> >     Dev site: http://dev.catalyst.perl.org/
>> >
>> >
>> >
>> >
>> >     _______________________________________________
>> >     List: Catalyst at lists.rawmode.org 
>> <mailto:Catalyst at lists.rawmode.org>
>> >     Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
>> >     <http://lists.rawmode.org/mailman/listinfo/catalyst>
>> >     Searchable archive:
>> >     http://www.mail-archive.com/catalyst@lists.rawmode.org/
>> >     Dev site: http://dev.catalyst.perl.org/
>> >     <http://dev.catalyst.perl.org/>
>> >
>> >
>> > 
>> ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > List: Catalyst at lists.rawmode.org
>> > Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
>> > Searchable archive:
>> http://www.mail-archive.com/catalyst@lists.rawmode.org/
>> > Dev site: http://dev.catalyst.perl.org/
>> >
>>
>>
>> _______________________________________________
>> List: Catalyst at lists.rawmode.org
>> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
>> Searchable archive:
>> http://www.mail-archive.com/catalyst@lists.rawmode.org/
>> Dev site: http://dev.catalyst.perl.org/
>>
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/



More information about the Catalyst mailing list