Giter Site home page Giter Site logo

mikethesapien / bast Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kooparse/bast

0.0 0.0 0.0 6.76 MB

:monkey: Web analytics focusing on privacy and simplicity.

License: MIT License

JavaScript 2.09% Rust 54.62% TypeScript 40.74% Makefile 0.28% HTML 0.45% PLpgSQL 1.12% Dockerfile 0.71%

bast's Introduction

Bast

CI

⚠️ This project is not maintained anymore.



Bast is an open sourced web analytics, giving simple informations about your site traffics.

I did this project for myself. It is currently used by a couple of friends so it might be useful for others (if you’re a small business, an indie, a blogger…). This project is free and you can do whatever you want with it.

The backend is made in Rust using actix-web web framework and diesel as PostgreSQL ORM. The frontend is (mostly) static and made in React with Next. I used chakra-ui for the interface (but the graph is custom).

Interface

preview


Tracking

We track all metrics over time, days as our atomic scale.

Pageviews are anonymous or identified visitors, so 3 visitors equals 3 pageviews. On each pageview we store the referrer, the current url, etc...

Users is the number of unique visitors to your website. We don’t rely on cookies to identify any particular user. We construct an identifier from his IP address and his user-agent (hashed and stored in the database), It’s really inspired by what Ackee does. So if a user visits two pages, you will see 2 pageviews but only 1 user.

A new session starts after 30 minutes of inactivity. So if a user opens your websites 3 times under 30 minutes, it counts as 1 session. If it's 1 time under 30 minutes and 1 time after; it counts as 2 sessions by the same user.

The average time is stored only if it’s between 5 secondes and 30 minutes on each sessions.

We use the woothee to parse and get information from user-agents; we get the browser name, operating system and other useful data.

And that’s it! Also, I would love to have the geolocation but not for now.


Contributing to the project

Don’t be shy about shooting any questions you may have. If you are a beginner/junior, don’t hesitate, I will always encourage you. It’s a safe place here. Also, I would be very happy to receive any kind of pull requests, you will have (at least) some feedback/guidance rapidly.

Behind screens, there are human beings, living any sort of story. So be always kind and respectful, because we all sheer to learn new things. See contributing file for more exhaustive details.


Deploy Bast with Heroku

Easiest way to deploy the project!

Deploy

Install on your machine

Unix and OS/X

For the api.

  • Fork or download this repository.
  • cd to the project's location.
  • cargo install diesel_cli --no-default-features --features "postgres".
  • diesel setup (You'll need postgres up and running).

For the front.

  • cd to website folder.
  • npm install

Running Bast with Docker on your machine

Once docker is installed on your machine, you just need to do:

  • docker-compose up
  • Live at http://localhost/3333

Also you could customize all environment variables from docker-compose.yml


Running the api in development

For the api.

First create a new .env file at the root. You should use .env.sample to get all required values.

If you want to watch the project while developping it, install cargo-watch first.

  • cargo install cargo-watch
  • run cargo watch -i "website/**/*" -x run
  • Live at http://localhost/3333.

Otherwise simply run cargo run.

For the front (website).

  • cd to website folder.
  • npm run dev
  • Live at http://localhost/3000.

Thanks

I read the Fathom codebase, it’s a pretty cool project made in Golang. If you don’t want to spend time on hosting your own web analytics and you would like to pay for a service, you should definitely check their plans.

To identify users without using cookies, I was inspired by Ackee. So don't hesitate to check this cool project; it's fully made in javascript.

bast's People

Contributors

dependabot[bot] avatar ni-achene avatar kooparse avatar github-actions[bot] avatar root-io avatar shirshak55 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.