{"id":26060009,"url":"https://github.com/js00001/hog-lite","last_synced_at":"2025-04-11T07:36:48.662Z","repository":{"id":279662513,"uuid":"937417293","full_name":"JS00001/hog-lite","owner":"JS00001","description":"🦔 PostHog Mobile Client for the Masses!","archived":false,"fork":false,"pushed_at":"2025-03-07T00:00:55.000Z","size":12139,"stargazers_count":19,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-07T00:30:55.898Z","etag":null,"topics":["expo","nativewind","posthog","react-native"],"latest_commit_sha":null,"homepage":"https://apps.apple.com/us/app/hoglite/id6742509573","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JS00001.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-23T01:57:18.000Z","updated_at":"2025-03-07T00:00:58.000Z","dependencies_parsed_at":"2025-02-26T18:49:28.491Z","dependency_job_id":"cc03cdd7-9e5d-4bd5-b22d-ec7be56f5991","html_url":"https://github.com/JS00001/hog-lite","commit_stats":null,"previous_names":["js00001/hog-mobile"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JS00001%2Fhog-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JS00001%2Fhog-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JS00001%2Fhog-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JS00001%2Fhog-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JS00001","download_url":"https://codeload.github.com/JS00001/hog-lite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242559203,"owners_count":20149326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expo","nativewind","posthog","react-native"],"created_at":"2025-03-08T13:49:01.050Z","updated_at":"2025-04-11T07:36:48.649Z","avatar_url":"https://github.com/JS00001.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🦔 HogLite\n\n## The best way to view your PostHog analytics on the go!\n\n![hog mobile demo](assets/demo.png)\n![hog mobile demo dark](assets/demo-dark.png)\n\n## Introduction\n\nHogLite is a free and open-source [PostHog](https://posthog.com) 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](https://posthog.com/) API.\n\n## Documentation Sections\n\n- [🦔 HogLite](#-hoglite)\n  - [The best way to view your PostHog analytics on the go!](#the-best-way-to-view-your-posthog-analytics-on-the-go)\n  - [Introduction](#introduction)\n  - [Documentation Sections](#documentation-sections)\n  - [Setting up the environment](#setting-up-the-environment)\n  - [Running the application](#running-the-application)\n  - [Architecture](#architecture)\n    - [Managing Server State](#managing-server-state)\n    - [Managing Client State](#managing-client-state)\n  - [Debugging](#debugging)\n  - [Creating Builds/Releases](#creating-buildsreleases)\n    - [App Store Update](#app-store-update)\n    - [OTA Update](#ota-update)\n\n## Setting up the environment\n\n1. Install the required packages by running the following command:\n\n```bash\nyarn install\n```\n\n## Running the application\n\nRun the following command to start the application in development mode:\n\n```bash\nyarn dev\n```\n\n## Architecture\n\n| Folder       | Description                                                                                                                    |\n| ------------ | ------------------------------------------------------------------------------------------------------------------------------ |\n| `@types`     | Common data types used across the entire application.                                                                          |\n| `api`        | All methods to call PostHog's backend API exist here.                                                                          |\n| `app`        | Expo router root folder.                                                                                                       |\n| `components` | Larger components made up of smaller components from the `ui` folder, such as Widgets, Bottom Sheets, etc.                     |\n| `constants`  | Constant values used across the entire application.                                                                            |\n| `hooks`      | Common hooks across the application. Includes an `api` folder with hooks for every API query and mutation using Tanstack Query |\n| `lib`        | Utility functions and external library setup.                                                                                  |\n| `providers`  | Context providers for the application.                                                                                         |\n| `store`      | Client-side stores using Zustand. _Preferred over using React Context_                                                         |\n| `ui`         | Small blocks of UI components such as Buttons, Inputs, etc.                                                                    |\n\n### Managing Server State\n\nAll 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.\n\nRelevant optimistic updates or cache updates (when mutating data) should be handled in the hooks.\n\nEvery component using a query should validate `isLoading`, `isError`, and `data` states to handle the UI accordingly.\n\n### Managing Client State\n\nAll 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.\n\nBoth 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:\n\n```tsx\n// DON'T DO THIS\nconst clientStore = useClientStore();\n\nreturn \u003cText\u003eYour theme is: {clientStore.theme}\u003c/Text\u003e;\n```\n\n```tsx\n// INSTEAD, DO THIS\nconst theme = useClientStore((state) =\u003e state.theme);\n\nreturn \u003cText\u003eYour theme is: {theme}\u003c/Text\u003e;\n```\n\n## Debugging\n\nTo help with debugging, we've added debugging tools to the application when running in development mode.\n\n- **Network Requests**: To view network requests, press three fingers on the screen to open the network inspector.\n- **Client Store State**: To view the current state in async storage, press three fingers on the screen, and click 'Client Store'\n\n## Creating Builds/Releases\n\nHogLite 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.\n\n### App Store Update\n\n1. **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`.\n2. **Build the app**: Run the following command to build the app:\n\n```bash\neas build --platform ios --profile production\n```\n\n3. **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:\n\n```bash\neas submit --platform ios\n```\n\n### OTA Update\n\nWhen 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.\n\n1. 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:\n\n```bash\nyarn update:staging\n```\n\n2. Test the update on the staging environment to ensure that it works as expected.\n3. Run the following command to deploy the OTA update to the production environment:\n\n```bash\nyarn update:production\n```\n\n4. Test the update on the production environment to ensure that it works as expected.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs00001%2Fhog-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjs00001%2Fhog-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs00001%2Fhog-lite/lists"}