Suggestions on Framework/API to create social graph and cross reference relationships - frameworks

Short Question Description
I have to develop an application for a security company that will store cases of harassment to their clients and cross reference any case with other cases if it detects it is the same person that is attacking them.
These relationships will be used to create a social graph of criminals and victims.
Initially I thought about managing it as a Social Network with some CMS or maybe Elastic Search with some frontend JS Framework but I have only experience with PHP and some basic React/Node.js so I wonder if there is something better that let me make the queries live as users fill in the forms.
Long Question with Use Case Example
Lets say they have two clients: ProtectedPerson1 and ProtectedPerson2
and there is a case saying BadGuy1 threatened PP1 in twitter with the handle #badguy1.
Then another agent that does not know anything about this case enters a new case for PP2, because someone in facebook is posting private photos of the client.
If they start to put the social information and they type #badguy1 or faceboo.com/badguy1 or anything similar the system should ask "is this the same person?" and if the agent selects Yes then both records of two separate cases are related to the same "criminal".
In the end the final objective is to gather all precedents possible to take legal action against someone if is necessary.
Is there any existing Framework, CMS or API that I can use to manage this relationships and create the desired suggestions and graphs?

After further investigation I found that what I really need is a graph database and the one that stands out as the most used one and with better support and integrations is Neo4j (https://neo4j.com) with a front end in React possibly as they offer official driver for javascript.

Related

What are some patters for designing REST API for user-based platform in AWS?

I am trying to shift towards serverless architecture when it comes to building REST API. I came from Ruby on Rails background.
I have successfully understood and adapted services such as Api Gateway, Cognito, RDS and Lambda functions, however I am struggling with putting it all together in optimal way.
My case is the following. I have a simple user based platform when there are multiple resources related to application members say blog application.
I have used Cognito for the sake of authentication and Aurora as the database service for keeping thing like articles and likes..
Since the database and Cognito user pool are decoupled, it is hard for me to do things like:
Fetching users that liked particular article
Fetching users comments
It seems problematic for me because I need to pass some unique Cognito user identifier (retrieved during authorization phase in API gateway) to lambda function which will then save the database record with an external reference to this user. On the other hand, If I were to fetch particular users, firstly I must fetch their identifiers from my relation database and then request users details from Cognito user pool..I lack some standard ways of accessing current user in my lambda functions as well as mechanisms for easily associating databse record with that user..
I have not found some convincing recommended patterns for designing such applications even though it seems like a very common problem and I am having hard time struggling if my approach is correct..
I would appreciate some comments on what are some patterns to consider when designing simple user based platform and what are the pitfalls of my solution. Any articles and examples will also be very helpfull.
Thanks in advance.
These sound like standard problems associated with distributed, indpependent, databases. You can no longer delegate all relationships to the database and get a result aggregating them in some way. You have to do the work yourself by calling one database, then the other.
For a case like this:
Fetching users that liked particular article
You would look up the "likes" database to determine user IDs of those who liked it, then look up the "users" database to determine user details such as name and avatar.
Most patterns follow standard database advice, e.g. in the above example, you could follow the performance-oriented pattern of de-normalising - store user data such as name and avatar against each "like", as long as you feel the extra storage and burden of keeping it consistent is justified by the reduction in queries (probably too many Likes to justify this).
Another important practice is using bulk queries to avoid N+1 queries. This is what Rails does with the includes syntax, but you may have to do it yourself here. In my example, it should only take two queries because the second query should get all required user data in one go, by querying for users matching the list of user IDs.
Finally, I'd suggest you try to abstract things. This kind of code gets messy fast, so be sure to build a well-encapsulated data layer that isolates application code from dealing with the mess of multiple databases.

Method to allow email recipients to change their account information

I'm using SugarCRM Community Edition. I have a bunch of contact information. There are fields I have empty that would like filled. I want each user to be able to fill out a form and fill in those fields.
I'm not sure how to hook each contact into the database. I imagine creating a generic form that somehow hooks into the database using a key. The form/php is not the issue. What is the 'key' and where is the 'door'? I think the door is the SOAP API but I'm not sure. The key, maybe the tracker id?
The only thing I am familiar with as far as interaction between an email campaign and the contact is the campaign 'Tracker'. I know the tracker url with removeme is used for allowing the user to opt out of emails. Is there a way to use this tracker to allow the person to edit their information? I think the answer to this is easy but I need some guidance.
One way of doing this is using the built-in REST api. There are a couple of helpful tutorials out there, here is a link to the one I used for guidance in a similar situation.
You can have a form post the data to your sugar crm's REST gateway, accessible via the url http://localhost/sugar/v2/rest.php.
Although it is quite straightforward to implement, you may want to look at this wrapper class that can be used to maybe keep things cleaner than the hacked up script churned out on the spur of the moment I used in my project.
Last but not least, be sure to glance over the documentation, in the Web Services section you will find more information.
Good-luck

Web frameworks oriented towards graph databases?

I am to build a web app and I have realized that my domain data will be best represented by a graph structure. Which web frameworks out there does the greatest job at integrating with graph databases (neo4j in my case) and thereby gives me the easiest time getting up and running? I am open for all languages (mostly..)
EDIT:
My use case:
I am creating a bug tracker for a university department. It will track all kinds of issues (eg.: the classroom 1-0-24 needs chalk for the whiteboard, the course 'Introduction to programming sucks because of...', The alarm on the door into the library is way too strict, etc.)
I have defined loads of 'Areas of responsibility' (AoR) that are related to each other in terms of 'topically relatedness', 'is a super-AoR', 'is a sub-AoR', 'the responsible team is also responsible for this other AoR' and such. I want to present a graph of these areas of responsibility to the user. This is my wishlist for the graph:
Initially only show a subset of the graph
The user can pan around
As the user pans in one direction, new areas of the graph is revealed.
The user can click on a node to a) read more about that AoR, b) assign the users current Issue to that AoR (or maybe even drag issues to a AoR, just like with friends in Google+)
Currently I am considering using Grails (for the non-graphy parts like security and user management) and raw neo4j for the graph parts (that is, not using the GORM plugin that tries to fit a circle in a square hole)
I have now read about InfoGrid and it sounds quite interesting - especially the view-part (though I don't know how close it will bring me to my UX goal). I'm also worryed that it will not be as productive as Grails for the non-graphy parts.
Neo4j doesn't seem completely lost when it comes to visualisation either:
http://wiki.neo4j.org/content/Visualization_options_for_graphs
The InfoGrid project built its own web framework on top of the InfoGrid graph database -- precisely because existing web frameworks don't match graphs very well.
For example, we have custom tags for traversing (simple and compound) edges, detecting certain topologies, converting node identifiers into URLs etc.
Disagreeing with the other commenter, it would be so much harder (and so much less fun) to use a non-graph-aware web framework. We used to :-(
Any web framework you'll choose, should be absolutely independent on the DB integration. From my experience, the best web framework is the one you know the best.
When choosing web frameworks, it is better to consider different criteria than DB integration, (like: public vs intranet application, statless vs statefull model, number of expected concurrent users, etc).

Creating a user controlled data service with Google App engine

I am designing a to-do list manager for the iPhone using GAE as the back end. My end goal is to create user sharable lists, and I was looking for some advice/examples of how to go about designing something like that. I know the google user API provides functionality for authenticating users, but from what I can tell any additional user management would be something I would need to implement myself.
Can something like this be done by simply adding usernames to a list that is a property of the data I want to share? I am guessing I am oversimplifying things, but any suggestions would be appreciated.
Thanks
you're right, app engine doesn't have any built in support for user ACLs or permissions, and a few quick web searches didn't immediately turn up any obvious open source libraries.
how to implement full-fledged permissions and ACLs for group sharing is definitely a nontrivial design question. there are a number of other questions here about it.
having said that, as a very rough first pass, you're probably on the right track with storing lists of users. i'd suggest that you abstract the list into separate Group entities, and attach those to yor data instead, so that users can define groups once instead of for every piece of data. i'd also consider storing separate lists of groups that can read vs write. finally, i'd store User properties in the group entities, instead of string usernames or email addresses.

Wordpress custom pages CMS

I'm considering Wordpress as my CMS platform for a client site I'm doing at the moment.
However, I need to create a couple of custom 'modules'. One of these modules is a form that people will be able to complete and have a quote, and once submitted, in a special place in the Wordpress panel (like a menu or something), there will be a listing of all the submitted quotes (just fetching it from a table in my database).
Another one is to manage a cafeteria menu, so the client can add a different meal to each day of the week.
I know perfectly how to do this kind of things using some kind of MVC framework and doing it 'by-hand', but I'm just wondering if this would be possible to do with WP and if yes, what kind of tools I'll have to use.
Thanks
Quite simply, yes, WordPress would be a more-than-capable asset to your criteria. But it's whether the learning curve in getting to know WP outweighs using a framework you're clearly already familiar with?
Personally, it sounds you like you're pretty solid with PHP, and considering the fact that, in my opinion, what you're planning on doing is relatively easy, I'd say WordPress is an excellent solution.
I'd recommend reading about WordPress 3.0's new custom post type API, and skimming the basics of hooks and filters in the Plugin API.
Submitted quotes would merely be a custom post type. You'd be better off writing the front-end code (like handling the form, UI etc.) yourself, either within a theme or plugin, then using wp_insert_post and let WordPress handle all the database administration. In fact, WP will go one step further and set up the entire admin for viewing, editing and deleting quotes.
Post meta (also known as custom fields) is also there for you if you need to store additional information about a quote that doesn't quite fit the post's table structure.
For the menu, this is even easier. I'd say just create a post category called 'Menu', and the client can publish 'dishes' to it as you would with a blog or any similar rolling format.
I've only licked the surface here. Get stuck in with the above, then check out some other goodies like meta boxes and custom taxonomies!
If you want to try a plugin instead of writing something yourself, Flutter might work. It's a little unpolished sometimes but it makes this sort of thing an absolute breeze.