You can find some info about the topic/post structures here https://github.com/NodeBB/NodeBB/wiki/Database-Structure.
For plugin development info you can take a look at https://docs.nodebb.org/development/plugins/
You can look into the hook filter:topic.build which already has the tags of the topic in the tags field. Then you can add the additional data in that hook for the template to use. Sample hook:
myPlugin.filterTopicBuild = async function (hookData) {
if (hookData.templateData.tags.includes('marvel') {
hookData.templateData.posts[0].content += '<br/>this user likes marvel';
}
}
This is just a simple example feel free to modiyy & improve.