Design
The image above shows the basic setup and relationships between the various modules of the program. The web browser is the all encompassing component of the client program. The two other large parts of the program are the users / groups component and the database handler. These two components have all of the other pieces working with them in one way or another.
The authentication server is accessed by the web browser, users / groups, and libraries since it serves up the preview images, local HTML content, and handles user logins. The database is a MySQL database which is only accessed by the database handler and the authentication server for information.
This image shows some of the communication between the client and server. The authentication server and database don't necessarily have to be on the same machine, but can be. The client communicates with the auth server in order to log in to the program and to get local files from the auth server. When users communicate with the auth server to log in, the passwords are hashed and protected in transit with a nonce so that they can't be caught by third-parties. The client communicates with the database using queries for any information it needs after already logging in.