xuanlu0115 / _stats

A self-hosted, real-time analytics collector and dashboard.

Home Page:https://stats.udara.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

_Stats: A real-time analytics dashboard

A self-hosted, real-time, analytics dashboard with support for custom events and privacy preserving tracking. If you're looking for simple analytics software for a small–medium traffic website, this could be the right fit for you.

Getting Started

  1. Update the config at ./src/config
  2. Setup a database of your choosing and set the appropriate configuration in ./prisma/schema.prisma. You can take a look at all the supported databases in the Prisma docs

Start tracking events

Once you have the application running, you can embed some javascript on sites you want to track events from.

Place the code in the <head> of your page and remember to add the domain to the CORS_ALLOWED_ORIGIN array in ./config inorder to allow cross-origin requests.

<script async src="https://your-app-diomain.com/api/stats.js" />

Once the script is loaded you can record events like so:

collect('event_name');

// or

window.collectAnalytics('event_name');

Next js

This app is built using Next.js, so take a look at their documentation to better understand how the app is structured.

Run the development server:

npm run dev

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy a Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out Next.js deployment documentation for more details.

About

A self-hosted, real-time analytics collector and dashboard.

https://stats.udara.io

License:MIT License


Languages

Language:TypeScript 71.0%Language:SCSS 19.9%Language:CSS 8.6%Language:JavaScript 0.5%