Giter Site home page Giter Site logo

kidgodzilla / implausible-vue Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 2.57 MB

A toy analytics app in Vue 3, using sql.js-httpvfs

Home Page: https://analytics.servers.do/?host=analytics.servers.do&range=30

HTML 2.36% Vue 57.24% JavaScript 40.40%
vue analytics httpvfs sqlite

implausible-vue's Introduction

Servers.do Analytics (Vue 3)

A simple analytics implementation that collects and serves data from a static CDN, using web workers, WASM, range requests, and some other fun tricks.

Screenshot

This frontend for Servers.do Analytics is written in Vue 3.

This project makes use of sql.js-httpvfs and sqlite3 for the database.

A static sqlite database is updated on an interval, and is directly accessed by the Vue app, using sql.js-httpvfs. No backend server is required to query data, only to update it.

This allows you to do some interesting things, like set up a snowplow collector on a CDN, and run a batch job to update the sqlite3 database -- effectively and end-to-end serverless solution (depending on your ETL solution).

Because the entire database is available for the public to view, sensitive columns can be encrypted (optional) using the AES-SIV algorithm, to allow users with a private key to their own website to view the data, unencrypted.

A compact "seed" is used to generate the encryption and decryption key on the collection server, to allow stateless embedding of the collection script.

Demo

https://analytics.servers.do/?host=analytics.servers.do&range=30

Ready-to-use Distributable

The following repo contains a bundled version of the frontend and backend that is the simplest to set up and self-host:

https://github.com/kidGodzilla/sqlite-analytics


Notes to self

These may not be as useful to other people as the original author.

Todos

  • Add dark mode
  • Display "current visitors" in the last 1 hour
  • Add deterministic encryption to the public database
  • Clean data in visits table older than ~32 days
  • Previous month view
  • Custom date ranges
  • Clickable charts
  • 12-month view
  • Composite indexes

implausible-vue's People

Contributors

kidgodzilla avatar senhajichihab avatar

Stargazers

Tim Kersey avatar

Watchers

James Cloos avatar  avatar  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.