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.
- Update the config at ./src/config
- 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
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');
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:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
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.