Bookmarks
This project is my personal replacement for del.icio.us. It has also been a very good way for me to learn about PSGI and Plack, and some of the more modern ways of writing Perl web applications.
Source Code
Database Design
The database consists of three tables: bookmarks, resources, and tags. I separated resources (which hold the URI and title of the targets of the bookmarks) from bookmarks (which have an ID, a creation timestamp, and a last-modified timestamp) as a matter of conceptual purity. Since the tags table references resources, it is clear from the database structure that the tag (like the title) is a property of the resource, not the bookmark.
Classes
CPAN Modules
The application currently depends on the following CPAN modules:
- YAML
- Plack::Builder
- Plack::Request
- Router::Resource
- Moose
- HTTP::Date
- SQL::Interp
- URI
- Encode
- JSON
- Template
Reports
Bash code snippet that will display a count of bookmark resources by URI host:
sqlite3 bookmarks.db 'select uri from resources' \ | perl -mURI -mYAML -ne'$uri = URI->new($_); $h = $uri->authority; $servers{$h}++; BEGIN { my %servers }; END { print YAML::Dump(\%servers) }'