Jump to content

Approach to build webapp


LeTroner
 Share

Recommended Posts

Hi! 

We are big fans of Processwire to build all websites for our customers. Coming from Wordpress and Drupal we appreciate the beautiful API and the total flexibility that this CMS offers. 

Now I want to take a step further. After learning a bit of Laravel and Vue.js I realised that Processwire is such a beauty to work with and that actually it would be so much easier to build MVP with it than with a full fledged php Framework. So as some other people I plan to build a JSON API with some methods I found in the forum. (Is there an alternative method to output things as JSON in the Core of Processwire?).

Anyway, the app I am building connects itself to social networks API's and retrieves information about the followers of a certain user in that network. So if an user has a lot of followers I need to retrieve the list of all these followers. 

So the data is basically: User--->Followers--->(Follower1, Follower2, Follower3, Follower4...)

I have been thinking and I am not sure I understand what is the best approach to represent the Follower data in Processwire. Would you create a page for each follower? Or how do you represent/store each follower for each user. Important to notice that Follower2 might be following 2 or more users. 

So how would you approach this kind of data in Processwire?

Thank you in advance for your help!

Link to comment
Share on other sites

Hi! Thanks for your answer. Good point! 

What I intend to do is check if the user is following back those followers or viceversa. So basically I want to retrieve the user->followers and the user->isfollowing and compare between them.

Usually each follower would have data such as ID, username, etc etc. 

Thanks!

Link to comment
Share on other sites

As far as I get it, currently you have two different questions:

1) How to implement many-to-many relationships, 2) JSON support in ProcessWire

So you might want to rename the title of the topic, 'cos it's to general and slightly related to these two questions.

Welcome to the Forums, BTW. It's good to hear that you compare ProcessWire to Laravel and to other frameworks too, and ProcessWire wins. I think you are right :)

Edited by szabesz
typo
Link to comment
Share on other sites

Thanks Szabesz. The JSON part is already controlled and working thanks to a good post another user made in the forum. It is the many to many relationships and, specially, how to handle the follower data and how to represent it in Processwire. A new page per follower? Field with a json value? 

Any hint is welcome! 

Link to comment
Share on other sites

Well, I opted for ProcessWire mainly for its Page/Selector design pattern (sure I like complete freedom on the frontend too...) so I would go with Pages, but it's just me...

BTW, Have you see this:

You might want to take a look at @Robin S new module. I have not yet find the time to test it, but looks promising.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...