Metabase integration for Frappe and ERPNext

Hi,

I’ve created Metabase integration apps for Frappe and ERPNext.

Frappe does have Dashboard tools but it’s quite limited in terms of customization, creation and filtering. Metabase is an open-source dashboard tools which offer a lot of functionality.

This app offers an easy way to integrate Metabase into Frappe page.

Feature

  • Integrate Metabase into Frappe page using iFrame
  • Resize iFrame using Metabase resizer
  • Metabase link will expired based on pre-config time

Prerequisite

Repository


Any feedback or suggestions are welcome. :smile:


I’ve also created Plotly Dash integration for Frappe and ERPNext.
It’s suitable for developer who want more customization with their dashboard and data processing.

33 Likes

Awesome work Pipech! Definitely gonna use this, definitely!

However, can we go with your Docker image for ERPNext and integrate this? :slight_smile:

I have already integrated metabase. I’m eager to try this! :slight_smile:

Wow this is very good. Can wait to try. can this work with version 10? Am still running version 10.

I haven’t tried but it should works with version 10, 11, 12.

You could install Metabase Integration app like you could install any custom apps.

The easiest way is just create new Dockerfile and build from my image.

FROM pipech/erpnext-docker-debian:v12-py3-latest

### set workdir
# These variable has been set from base image
# $systemUser, $benchFolderName
USER $systemUser
WORKDIR /home/$systemUser/$benchFolderName

RUN bench get-app metabase_integration https://github.com/pipech/frappe-metabase.git

Or you could follow this guild to set-up CI/CD using GitHub and GitLab which you could use to install Metabase Integration apps or your custom private apps.

But I don’t think I’ll include this apps in Docker image by default because I believe the majority of people won’t use this apps and I don’t want the image to be bloated.

How ever I’ll consider creating a new image tags such as v12-py3-w_metabase-latest

Cheers! :nerd_face:

1 Like

Cheers! Thanks a lot for your work Pipech!

Great Work!

Dis you managed to make it work with SSL? I can’t figure how to make metabase work with the let’s encrypt created from frappe / erpnext.

So if the ERPNEXt/ frappe site is with SSL It seems it doesn’t work with metabase being without SSL. Any idea? Thanks!

I got message:

Failed to load resource: net::ERR_SSL_PROTOCOL_ERROR
desk:1 Uncaught ReferenceError: iFrameResize is not defined
at HTMLIFrameElement.onload (desk:1)

Kind Regards,

Rubén

@pipech

I followed all the steps and was successful up until the installation:
bench get-app https://github.com/pipech/frappe-metabase.git metabase_integration

I encountered the error below;

Traceback (most recent call last):
** File “/usr/local/bin/bench”, line 11, in **
** load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()**
** File “/home/frappe/bench-repo/bench/cli.py”, line 46, in cli**
** bench_command()**
** File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 764, in call**
** return self.main(args, kwargs)
** File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 717, in main
*
** rv = self.invoke(ctx)**
** File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1137, in invoke**
** return _process_result(sub_ctx.command.invoke(sub_ctx))**
** File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 956, in invoke**
** return ctx.invoke(self.callback, ctx.params)
** File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 555, in invoke**
** return callback(args, kwargs)
** File “/home/frappe/bench-repo/bench/commands/make.py”, line 62, in get_app
*
** get_app(git_url, branch=branch, skip_assets=skip_assets, overwrite=overwrite)**
** File “/home/frappe/bench-repo/bench/app.py”, line 116, in get_app**
** repo_name = git_url.rsplit(’/’, 1)[1].rsplit(’.’, 1)[0]**
IndexError: list index out of range
INFO: A newer version of bench is available: 4.1.0 → 5.1.0

Please be kind to advise what I may doing wrong.

Thanks.

@Sirjames

The command should be.

bench get-app metabase_integration https://github.com/pipech/frappe-metabase.git
2 Likes

@pipech

Have you tried this in develop branch (version-13)?

I’ve installed it without errors. I just cant find the actual dashboard anywhere in erpnext.

As far as I know I have setup the Metabase Settings page correctly and I’ve found the Metabase Dashboard List and New Metabase Dashboard forms and saved a new Metabase dashboard as per your github page. I just can’t find the actual dashboard card as per your animation.

I have even tried viewing the Metabase dashboard list as a “dashboard” from the left-hand sidebar (version 13) but this just wants me to add the standard erpnext cards and dashboard charts.

There is an issue with me

When I close my ssh terminal and java -jar metabase.jar running, after close ssh session I can’t access to localhost:3000

refer,

I want to run metabase on port 3000 and erpnext on port 80, How to configure in nginx?

1 Like

This page have some clues https://www.metabase.com/docs/latest/operations-guide/running-metabase-on-debian.html

Hey guys, I am trying to integrate this into ERPNext v13.6 but I’m getting this error: “UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x91 in position 187: invalid start byte”. If you know how to solve this, it will be much appreciated!

I checked the console and this was the full tracebok:

`Failed to load resource: the server responded with a status of 500 (INTERNAL SERVER ERROR)
request.js:387 Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 68, in application
    response = frappe.api.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 31, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 67, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1172, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/desk_page.py", line 32, in getpage
    doc = get(page)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/desk_page.py", line 15, in get
    page.load_assets()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/page/page.py", line 113, in load_assets
    self.script = render_include(f.read())
  File "/home/frappe/frappe-bench/env/lib/python3.6/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x91 in position 187: invalid start byte

/socket.io/?EIO=3&transport=polling&t=NgDWDmv:1 Failed to load resource: the server responded with a status of 502 (Bad Gateway)`

I have created a thread but no response has been received. If anyone could help that would be much appreciated. (Link to the thread: ERROR: UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x91 in position 187: invalid start byt - Developers / Bug - ERPNext Forum )

When will this app be available for Frappe Cloud?

Were you able to resolve the issue? Otherwise contact Mr. Jigme, ERPNext Expert who is working at Thimphu TechPark Limited.