百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
H

hog-lite

> 前端框架
开源

PostHog 移动客户端为大众提供服务!

99 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

PostHog 移动客户端为大众提供服务!

HogLite

The best way to view your PostHog analytics on the go!

Introduction

HogLite is an open-source PostHog client for mobile devices. The app allows users to view their PostHog dashboards, events, and more. This repository contains the code for the HogLite app. The app does not have a custom backend, but rather, directly communicates with PostHog's API.

Documentation Sections

  • HogLite
    • The best way to view your PostHog analytics on the go!
    • Introduction
    • Documentation Sections
    • Setting up the environment
    • Running the application
    • Architecture
      • Managing Server State
      • Managing Client State
    • Debugging
    • Creating Builds/Releases
      • App Store Update
      • OTA Update

Setting up the environment

  1. Install the required packages by running the following command:
bash
yarn install

Running the application

Run the following command to start the application in development mode:

bash
yarn dev

Architecture

Folder Description
@types Common data types used across the entire application.
api All methods to call PostHog's backend API exist here.
app Expo router root folder.
components Larger components made up of smaller components from the ui folder, such as Widgets, Bottom Sheets, etc.
constants Constant values used across the entire application.
hooks Common hooks across the application. Includes an api folder with hooks for every API query and mutation using Tanstack Query
lib Utility functions and external library setup.
providers Context providers for the application.
store Client-side stores using Zustand. Preferred over using React Context
ui Small blocks of UI components such as Buttons, Inputs, etc.

Managing Server State

All async state should be handled via Tanstack Query. Every API query and mutation has an associated hook in the hooks/api folder. The hooks should be used in the components to fetch and mutate data. The hooks are responsible for managing the state and fetching the data from PostHog's backend.

Relevant optimistic updates or cache updates (when mutating data) should be handled in the hooks.

Every component using a query should validate isLoading, isError, and data states to handle the UI accordingly.

Managing Client State

All client state is stored in two unique Zustand stores: auth-store (useAuthStore) and client-store (useClientStore). The auth-store is responsible for managing the user's authentication state, while the client-store is responsible for managing the client's preferences, settings, and state.

Both stores persist their data and rehydrate it on app startup. All persisted client state should be stored in one of these stores. Do NOT directly access a store's state in a component. Instead, set up a selector to prevent inefficient re-renders. See example below:

typescript
// DON'T DO THIS
const clientStore = useClientStore();

return Your theme is: {clientStore.theme};
typescript
// INSTEAD, DO THIS
const theme = useClientStore((state) => state.theme);

return Your theme is: {theme};

Debugging

To help with debugging, we've added debugging tools to the application when running in development mode.

  • Network Requests: To view network requests, press three fingers on the screen to open the network inspector.
  • Client Store State: To view the current state in async storage, press three fingers on the screen, and click 'Client Store'

Creating Builds/Releases

HogLite has two different update methods. The first is a traditional app store update, and the second is an OTA update. The app store update is used for major updates (typically with new native code), while the OTA update is used for minor updates (with only JavaScript changes). See below for instructions on how to create each type of update.

App Store Update

  1. Update the app version: Update the app version in the app.json file. Increment the version field by one. For example, if the current version is 1.0.0, the new version should be 1.0.1.
  2. Build the app: Run the following command to build the app:
bash
eas build --platform ios --profile production
  1. Submit the app: Submit the app to the app store using the eas submit command. For example, to submit the iOS app, run the following command:
bash
eas submit --platform ios

OTA Update

When running OTA updates, staging/preview updates MUST be ran before production updates. This is to ensure that the update is working as expected before being released to all users. This will also automatically update the 'update version' for the build. The production script will NOT update the 'update version' for the build.

  1. Run the following command to deploy the OTA update to the staging environment. This will automatically increment the 'update version' for the build and set the build date to the current date:
bash
yarn update:staging
  1. Test the update on the staging environment to ensure that it works as expected.
  2. Run the following command to deploy the OTA update to the production environment:
bash
yarn update:production
  1. Test the update on the production environment to ensure that it works as expected.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptexponativewindposthogreact-native

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架