portable js for client widget and mongo storage for server