Skip to content

Latest commit

 

History

History
53 lines (31 loc) · 2.07 KB

README.md

File metadata and controls

53 lines (31 loc) · 2.07 KB

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