curl '.../primary/signup.social.json' -uadmin:admin -v -X POST -H "Accept:application/json" --data 'email=user1@gmail.com&password=123456&:operation=social:createTenantUser' --compressed
curl http://localhost:4502/content/kids/en/myhome/jcr:content/parsys/voting -uuser1@gmail.com:123456 -v -X POST -H "Accept:application/json" --data ":operation=social:samples:toggleFavorite"
*toggleFavorite is a custom method in new Favorites Bundle.
We can create a custom API using one of REST HATEOAS frameworks in java like Spring HATEOAS + Spring Boot and manage data in a separated MongoDB (other database for big collections).
Create Users:
curl -i -X POST -H "Content-Type:application/json" -d '{ "username" : "user1", "email" : "jhelbert@gmail.com", "favorites": [{"cardId": "/content/kids/en/myhome"}]}' http://localhost:9090/users
Edit an user (adding a new favorite):
curl -i -X PUT -H "Content-Type:application/json" -d '{ "favorites": [{"cardId": "/content/kids/en/games/wow"}]}' http://localhost:9090/users/56b43f3dd4c608c967315913
Create Favorites:
curl -i -X POST -H "Content-Type:application/json" -d '{ "cardId" : "/content/kids/en/myhome", "users": [{"id":"56b43f3dd4c608c967315913"}]}' http://localhost:9090/cards
We can use SOLR as data repository for "social" collections like 'users' (with profile, preferences, etc) and 'favorites'.
I tried to find a similar approach as this one for Favorites but I just found mixed approaches (MongoDB + SOLR)