Skip to main content

Modules Overview

54VIE Super App is divided into multiple packages, each with a clear responsibility.

Package Map

                    ┌─────────────────┐
│ app-host │
│ (Host App) │
└────────┬────────┘

┌─────────────────┼─────────────────┐
│ │ │
┌──────▼──────┐ ┌───────▼───────┐ ┌─────▼─────┐
│miniapp-sdk │ │miniapp-runtime│ │ core │
│ (SDK) │ │ (Runtime) │ │ (Shared) │
└──────┬──────┘ └───────────────┘ └─────┬─────┘
│ │
└───────────────┬───────────────────┘

┌──────────────────────┼──────────────────────┐
│ │ │ │ │
┌───▼───┐ ┌───▼───┐ ┌─────▼─────┐ ┌───▼───┐ ┌───▼───┐
│ kit │ │ api │ │ analytics │ │storage│ │device │
└───────┘ └───────┘ └───────────┘ └───────┘ └───────┘

┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐
│ location │ │ media │ │ push-notification │
└─────────────┘ └─────────────┘ └─────────────────────┘

Package List

Core Packages

PackageDescriptionLink
@54vie/coreShared dependencies & presetsView details
@54vie/kitUI Component LibraryView details
@54vie/storagePersistent storage (MMKV)View details

Mini-App System

PackageDescriptionLink
app-hostHost applicationView details
miniapp-sdkSDK for mini-appsView details
miniapp-runtimeMini-app runtimeView details

Services

PackageDescriptionLink
@54vie/apiAPI client, caching, WebSocketView details
@54vie/analyticsAnalytics & trackingView details
@54vie/pushPush notificationsView details

Device & Platform

PackageDescriptionLink
@54vie/deviceDevice info, network, hapticsView details
@54vie/locationLocation & geocodingView details
@54vie/mediaCamera, gallery, processingView details

Dependency Graph

@54vie/kit ─────────────▶ @54vie/core
@54vie/api ─────────────▶ @54vie/core, @54vie/storage
@54vie/analytics ───────▶ @54vie/core, @54vie/device, @54vie/storage
@54vie/storage ─────────▶ @54vie/core
@54vie/device ──────────▶ @54vie/core
@54vie/location ────────▶ @54vie/core
@54vie/media ───────────▶ @54vie/core
@54vie/push ────────────▶ @54vie/core

miniapp-sdk ────────────▶ (bridge to host services)
miniapp-runtime ────────▶ @54vie/core

app-host ───────────────▶ ALL packages

Versioning Strategy

All packages follow semantic versioning (semver):

  • Major (x.0.0): Breaking changes
  • Minor (0.x.0): New features, backward compatible
  • Patch (0.0.x): Bug fixes
# Check versions
pnpm -r exec -- cat package.json | grep '"version"'

How to Use

In Host App

// Import directly
import { Button, Toast } from '@54vie/kit';
import { apiClient, useQuery } from '@54vie/api';
import { useAnalytics } from '@54vie/analytics';
import { StorageManager } from '@54vie/storage';
import { DeviceInfo, useNetwork } from '@54vie/device';
import { useLocation } from '@54vie/location';
import { useCamera } from '@54vie/media';
import { usePush } from '@54vie/push';

In Mini-Apps

// Use through SDK
import {
useHostAuth,
useHostDevice,
storage,
analytics,
location,
media,
} from '@54vie/miniapp-sdk';

// UI components can be imported directly
import { Button, Input, Card } from '@54vie/kit';

Creating a New Package

# 1. Create new folder
mkdir packages/my-package
cd packages/my-package

# 2. Initialize package.json
pnpm init

# 3. Configure package.json
{
"name": "@54vie/my-package",
"version": "0.1.0",
"main": "src/index.ts",
"types": "src/index.ts",
"dependencies": {
"@54vie/core": "workspace:*"
}
}

# 4. Add to pnpm-workspace.yaml if needed

Best Practices

1. Single Responsibility

Each package should do one thing and do it well.

2. Minimal Dependencies

Only depend on what is actually needed.

3. Clear Public API

Export clearly through index.ts:

// src/index.ts
export { Button } from './components/Button';
export { useTheme } from './hooks/useTheme';
export type { ButtonProps } from './types';

4. Documentation

Each package should have a README.md with:

  • Description
  • Installation
  • Usage examples
  • API reference