The first thing I would like to do is try to simplify the situation and reduce the interaction, referring to the principle of shared responsibility, etc. http://www.codinghorror.com/blog/2007/03/curlys-law-do-one-thing.html
Put these schemas in your own files, e.g.
models/client.js models/assistant.js models/contact.js
I also found that inline docs + mongoose are usually PITA. I would probably promote all those who were in the top-level documents.
You do not need to insert object keys in quotation marks.
routes = { list: function() {}
Also, the "list" in typical REST applications is called "index". Anyway.
Well, I will break it differently. Since you need the material from the index.js file in the middleware, they become closely related, which is bad. In fact, I think I would rewrite it all to be more neat. Unfortunately.
I would probably replace your middleware file with an express resources controller https://github.com/visionmedia/express-resource (created by express author). This is a good foundation for quiet controllers such as what you are building. The autoloader is really sweet.
You can also see: http://mcavage.github.com/node-restify/ This is new, I have not tried it, but I heard good things.
Since you are building a mostly automated mongoose-crud system with optional redefinition, I would create an express resource controller as a base
/controllers/base_controller.js
and it might look like
var BaseController = function() {}
Then I would do something like:
/controllers/some_resource_controller.js
which might look something like this:
var BaseController = require('./base_controller') var NewResourceController = function() {
Then, to use it, you can do:
var user = app.resource(myResourceName, new ResourceController());
... inside some loop that sets myResourceName like any pile you are trying to configure.
Here are some links for you:
Also, it looks like you are not writing tests. Write tests.