Onboarding Guide: treetracker-wallet-app

Generated from the Understand-Anything knowledge graph. Source commit 3c14113.

The web app is the live client. The native app is mostly a mock. It imports nothing from the wallet package. Its sign-in screen calls no API. Its search, wallets, and notifications use hard-coded data. Read the "Note" fields before you change a screen.

Project Overview

The Treetracker Wallet App is a Greenstand wallet for tokens that stand for verified tree planting (README.md). A user holds wallets. The user sends tokens to other wallets. The user can also give tokens through share links.

How the parts fit:

Architecture Layers

The counts are file-level graph nodes. The count of Deployment and CI/CD includes the three Dockerfile nodes. The bold names are the layer labels in the graph.

Key Concepts

Guided Tour

The tour has 15 steps. The bold names are the tour titles in the graph.

  1. Project Overview
    Files: README.md, package.json, CONTRIBUTING.md
    What to see: the root scripts delegate to the workspaces. Examples are web:dev, user:dev, and bdd:e2e.
  2. Shared Auth State
    Files: packages/core/src/index.ts, packages/core/src/atoms/auth/index.ts, packages/core/src/atoms/auth/tokenAtom.ts, packages/core/src/utils/storage.ts, packages/core/src/atoms/auth/loginAtom.ts
    What to see: look at tokenAtom and its storage choice.
    Note: no app imports loginAtom or registerAtom. So their calls to the user API never run.
  3. Wallet Client Foundations
    Files: packages/wallet/src/index.ts, packages/wallet/src/types/wallet.ts, packages/wallet/src/utils/config.ts, packages/wallet/src/api/errors.ts
    What to see: look at the barrel export, the shared types, the base URL rule, and the typed error.
  4. Wallet API Clients and Hooks
    Files: packages/wallet/src/api/createWallet.ts, packages/wallet/src/hooks/useCreateWallet.ts, packages/wallet/src/api/sendTransfer.ts, packages/wallet/src/hooks/usePendingTransfers.ts, packages/wallet/src/api/redeemActionToken.ts
    What to see: usePendingTransfers fetches the requested and pending states and merges them (line 27).
  5. Web App Root and Keycloak
    Files: apps/web/src/app/layout.tsx, apps/web/src/components/KeycloakProvider.tsx, apps/web/src/auth/keycloak.ts, apps/web/src/app/page.tsx, apps/web/src/app/auth/callback/page.tsx
    What to see: the callback page reads the authenticated flag and goes to /home or /login (apps/web/src/app/auth/callback/page.tsx:16).
  6. Protected Routes and Navigation
    Files: apps/web/src/app/(protected)/layout.tsx, apps/web/src/auth/sessionChannel.ts, apps/web/src/components/header/Header.tsx, apps/web/src/context/HeaderContext.tsx, apps/web/src/components/navigation/BottomNavigatorBar.tsx
    What to see: the layout redirects to /login when tokenAtom is empty (line 42). The bottom bar badges Notifications with the incoming transfer count (line 100).
    Note: the default header shows only the logo and the title. It has no search button.
  7. Web Wallet Features
    Files: apps/web/src/app/(protected)/home/page.tsx, apps/web/src/app/(protected)/wallet/page.tsx, apps/web/src/app/(protected)/send/page.tsx, apps/web/src/app/(protected)/transfers/page.tsx, apps/web/src/app/claim/page.tsx
    What to see: the home page loads the 5 latest transfers (line 57). The transfers page loads the 20 latest (line 218).
  8. Native App Shell
    Files: apps/native/app/_layout.tsx, apps/native/app/index.tsx, apps/native/context/ModalContext.tsx, apps/native/components/ActionSelectionModal.tsx, apps/native/app/(tabs)/_layout.tsx
    What to see: apps/native/app/index.tsx:11 reads the AsyncStorage flags hasLaunched and isAuth. The flags pick onboarding, the home tab, or the sign-in screen.
  9. Native Screens and Design Tokens
    Files: apps/native/app/(tabs)/home/index.tsx, packages/core/src/atoms/search/index.ts, apps/native/components/HeaderSearch.tsx, apps/native/theme/index.ts, apps/native/constants/Colors.ts
    What to see: look at the design tokens and the search atoms.
    Note: the home tab shows a fixed 1000 tokens and 2 wallets (apps/native/app/(tabs)/home/index.tsx:33). The search atoms filter the hard-coded mockData (packages/core/src/atoms/search/index.ts:62).
  10. User API Bootstrap
    Files: apps/user/src/main.ts, apps/user/src/app.module.ts, apps/user/src/user/user.controller.ts, apps/user/libs/validation/dtos/register-user.dto.ts, apps/user/docs/api/spec/user-api.yaml
    What to see: Swagger runs outside production (apps/user/src/main.ts:11). The controller has POST /login, POST /register, GET /healthz, and GET /me.
    Note: the OpenAPI spec also lists /gift-token. The controller has no such route.
  11. Keycloak Identity Integration
    Files: apps/user/src/user/user.service.ts, apps/user/src/auth/auth.service.ts, packages/keycloak/src/index.ts, packages/keycloak/src/api/createAccountFromKeycloak.ts, packages/keycloak/src/api/fetchTokenFromKeycloak.ts
    What to see: AuthService caches its client_credentials token until expires_in elapses (apps/user/src/auth/auth.service.ts:44).
    Note: only the BDD seed and the package tests import the Keycloak package. The apps do not import it.
  12. Wallet Creation Queue
    Files: apps/user/src/queue-listener/queue-listener.service.ts, apps/user/src/queue-listener/helpers/onQueueNotification.ts, packages/queue/index.js, packages/queue/subscribe.js, packages/queue/publish.js
    What to see: the listener subscribes to the wallets/creation channel. For each event, it sends a reward bundle.
    Note: no code outside the queue tests publishes to that channel. The listener also has defects (see Complexity Hotspots).
  13. BDD and Component Testing
    Files: apps/bdd/features/send-token.feature, apps/bdd/features/step-definitions/steps.ts, apps/bdd/utils/seed.ts, apps/bdd/wdio.base.conf.ts, apps/web/cypress.config.ts
    What to see: the web run takes the @web and not @skip scenarios (apps/bdd/wdio.web.conf.ts:18).
  14. Containers and Kubernetes
    Files: apps/user/Dockerfile, apps/user/deployment/base/kustomization.yaml, apps/user/deployment/base/deployment.yaml, apps/user/deployment/base/mapping.yaml, apps/user/deployment/overlays/development/kustomization.yaml
    What to see: the image runs dist/src/main.js on port 8080. The Mapping routes /user-api/ to the Service.
    Note: no workflow in this repo builds the image or applies the manifests.
  15. CI/CD and Releases
    Files: .github/workflows/pr-ci-cd-all.yml, .github/workflows/ci-cd-pr-bdd-wallet.yml, .github/workflows/static-website-deploy-dev.yml, .github/workflows/build-dev-docker-img-and-relase.yml, .releaserc.js
    What to see: the BDD workflow builds the export, starts the user API, and serves apps/web/out on port 3000 (lines 95 to 100).
    Note: the release workflow runs only semantic-release on main. Its file name says "docker img", but it builds no image.

File Map (by layer)

Web Wallet App

Native Mobile App

User API Service

Shared Client Packages

Identity and Messaging Packages

Testing and QA

Deployment and CI/CD

Workspace and Tooling Configuration

Documentation

Complexity Hotspots

The graph rates 22 file-level nodes as complex. The line counts come from the files.

Business Domains

domain-graph.json has 5 domains, 20 flows, and 126 steps. The bold names are the flow labels in the graph. The domain view of the viewer shows each step.

Authentication and Identity: this domain covers sign-in, registration, the session, and the profile.

Wallet Management: this domain covers the dashboard, the wallets, the profiles, and the token provenance.

Token Transfer: this domain covers bundles between wallets.

Share Links and Claims: this domain covers tokens for a person without a known wallet.

Search and Discovery: this domain covers the recipients of the native send and request flow.