LeTroner Posted November 8, 2016 Share Posted November 8, 2016 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 More sharing options...
LostKobrakai Posted November 8, 2016 Share Posted November 8, 2016 I'm not sure you'll get a good answer to this one if you won't add what you intend to do with those data. It could be from "simple pages are fine" to "do not use processwire to start with, but take a look at graph databases first". Link to comment Share on other sites More sharing options...
LeTroner Posted November 8, 2016 Author Share Posted November 8, 2016 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 More sharing options...
szabesz Posted November 8, 2016 Share Posted November 8, 2016 (edited) 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 November 8, 2016 by szabesz typo Link to comment Share on other sites More sharing options...
LeTroner Posted November 8, 2016 Author Share Posted November 8, 2016 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 More sharing options...
szabesz Posted November 9, 2016 Share Posted November 9, 2016 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now