Database and authentication framework