Angdev Chocolat Save

Self-Hosted Event Analytics Service

Project README


What is Chocolat?

Chocolat is a API server for Collecting Event Data, and Analyzing. Most of data analysis services don't allow to use event data directly. Bring event data of your service.

Why is awesome, and developer-friendly service. SDK is well-documented, and a lot of open sources are provided. By building API server, we can use plenty of resources. If you need robust support (stability, scalability, etc), then use


Demo page


This demo includes keen-js, Data Explorer. Try to use keen.js client, and explore metrics below.

Getting Started


  • Go 1.4+
  • MongoDB 2.2+ (See Status)
  • Sqlite3 (development)
  • Mysql, Postgres (production)

Quick Run

Before running chocolat, make sure that mongo is running (localhost). Check out config/dbconf.yml, config/repoconf.yml.

Clone this repository:

git clone

Install go package dependencies:

go get .

or if you use godep,

godep restore

Build and Run:

go build && ./chocolat -r

If you want to install:

go install

but chocolat should be executed at chocolat directory, because of configuration files.


Database (Mysql, Postgres, ...) configuration is at config/dbdonf.yml. Repository (MongoDB, for event collections) configuration is at config/repoconf.yml. You can set config values directly, or using environment variable. (YAML files are preprocessed by golang template package)

Environment Variables

CHOCOLAT_PORT=3000, CHOCOLAT_ENV=development, REPO_URL, DATABASE_DRIVER, DATABASE_URL are configurable. web.environment @ docker-compose.yml will be a help to you.

Simple CLI Usage

Create a project

./chocolat -c

List projects

./chocolat -l

Show API Keys

./chocolat -p {{.projectID}}

Run Server

./chocolat -r
./chocolat -h

Play with Keen Open Source SDK

Create a new project:

./chocolat -c


And you can use chocolat with sdk like below (Javascript client example):

<script src="//" type="text/javascript"></script>
<script type="text/javascript">
  var client = new Keen({
    projectId: "{{PROJECT_ID}}",
    writeKey: "{{WRITE_KEY}}",
    readKey: "{{READ_KEY}}",
    protocol: "http",
    host: "localhost:3000",

If want to use with rails, then just use Ruby Client.

Data Explorer

Follow instructions: Explorer Quick Setup

and then just add chocolat project id, api keys!

Docker (Experimental)

Build chocolat image:

docker build -t chocolat .

You can test chocolat by using docker compose:

docker-compose up


Chocolat is in active development.

Currently, it just works at local development environment. It uses MongoDB as event data store to implement aggregation features fast, MongoDB may be changed to another database. So far, I've concentrated on API specification, so chocolat just likes skeleton. From now, Data collecting and Aggregation feature should aim high performance, and scalability.


Chocolat will be multi-components service. Even if chocolat is just api server now, but a lot of components (event aggregation service, message queue, ...) will be built.


  • Project API
  • Multi-Analysis API
  • Funnel API
  • Testing (Unit test, Integration test)
  • Mass event collecting
  • Fast event aggregation
  • Worker (e.g. Daily Report)
  • Dockerize


MIT License. See LICENSE for details.


  • open sources contributors
Open Source Agenda is not affiliated with "Angdev Chocolat" Project. README Source: angdev/chocolat
Open Issues
Last Commit
8 years ago

Open Source Agenda Badge

Open Source Agenda Rating