Skip to content

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

License

Notifications You must be signed in to change notification settings

UdaraJay/_stats

Repository files navigation

_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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published