DB as event module, main.js adapted