[wip] move module definition and add passport middleware