I am building an app that includes a full featured discussion board. Discourse has all the features required for the discussion board feature, so my plan is to use discourse as a starting point and to build features on top of it. I have followed guides to set up the official docker development environment locally and have added a couple features on top of it. I have also followed guides for the One Click Install of discourse on DigitalOcean. I am confused however, because in the process of deploying, I never connected the DigitalOcean instance to my repo. So my question is, how do connect my repo to the digital ocean instance so that I can begin deploying my new features?
I have read the following two links, but did not find an answer as I am not looking to just add plugins.
Unless you have a team of several full-time programmers to integrate upstream changes into Discourse, and you desire never, ever to get any help, whatsoever, here, what you want to do is “just add plugins.”
You should find those topics about plugin development and ask questions when you get stuck.
Or, if you want to run your own fork of Discourse. Good luck!
Thanks guys. I have read through the guides for plugin development and I think that there is potential I can achieve my goals with plugin development. There are still a couple things that did not get answered from reading the guides, as the guides seems to focus more on adding UI elements and javascript.
How can I extend the existing models to fit my needs?
How can I add controller functions to add new features onto the discourse app?
It’s probably best to take a step back and ask how to solve your particular problem rather than assume that you know the solution.
I am pretty sure that extending models is covered in those documents. A good way to get started is to find a plugin that does something like what you want and use it as an example.
I am sorry if it came off as me assuming I know the solution, as the opposite is most definitely the case. I am just very confused at this point. Forgive me if I am missing something, I read all 6 parts the following link for “Beginner’s Guide to Creating Discourse Plugins” and I don’t see anything about extending models or adding controller functions. Maybe an example would help clarify things.
Add longitude and latitude attributes to the user model and migrate the db. (Lets assume all the users are seeded with a longitude and latitude)
Install gem and follow the gem’s documentation for setup.
Create a controller function that that takes three parameters (radius, longitude and latitude) and uses the parameters to query the postgres database (using the gem) and return users within the radius as json.
Create a component in ember that allows users to enter in longitude, latitude and radius and then query the controller function created in step 3.
Create a component that lists the results of the query in step 4.
From the guides I have read, I think I understand how to achieve steps 4 and 5, but not steps 1-3. The guides seem to be only dealing with javascript and not ruby code.
I hope this helps to clarify my questions. Thank you
While I cannot help you with the other questions (but I’m sure someone else can), I have a word of advice here: Never let the database scheme deviate from the one provided by Discourse, or you’ll be in pain as soon as Discourse updates start making updates to the scheme.
Instead, Discourse core has mechanisms for plugins to store data, for example the plugin_store_rows table: For each user, you could insert a row there, with a key containing their user id and value containing a JSON object with latitude and longitude, for example