Laravel & MongoDB and an advanced role/permission system - mongodb

I know there are a lot of role/permission packages like bican/roles or Zizaco/entrust .
They are great but I have two problems and those packages can't solve it!
I am using mongoDB and jenssegers/laravel-mongodb package which those packages do not support mongo.
And I need a multi-level/item-based role-permission system. I mean, for example: a user can edit just post 2 and post 3. NOT all posts!
So, I decided to develop that system myself, before starting it, I want your expertise to give me advice, useful links, articles, other packages, and anything which may help me.

you could use that it is almost like spatie/laravel-permission but for mongo db https://github.com/mostafamaklad/laravel-permission-mongodb
You just could create a permission with that post and give it to the user
or give it to a role and assign the role to the user

Related

Simplest CMS ever?

I’m building a super simple website with 5 pages and I want a CMS that allows me to change the text and the pictures in a couple of them.
In the past I used wordpress, but it has way too many features that i don’t need in this case.
I’ve been trying to learn gatsby.js so I would like to build it on that, but trying to see how to source from Netlify-CMS I started facing an overwhelming amount of information which I'm not sure I need.
Any tips?
Thanks!
M
Netlify has a built in CMS, and it's compatible with Gatsby! You can find examples online. It should be good for smaller sites, but for larger projects, I really like Prismic.io. Contentful is another popular one, but it's a bit pricier than prismic.
Edit: reread your comment about sourcing from Netlify. Netlify is not a "source" plug in in Gatsby. You use a local file +markdown source, and do the configuration for netlify, which adds an admin interface at an endpoint. You configure your data models in the interface, create login, etc. Then, when you submit changes, it modifies files in your connected git repo, so the local file + remark will make the data available in the graphql queries.
In the end I used Forestry.io, a good simple solution that did exactly what I needed in combination with Jekyll.

do not know how to install historymod

I find a lot of information dispersed over the Internet. There is nothing concrete. If I can guide point to point, to know what I have to install on the machine, and so to create the historical data for the statistics.
I need to make the "linear graph" widget work properly.
Greetings and thanks!
Please, take a look into the README document available on the github repository. Take into account that this file has been updated recently.
The historymod module is part of an specific application (FIWARE LiveDemo app) and not recommended as general solution. Have a look to the following post about how to persist hitorical context information comming from Orion.

On Mac what is the best Data GUI for Meteor and MongoDB?

I have looked into a few different GUI's including Robomongo, but I can't seem to get it connected to my Meteor database. Can someone please tell me what the best GUI is to use and how to implement it? I can't seem to find any guides online.
To connect using umongo:
In your terminal, run the following (make sure you're in your project directory):
meteor mongo --url someappname.meteor.com
Note: This assumes your app is being hosted by meteor. If accessing a local db, leave off everything after --url
The output should look like this:
mongodb://client:1234-abcd-1234-abcd-1234567890#production-db-a1.meteor.io:27017/yourappname_meteor_com
In umongo, go to File > Connect and enter that string in the URI field. Hit Enter.
To view documents within a collection, navigate to that collection in the sidebar and highlight the collection you want to view.
To view all documents in that collection, click on Documents > Find. Leave all fields blank and hit OK.
I've found umongo decent for viewing large collections, but the Meteor URI expires quickly and umongo will start throwing errors.
NOTE: You'll likely only be able to view files for a minute or two, so while the above will get you connected, it may not be of much use for more than simply viewing your collections (why not use terminal at that point?). For that reason, I suspect imslavko's suggestion of using z-mongo-admin is going to be the way to go when/if the project matures.
If you need a UI to look at Mongo database contents there are couple of options.
If you want something Meteor specific, take a look at this atmosphere package: Houston Admin. It is a 3rd party package built by the community.
For more general solution take a look at genghis, ruby gem with nice UI.
I like mongohub on mac. Feels very mac :-)
Link here: github

Some questions before choosing/start learning Yii framework

I've been developing simple PHP/MySQL web sites for some years.
Never used a PHP Framework before and I understand I'll need to know OOP, no problem.
I'm about to start a SaaS project of my own.
A)
So far, I've seen Yii generates the CRUD and pages according to the DB.
Is it easy to modify the generated code?, like, adding a new DB field and its form field without not generating again all the stuff every time I change something in the DB and losing other customizations?
I mean, I'm 100% sure the generated DB code and pages are not going to be enough and I'll be constantly adding and correcting fields, and adding more tables etc.
B )
My project will include a Shopping Cart and Calendar(for events, tasks, etc.).
Does Yii has these options or at least an easy way to implement it like the Authentication options or Database listing, etc.?
C) Does documentation has this explained as a tutorial/book or is more like a reference(minimum explanation that only advanced user understand how to integrate it)?
thank you very much
Yiiframework has excelent documentation (you can start from here). Also there is an extensions area in the downloads section where you can find all available yii extensions.
All your questions can be answered if you follow their easy tutorial.
A) Yes, it's easy. You will just add code for new fields not changing it all.
B and C are answered by Stratosgear very well.
Is it easy to modify the generated code?
Yes it is. If you later decide to add more fields to the table, you can do that from your Phpmyadmin using sql commands.
You also need to edit the generated class file adding those new fields to correspond with that on your table.

How can I browse or query live MongoDB data?

I've googled around but couldn't find a working MongoDB viewer or data browser.
An ideal (for my needs) tool would be a web based viewer with dead simple features (browsing and doing queries).
You have :
Mongo3
futon4mongo
See: http://nosql.mypopescu.com/post/334469038/a-couple-of-nice-gui-tools-for-mongodb
Hopefully it'll be updated frequently when new tools are available!
EDIT:
Better overview: http://www.mongodb.org/display/DOCS/Admin+UIs
I just tried MongoVUE and it works like a charm!
Check it out: http://www.mongovue.com/
MongoHub is moved to a native mac version, please check http://github.com/bububa/MongoHub-Mac.
genghisapp is what you want.
It is a web-based GUI that is clean, light-weight, straight-forward, offers keyboard shortcuts, and works awesomely. It also supports GridFS.
Best of all, it's a single script!
To install it
$ gem install genghisapp bson_ext
(bson_ext is optional but will greatly improve the performance of the gui)
To run it (this will automatically open your web browser and navigate to the app as well)
genghisapp
To stop it
genghisapp --kill
https://github.com/Imaginea/mViewer
I have tried this one and as a viewer it's awesome with tree and document views.
Im just testing Rock_Mongo
It's a nice tool, written in PHP.
MogoVue is the best option I found so far, it has great features I did not see in other viewers, plus it gives few options to look at the data, as json, tables and hierarchy, which is extremely useful.
Avoid MongoExplorer, it has major issues, which can cause you huge headaches. When viewing records using this tools, it may change fields which are MongoId's to plane string, it does not give any indication on this, just does it when you focus on the id field, this bug cost me lots of time and effort trying to find "what and where in my code i'm doing this silly thing"...
RoboMongo
Genghis
And entire list from here http://docs.mongodb.org/ecosystem/tools/administration-interfaces/
While the built in Http Interface of MongoDB isn't exactly what you are asking for, but it is available and supports a REST interface to do simple queries, etc. This is built-in to the mongo instance with a default of port 28017.
Documentation: http://www.mongodb.org/display/DOCS/Http+Interface
As well as those mentioned by shingara, there's also:
Opricot
PHPMoAdmin
MongoHub (I've heard mixed reviews on this one, not sure if it's maintained)
Just pushed mongoclikker to GitHub. It's a dead simple MongoDB viewer written in Node.
There a lot of UIs on official mongo site http://www.mongodb.org/display/DOCS/Admin+UIs
To add to the list :)
I just made a simple Mongo browser based on a hierarchical JQueryTreeview and implemented in Sinatra and Ruby.
The reason for another viewer was that I wanted something that was fast and easy (both to use and the code base), that would let me peek at what was going on my MongoDB. Also, I wanted some nice Ajax effects. and could be the base of a more complete browser.
https://github.com/tomjoro/mongo_browser
I just released a simple web-based data viewer called Mongs. It isn't a server admin GUI, it's focused on data browsing, which sounds like what you're interested in. Mongs is implemented in Python using the Aspen web framework.
JMongo is nice db viewer using on fedora linux
I started work on small project: https://github.com/lucassus/mongo_browser
It's a mongodb browser based on ruby's sinatra framework.
here is the better tool for sql as well as No-Sql viewer and also you can query in gui mode with this tool.
"RoboMongo" is easy to use and cross platform, using on centos 6.2 but no option for data import/export which can be found in "umongo" but not easy to use as RoboMongo.
For web: genghis is simple and have much more fashion interface.
For desktop: robomongo: Shell-centric cross-platform MongoDB management tool
I'm using MongoDB Compass. You can download the community edition by entering valid information.
I using Robomongo, in version 0.8.3 implemented multiply inserting documents, for more details https://github.com/paralect/robomongo/issues/173. Robomongo also have builtin mongodb-shell may be usefully for your purposes.