Menu

Tree [560d19] master /
 History

HTTPS access


File Date Author Commit
 .github 2022-09-27 harshpatel harshpatel [4e75fb] Force migration to run for prod
 nginx 2022-09-19 harshpatel harshpatel [58b037] Add missing closing curly bracket
 src 2022-09-26 harshpatel harshpatel [63e07c] Get APP_HOST from env file for Github Action
 .dockerignore 2022-07-31 MarbleMetrics MarbleMetrics [1b1b65] Optimize docker build, domain management, track...
 .gitignore 2022-09-09 MarbleMetrics MarbleMetrics [d7e8e2] Removing DS_Store
 LICENSE.md 2022-09-18 MarbleMetrics MarbleMetrics [94cb2a] Create LICENSE.md
 README.md 2022-09-27 harshpatel harshpatel [560d19] Add missing env vars to README
 app.local.dockerfile 2022-07-31 MarbleMetrics MarbleMetrics [1b1b65] Optimize docker build, domain management, track...
 app.prod.dockerfile 2022-09-13 harshpatel harshpatel [16d0cc] Replace host name in prod docker-compose
 deploy.sh 2022-07-10 MarbleMetrics MarbleMetrics [ecd47d] Added docker files, running in cloud
 docker-compose.local.yml 2022-09-25 harshpatel harshpatel [1c8cf6] Add indexes to domains and events tables
 docker-compose.prod.yml 2022-09-25 harshpatel harshpatel [b4f698] Use APP_HOST to direct traefik to container
 docker-compose.yml 2022-09-20 harshpatel harshpatel [9dcd31] User version 3.9 of docker-compose
 makefile 2022-07-31 MarbleMetrics MarbleMetrics [1b1b65] Optimize docker build, domain management, track...
 output.log 2022-09-11 harshpatel harshpatel [a9d0fc] Adding output.log
 web.local.dockerfile 2022-07-23 MarbleMetrics MarbleMetrics [bbe894] Splitting local/prod dockerfiles, adding makefi...
 web.prod.dockerfile 2022-07-23 MarbleMetrics MarbleMetrics [bbe894] Splitting local/prod dockerfiles, adding makefi...

Read Me

Marble Metrics

Build Staging

Marble Metrics is a simple, open-source, easily deployable, and privacy friendly web analytics software. Marble Metrics has many of the features that you would expect from other analytics software without invading your users privacy and without selling data to 3rd parties for advertisements.

Marble Metrics does not use cookies and is fully compliant with GDPR, PECR, CCPA.

You can run Marble Metrics on your own servers (by following the instructions below) or have us host it for you. We only host on European servers owned by European companies to ensure your analytics is compliant with the law.

Choosing Marble Metrics

Learn more about why you should choose Marble Metrics over other analytics providers on our website here.

🏛 Architecture

Broadcaster

The Broadcaster is the javascript file which is installed on your website to collect pageview data when users visit your site. It is designed to be as lightweight and un-intrusive as possible.

Backend

The Backend of the application is written in Laravel, a modern framework that makes it easy to write complex services.

One of the most important parts of the backend is The Collector. The Collector records the data from Broadcasters into a Postgres database.

Frontend

The frontend of the application is written in React, allowing a clean separation between the backend and frontend application.

🏠 Running Locally

The steps below outline how you can run Marble Metrics on your own machine. If you don't want to deal with running Marble Metrics on your own, we can handle it for you.

These steps have been tested on Mac OS X 12.5.

Prerequisites

  • Docker
  • Understanding of command line utilities
  • Understanding of modern frontend development with React
  • Basic understanding of Laravel.

Steps

  1. Run this command to start containers to run nginx, the Marble Metics app, and Postgres
    bash make rebuild-local
  2. Manually connect to the database with username postgres and password postgres create a marble_metrics database.
  3. Now you'll need to SSH into the app container to install all Javascript and PHP dependencies and run our Vite server. This will compile and serve up our frontend resources.
    bash docker-composer exec app /bin/bash cd src composer install npm install npm run dev

  4. Now you should be able to visit localhost to see Marble Metrics running.

  5. Next, we'll run migrations on the database to get all the tables setup. While SSHed into the container, run
    bash php artisan migrate

☁️ Running In The Cloud

Marble Metrics is hosted on Stackhero, a European company which has servers in Europe. This guide assumes you will be running on Stackhero. Marble Metrics should run the same on other docker cloud providers but there may be some work to get it all configured. If you don't want to deal with running Marble Metrics on your own, we can handle it for you.

Marble Metrics is deployed to Stackhero using Github Actions.

  1. Create a new Docker service within Stackhero. Keep the host, service ID, and certificates password handy as we'll be using them in a later step.

  2. Create a new Postgres service within Stackhero. Keep the host, username, and password handy as well be using them in a later step.

  3. Setup Github Actions environment variables

    • STACKHERO_DOCKER_HOST - set this to the value provided by Stackhero
    • STACKHERO_DOCKER_SERVICE_ID - set this to the value provided by Stackhero
    • STACKHERO_DOCKER_CERTIFICATES_PASSWORD - set this to the value provided by Stackhero
    • DOT_ENV - this will populate the .env to be used by the application, it should contain
      ```
      APP_ENV=staging
      APP_KEY=base64:<your app="" key="" here="">
      APP_DEBUG=false
      APP_URL=<your stackhero_docker_host="">
      VITE_APP_URL=<your stackhero_docker_host="">
      SANCTUM_STATEFUL_DOMAINS="${APP_HOST}"</your></your></your>

    DB_HOST=<your postgres="" database="" host="">
    DB_PORT=5432
    DB_DATABASE=marble_metrics
    DB_USERNAME=<your postgres="" username="">
    DB_PASSWORD=<your postgres="" password=""></your></your></your>

    GOOGLE_CLIENT_ID=<optional, google="" client="" id="" for="" signin="" with="">
    GOOGLE_CLIENT_SECRET=<optional, google="" client="" secret="" for="" signin="" with=""></optional,></optional,>

    MAIL_HOST=<optional, the="" smtp="" host="" to="" be="" used="" send="" emails="">
    MAIL_PORT=<optional>
    MAIL_USERNAME=<optional>
    MAIL_PASSWORD=<optional>
    MAIL_FROM_ADDRESS=<optional>
    ```
    Replace the values in triangle brackets with the appropriate values.</optional></optional></optional></optional></optional,>

    <your app key here> should be a random base-64 encoded string of length 32

  4. Now go to Github Actions and run the Build Staging action.

  5. One the action has finished running, you should be able to see Marble Metrics running by visiting the docker host URL.

License

Marble Metrics is open source under the GNU Affero General Public License Version 3 (AGPLv3).

License

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.