Creating a more advanced plugin!
If i need a plugin with my own route like /mypluginpage and be able to read and write data to the database. Is there any clean plugin examples on how to do that.
I want to build a health register product that uses NodeBB as codebase. Am i suposed to build bigger plugins in NodeBB or is that just plain stupid. Also I have som plans on creating a Movie DB for my game community.
So much to learn and so little time
What is the basic npm packages I should know about when dev for NodeBB? Db-access layer, route framwork, NodeBB own standard libs? It feels like I am back to school again
My general advice for creating a larger plugin: put as little code as possible in the plugin itself. Put most of your functionality in a separate npm module or several modules. Whether you use an existing module or write your own. Make the plugin's only purpose to link NodeBB's hooks to the module(s) api.
I was new to web-development when I started making NodeBB plugins. Now that I know, I would have done all of my larger plugins this way.
@yariplus Can you give me some type of example of this. It seams strange to make many plugins for 1 thing
Lets say i want to make a movie DB for nodeBB that use the user information from NodeBB.
- Where do i store moviedata? In a separate DB or int the one that Nodebb uses?
- How should i split up the code for the Movie DB in several plugins?
- If you look at Open Fantasy plugin, thats a big plugin. Is it wrong to build it that way.
- Is there any lookup documents for all Nodebbs funktions and classes that i can read to get a better understanding of how NodeBB is built and the thoughts behind the architecture.
I am used to mysql and php witch is pretty different from nodejs, npm and mongodb. Its lot to learn!
@yariplus maybe you could build a plugin for me, if i pay you? Do you have any time to take on a projekt and how much is the fee I have a customer that has limited resources of money but today he have his health projekt built in wordpress / php / mysql.
Maybe some here would be up for the task
For instance, my rainbows plugin, parses a string into html with text colors stylized into a spectrum. The actual parsing is complex, but has nothing to do with nodebb. If I had made this functionality into a separate module, I could have easily used it in other projects, while making maintaining the rainbows plugin easier. This is just a small example though, where the separation isn't really needed, just nice to have.
For something like a movie db, there are probably existing modules that can do some of the functionality you want, and I would use them if they exist.
I would be happy to take on such a project. My rates tend to be lower than average, but I am constrained on time at the moment. E-mail the details if you are interested.