| only for RuBoard - do not distribute or recompile |
Now that we know the system requirements, we can begin designing the solution and its components. Let's look at possible solutions to each of the three main requirements we listed previously.
There are several alternatives for user authentication, as we have seen elsewhere in this book. Because we want to tie a user to some personalization information, we will store the users'login and password in a MySQL database and authenticate against that.
If we are going to let users log in with a username and password, we will need the following components:
Users should be able to register a username and password. We will need some restrictions on the length and format of the username and password. We should store passwords in an encrypted format for security reasons.
Users should be able to log in with the details they supplied in the registration process.
Users should be able to log out when they have finished using a site. This is not particularly important if people use the site from their home PC, but is very important for security if they use the site from a shared PC.
The site needs to be able to check whether a user is logged in or not, and access data for a logged-in user.
Users should be able to change their password as an aid to security.
Users will occasionally forget their passwords. They should be able to reset their password without needing personal assistance from us. A common way of doing this is to send the password to the user in an email address he has nominated at registration. This means we need to store his email address at registration. Because we store the passwords in an encrypted form and cannot decrypt the original password, we will actually need to generate a new password, set it, and mail it to the user.
We will write functions for all these pieces of functionality. Most of them will be reusable, or reusable with minor modifications, in other projects.
To store a user's bookmarks, we will need to set up some space in our MySQL database. We will need the following functionality:
Users should be able to retrieve and view their bookmarks.
Users should be able to add new bookmarks. We should check that these are valid URLs.
Users should be able to delete bookmarks.
Again, we can write functions for each of these pieces of functionality.
We could take a number of different approaches to recommending bookmarks to a user. We could recommend the most popular or the most popular within a topic. For this project, we are going to implement a "like minds" suggestion system that looks for users who have a bookmark the same as our logged-in user, and suggests their other bookmarks to our user. To avoid recommending any personal bookmarks, we will only recommend bookmarks stored by more than one other user.
We can again write a function to implement this functionality.
| only for RuBoard - do not distribute or recompile |