Search for Resources and Solutions

About the Midrub Facebook Chatbot's code

The Midrub Facebook Chatbot app has a code adapted for the Midrub CMS and it follows all parameters required for a Midrub app. It has support for Midrub's api, cron jobs, ajax requests, hooks, teams, etc. 

You can translate this app in several languages and all languages directories are located in the language directory. If you want to translate it, please follow the documentation

The hooks located in the directory inc allows you to configure this app in the admin panel, restrict per plan and restrict per team. You can add there even other kind of files.

In the controllers directory you will see 3 files: user, ajax and bot. User is to display the html content to users. Ajax is to process the Ajax Requests. Bot replies to messages in messenger.

In the directory helpers you will find all files created to manage better the code and process only required data. The helpers are based on the controllers directory's files.

In the models directory you will find the app's models which creates the required tables in the database. I like now to use more the Midrub's Base Model for simply SQL queries but for more complex queries i'm using the app's model.

The directory views contains the views files loaded from from the User's controller. 

In this app i've used a new library with font icons which you can find here This library isn't loaded from app, it is available in the Midrub User's Theme, Luna. I'm providing the theme together with the Midrub Facebook Chatbot app. If you still want to use the Blue Theme, just add in the header from admin the link to icons.

The most complex part in this app is the diagram creator. I didn't used the canvas for more reasons. I'm not sure, but i think Midrub has the first diagram which is responsive. It was tested in more browsers and it will work as you expect. The complexity of the diagram creator isn't in complex code, but in too many code(about 20 k lines of code). I'm drawing the arrows with CSS and i'm using the JavaScript to adapt it dimensions.

You can use your CSS code to make effects and make this app more professionally.

Was this article helpful?