Giter Site home page Giter Site logo

simpa's Introduction

Simpa

Your Open-Source Analytical App for Websites

"It simple, lightweight and portable!" - 5/5 The creator.

The 2 main features are:

  • a line chart showing unique visitors
  • a table with the top referers

If you are tired of google analytics complexity, want your data back, want to get rid of third party providers (and get rid of the cookie warning at the same time), this is for you!

Tech Stack

  • Handlebars
  • Bootstrap
  • NestJs
  • TypeORM
  • SQLite

Screen capture

alt text

Install

Server Side

Set env variables. You can change them in the docker-compose.yml or set them your favorite CI tool.

- SESSION_SECRET << Random key
- PASSWORD << To access the Admin Panel
- FILTER_ORIGIN << true or false (default) See below
- SIMPA_ADDRESS << http://20.20.20.20 or https://myapp.ext (no slash at the end)

Parameter FILTER_ORIGIN is important as it filters requests coming from the places not related to the URL you entered while adding an new site (see Admin). If you add a new site with mydomaine.com and set FILTER_ORIGIN to true, requests not coming from mydomaine.com pages' won't be counted.

SIMPA_ADDRESS needs to be set before building the app.

Docker Compose

If you want to install it locally (after a git clone usually)

docker compose up

But if you want to install the latest version without cloning, use the content of docker-compose.latest.yml

Admin

Once it's installed you can log to the admin (at the root of your host) using the password set in the env variables.

Then, you can add new sites to track. If you set FILTER_ORIGIN to true, make SURE you enter the right URL for your site as it will use that string to filter incoming requests.

Once it's done, the site will be displayed with its ID. Use it in SITE_ID below.

Client Side

Full example in examples/index.html

  1. Add this inside <head></head> and replace --YOURHOST-- by your Simpa address.
  <script src="https://--YOURHOST--/tracker/js"></script>
  1. Add this just before </body> and replace --SITE_ID--
  <script> march("--SITE_ID--"); </script>

A key is placed on the localStorage to count visits only once a day per device.

Dev & Debug

git clone
npm run start:debug

How it works

  • the client grabs some js code from your server
  • the march function calls the server with the site's ID
  • the server checks everything is right and update the DB

DB

  npm run migration:generate src/migrations/NAME
  npm run migration:run

simpa's People

Contributors

wanchai avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.