Show HN:Minimalytics——一个基于SQLite的独立极简分析应用程序
Show HN: Minimalytics – a standalone minimal analytics app built on SQLite

原始链接: https://github.com/nafey/minimalytics

Minimalytics是一款极简的、独立的分析工具,基于SQLite数据库,适用于资源受限的环境。它追踪事件,提供Web UI用于可视化,并且具有可扩展性,每月可支持超过十亿个事件,同时存储空间极小(约20MB)。 安装非常简单:克隆仓库,构建,然后安装二进制文件。启动服务器并发送POST请求来记录事件。访问Web控制面板来创建和查看交互式图表。 Minimalytics通过聚合事件来节省空间,只存储汇总数据。它使用SQLite进行存储,在第一次运行时初始化。服务器承载事件API和Web UI,后者使用minimui构建。 未来的增强功能包括:支持更多聚合函数、改进UI/UX、增加可视化图表、基于用户ID的分析以及更高的时序分辨率。欢迎贡献代码。采用MIT许可证。

Nafey分享了“Minimalytics”,这是一个基于SQLite的轻量级分析应用,其诞生源于无需为传统分析平台的高昂成本而频繁追踪事件的需求。Minimalytics优先考虑资源效率,大约使用20MB的存储和内存。它提供了一个CLI用于管理,一个内置的Web UI和服务器,并且由于事件聚合,拥有极低的存储需求。它旨在用于内部事件追踪,开销极低且无外部依赖。Nafey强调了使用Golang进行开发的积极体验。一位评论者建议为应用程序内的屏幕截图使用更具描述性的名称。

原文

License

Minimalytics is a standalone minimalist analytics tool built on SQLite. Designed for resource-constrained environments, it provides a lightweight solution for tracking and visualizing event data with a minimal footprint. Whether you're tracking internal services or need a simple analytics tool, Minimalytics delivers performance without the bloat.


  • Track Events: Record and monitor analytics for various events.
  • Web UI: Manage dashboards and visualize event data with interactive graphs.
  • Scalable: Supports over a billion events per month with a minimal storage footprint (~20 MB).
  • Lightweight: Built with efficiency in mind, ensuring low memory and storage usage.
  1. Clone the repository:

    git clone https://github.com/nafey/minimalytics.git
    cd minimalytics
  2. Build the project:

    go build -o build/minim .
  3. Install the binary system-wide:

    sudo mv build/minim /usr/local/bin/

  1. Check if the server is running:

  2. Start the server:

To record an event, send a POST request to the event API:

curl -X POST http://localhost:3333/api/event/ -H "Content-Type: application/json" -d '{"event": "<EVENT_NAME>"}'

Replace <EVENT_NAME> with the name of the event you want to track.

Accessing the Web Dashboard

  1. Open your browser and navigate to:

  2. Go to "First Dashboard" and click "Add Graph".

  3. Select the appropriate properties and click "Done".

  4. Your dashboard is now ready to display event data.

To disable access to the web dashboard, run:


This project was born out of the need for a lightweight analytics tool to track internal services on a resource-constrained VPS. Most SaaS analytics products either lack the scalability or exceed their free tier limits when tracking millions of events per month. Minimalytics addresses this gap by offering a minimalist, high-performance solution for resource-constrained environments.


  • Event Aggregation: Minimalytics saves space by aggregating events, storing only aggregate features (e.g., total invocations per day) instead of individual events.
  • SQLite Storage: Event data is stored in an SQLite file, initialized during the first run of minim.
  • Server Hosting: The minim CLI starts a server that:
    • Hosts the API endpoint for event submission.
    • Serves the web UI (built using minimui and placed in the static folder).
  • Web UI: Source for the Web UI is available at minimui.

  • Support for sum, avg, min, and max on event values.
  • Improved UI/UX.
  • Multiple metrics in the same graph.
  • Additional visualizations: Bar Chart, Pie Chart, etc.
  • User ID-based analytics: Funnels, cohorts, and more.

  • Details on individual events.
  • Hourly event resolution beyond 48 hours.
  • Minute resolution beyond 60 minutes.

Contributions are welcome! If you'd like to contribute, please:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Submit a pull request.

Minimalytics is licensed under the MIT License.

Enjoy using Minimalytics! For questions or feedback, feel free to open an issue on GitHub.

联系我们 contact @ memedata.com