Issue with codebase

Hi. I have an issue with the codebase.

Util now, here are the things that I know and uncertain about Grafana:

  • Use Golang for the backend (Is go totally about the business logic and encapsulating the HTTP API? )
  • AngularJS for the frontend
  • Does Grafana have its own database except InfluxDB and so on?
  • Use nginx as a reverse proxy and NodeJS as a web server?
  • I want to know that is there any data flow diagram to help me have a better understanding.

Thanks ^^

  • Grafana uses Golang for the backend and the web framework Macaron.
  • Grafana uses AngularJS with TypeScript (with some JS too) and SASS for the frontend.
  • Grafana ships with Sqlite for Grafana data (dashboards, users, orgs etc.) but [can also use mysql or postgres].(http://docs.grafana.org/installation/configuration/#database)
  • Grafana does not have to be behind an Nginx reverse proxy. Does not use NodeJS as a webserver.

Try the Building from Source instructions to get started with the code. Golang code is in the pkg directory and frontend code is in the public directory.

Thanks for your reply. But i still hava some questions.

So there is no web server. Just use Golang for the backend server. Why does Grafana choose NodeJS and what role does it play? Write json http clients in?

Macaron builds on the Go http server implementation so it is the web server. Go Http is very bare bones so Macaron is a layer of middleware above it. It is a little similar to Express in NodeJS or Sinatra in Ruby.

NodeJS is for build time dependencies - npm, grunt etc.

Are you planning on writing a Pull Request or a plugin? Or are you researching Grafanas’ dependencies before you start using it in production?

I am studying Grafana for my graduation thesis .I have used Grafana and its awesome! For the first, I want to figure out how the frontend and the backend work. Writing a plugin is also planned.
As you know, the code is very large and it is really difficult for me. Anyway, your reply is is quite helpful to me. :smiley:

Depending on what sort of plugin you are writing you might need to know that much about the Grafana internals. Most plugins are frontend plugins (even the data sources). Data sources need a backend component if you want to provide alerting.

To get started on plugins, there is some documentation here.