OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.
update readme
Carl-Gerhard Lindesvärdd57bfa13f328
diff --git a/README.md b/README.mdindex d922995f3..90553bc17 100644--- a/README.md+++ b/README.md@@ -1,173 +1,73 @@-# Openpanel--Openpanel is a simple analytics tool for logging events on web and react-native. My goal is to make a minimal mixpanel copy with the most basic features (for now).--- Easy to use-- Fully responsive UI-- Own your own data-- GDPR friendly--## Whats left?--> Currently storing events on postgres but will probably move it to [clickhouse](https://clickhouse.com/) to speed up queries. Don't have any performance issues yet so will wait and see how well postgres can handle it.--### Speed/Benchmark--As of today (~~2023-12-12~~ 2024-01-16) I have more then ~~1.2~~ 2.8 million events and 20 thousand profiles in postgres and performance is smooth as butter\* 🧈. Only thing that is slow (2s response time) is to get all unique events. Solved now with cache but can probably make better with `indexes` and avoid using `distinct`.--\* Smooth as butter is somewhat exaggerated but I would say it still fast! It takes 1.4 sec to search through all events (3 million) with advanced where clause. I think this performance is absolutly good enough.--### GUI--- [x] Fix design for report editor-- [x] Fix profiles- - [x] Pagination- - [x] Filter by event name-- [x] Fix [profileId]- - [x] Add events- - [x] Improve design for properties and linked profiles-- [x] New design for events-- [ ] Map events to convertions-- [ ] Map ids-- [x] Fix menu links when projectId is undefined-- [x] Fix tables on settings-- [x] Rename event label-- [ ] Common web dashboard- - [x] User histogram (last 30 minutes)- - [ ] Bounce rate- - [ ] Session duration- - [ ] Views per session- - [ ] Unique users- - [ ] Total users- - [ ] Total pageviews- - [ ] Total events-- [x] Save report to a specific dashboard-- [x] View events in a list- - [x] Simple filters-- [x] View profiles in a list-- [x] Invite users-- [ ] Drag n Drop reports on dashboard-- [x] Manage dashboards-- [x] Support more chart types- - [x] Bar- - [x] Histogram- - [x] Pie- - [x] Area- - [x] Metric- - [x] Line-- [ ] Support funnels-- [ ] Support multiple breakdowns-- [x] Aggregations (sum, average...)--### SDK--- [x] Store duration on screen view events (can be done in backend as well)-- [x] Create native sdk- - [x] Handle sessions-- [x] Create web sdk- - [x] Screen view function should take in title, path and parse query string (especially utm tags)--## @openpanel/sdk--For pushing events--### Install--- npm: `npm install @openpanel/sdk`-- pnpm: `pnpm add @openpanel/sdk`-- yarn: `yarn add @openpanel/sdk`--### Usage--```ts-import { OpenpanelWeb } from '@openpanel/web';--// import { OpenpanelNative } from '@openpanel/sdk-native';--const openpanel = new OpenpanelWeb({- clientId: 'uuid',- url: 'http://localhost:8080/api/sdk',- batchInterval: 10000,- verbose: false,- trackIp: true,-});--// const openpanel = new OpenpanelNative({-// clientId: 'uuid',-// clientSecret: 'uuid',-// url: 'http://localhost:8080/api/sdk',-// batchInterval: 10000,-// verbose: false,-// trackIp: true,-// });--// Call this before you send any events-// It will create a anonymous profile-// This profile will be merged if you call `setUser` in a later stage-openpanel.init();--// tracks all outgoing links as a `link_out` event-openpanel.trackOutgoingLinks();--openpanel.setUser({- id: 'id',- first_name: 'John',- last_name: 'Doe',- email: '[email protected]',- properties: {}, // any properties-});--// will upsert 'app_open' on user property and increment it-openpanel.increment('app_open');-// will upsert 'app_open' on user property and increment it by 10-openpanel.increment('app_open', 10);-// will upsert 'app_open' on user property and decrement it by 2-openpanel.decrement('app_open', 2);--// send a sign_in event-openpanel.event('sign_in');--// send a sign_in event with properties-openpanel.event('sign_in', {- provider: 'gmail',-});--// Screen view for web-openpanel.screenView();--// Screen view for native-openpanel.screenView('Article', {- id: '3',- title: 'Nice article here',-});--// Call this when a user is logged out.-// This will just make sure you do not send-// the associated profile id for the next events-openpanel.clear();-```--## @openpanel/dashboard--A nextjs web app. Collects all events and your gui to analyze your data.--### Setup cronjobs (optional)--Use of cronjobs is optional. Everything will work without them but they will enhance the events with more data. We also use cronjobs to warm up the cache to make the user experiance a bit better.--We use https://cron-job.org (free) to handle our cronjobs, you can use any provider you want.--- **https://domain.com/api/cron/cache/update** Will update the memory cache-- **https://domain.com/api/cron/events/enrich** Enrich events (adds duration etc)--## Development--1. Run `docker-compose up -d` to get redis and postgres running-2. Then `pnpm dev` to boot the web and worker (queue)--## Screenshots-----+++<p align="center">+ <h1 align="center"><b>Openpanel</b></h1>+<p align="center">+ An open-source alternative to Mixpanel+ <br />+ <br />+ <a href="https://openpanel.dev">Website</a>+ ·+ <a href="https://docs.openpanel.dev">Docs</a>+ ·+ <a href="https://dashboard.openpanel.dev">Sign in</a>+ ·+ <a href="https://discord.gg/X9NX3RB42m">Discord</a>+ ·+ <a href="https://twitter.com/CarlLindesvard">X/Twitter</a>+ ·+ </p>+ <br />+ <br />+</p>++Openpanel is a simple analytics tool for logging events on web, apps and backend. We have tried to combine Mixpanel and Plausible in the same product.++- Visualize your data+ - **Charts**+ - Funnels+ - Line+ - Bar+ - Pie+ - Histogram+ - Maps+ - **Breakdown** on all properties+ - **Advanced filters** on all properties+ - Create **beautiful dashboards** with your charts+ - **Access all your events**+ - Access all your visitors and there history+- Own Your Own Data+- GDPR Compliant+- Cloud or Self-Hosting+- Real-Time Events+- No cookies!+- Privacy friendly+- Cost-Effective+- Predictable pricing+- First Class React Native Support+- Powerful Export API++## Disclaimer++> Hey folks 👋🏻 Just a friendly heads-up: we're still in the early stages of this project. We have migrated from pages to app dir and made some major changes during the development of Openpanel, so everything is not perfect.++## Stack++- **Nextjs** - the dashboard+- **Fastify** - event api+- **Postgres** - storing basic information+- **Clickhouse** - storing events+- **Redis** - cache layer, pub/sub and queue++### More++- Tailwind+- Shadcn+- tRPC - will probably migrate this to server actions+- Clerk - for authentication++## Self hosting++I'll fill out this section when we're out of beta (might be sooner than that).++But it will probably be a CapRover recipe and Docker Compose scheme.diff --git a/github.png b/github.pngnew file mode 100644index 000000000..ad0225dcfBinary files /dev/null and b/github.png differ