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.
I have also read this topic, but the poster is using an unsupported setup.
What is the official supported way to set up a discourse instance that I can push my own features to?
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!
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?
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.
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