Tribe Support

Tribe Support's Topics

Hunter Wilkes

April 12 2017

How to make a custom app

As I said earlier, I would like to make gadget that will display suggestions on dashboard. I was wondering if anyone had any pointers they could give me on the process of making a custom app and gadget.



#HowTo #CustomApp #AppDevelopment

Rastin Mehr
Rastin Mehr
April 12 2017 Permalink
Hunter, to start I recommend you to look into the Todos and Topics apps:

They are two examples of Media publishing apps for Anahita. Then look into the Groups App:

which is a good example of actor app in Anahita.

As you can see Anahita follows MVC design patterns in it's components. Anahita's Model is repository and domain entities. Anahita also places a graph architecture on top of the mysql database which is a relational database. An MVC triad is called a component. A package may contain multiple components.

Anahita supports component inheritance. For example media publishing apps (Todos, Topics, et.) are extending the com_medium. Groups and People apps both extend the com_actors component.

Anahita controllers have the main actions called BREAD (Browse, Read, Edit, Add, and Delete). For example _actionBrowse displays a list of entities or _actionRead displays an individual entity. There are two entities that you will be used most the time. Nodes and Graphs, because social networks are a network of nodes connect with graphs and some of the nodes exchanges messages (stories) that's why we call it the Nodes-Graphs-Stories architecture.

This is an old article the describes Anahita's lingo

Anahita Lingo

Learn the Anahita lingo and terms

this article describes what an actor node is

The Actor Manifesto

Defining an Actor in Anahita

now for building the suggestions app (components used directly by users) you don't even need to implement BREAD. Only the BR would do. The most challenging part is implementing the algorithm where each request checks the viewer against the list of conditions that I posted for you earlier and comes up with 1 or multiple suggestions
I don't know how to implement it yet until I sit down and code it myself. It is one of the apps on our 4.* road map.

So start code reading and try building an example app of your own which does a BREAD operation on a node entity. For example Blogs or Books, etc. Code reading and practicing is the best way to learn a new framework.
Hunter Wilkes liked this
Where is the query for $context->query in Todo's _actionBrowse($context) coming from? I don't see it in KCommandContext, KConfig, or KConfigInterface.
I'm still confused. To me, it doesn't look like $context->query should ever return something, since I don't see query as a member of KCommandContext or any of the classes it is inheriting from. I'm not incredibly familiar with php, but it seems like one of those classes should have a query member, if you're accessing it with the -> operator. Am I mistaken?
Rastin Mehr
Rastin Mehr
April 13 2017 Permalink
$context->query holds the query object which is an instance of the AnDomainQuery class You use it to construct a query and you can add more arguments and conditions to it in the child controller classes.

What are you trying to do?
Nothing yet, I was just reading through the code and got confused at that part. I couldn't figure out where it was coming from, so I figured I'd just ask.
Rastin Mehr
Rastin Mehr
April 13 2017 Permalink
I think to make matters less confusing it would be better if you focus on what problem you are about to solve and use the API and the code examples in the apps to make it happen. At first you many not know what happens underneath the app API and at the framework level and that's ok.

Anahita is the result of 4+ years of development and understanding the code at the framework level could take you months. You can however build apps without knowing the underlying magic within days. Gradually as you are developing more sophisticated apps, you can go to the deeper layers of the framework code and make sense of it over time.

You can always post your questions here. We have people here with little technical background who have successfully launched their projects with a few custom components and extensions. You can do that too.

Powered by Anahita