# Workspace ## Overview pnpm workspace monorepo using TypeScript. Each package manages its own dependencies. ## Stack - **Monorepo tool**: pnpm workspaces - **Node.js version**: 24 - **Package manager**: pnpm - **TypeScript version**: 5.9 - **API framework**: Express 5 - **Database**: PostgreSQL + Drizzle ORM - **Validation**: Zod (`zod/v4`), `drizzle-zod` - **API codegen**: Orval (from OpenAPI spec) - **Build**: esbuild (CJS bundle) ## Artifacts ### PostizMobile (`artifacts/postiz-mobile`) Expo (React Native) mobile client for a self-hosted Postiz instance. - **Preview path**: `/` - **Theme**: Dark-only (`userInterfaceStyle: dark`) - **Auth**: API key stored in `expo-secure-store`, passed as `Authorization` header #### Screens / Tabs 1. **Calendar** (`app/(tabs)/index.tsx`) — Monthly calendar with post dots, tap day to see posts 2. **Posts** (`app/(tabs)/posts.tsx`) — Filterable list of posts with status badges, swipe to delete 3. **Compose** (`app/(tabs)/compose.tsx`) — Text editor, channel picker, date/time picker, image upload 4. **Settings** (`app/(tabs)/settings.tsx`) — API key + base URL, validation, SecureStore persistence #### Key Files - `context/PostizContext.tsx` — Axios client wired with API key/base URL; loaded from SecureStore on boot - `components/PostCard.tsx` — Swipeable post card with delete action - `components/StatusBadge.tsx` — QUEUE / PUBLISHED / ERROR / DRAFT badges - `components/ChannelChip.tsx` — Integration channel selector chip #### External API - Base URL: `https://postiz.gyozamancave.fr/public/v1` (configurable) - `GET /integrations` — List channels - `GET /posts?startDate&endDate` — List posts - `POST /posts` — Create/schedule post - `DELETE /posts/:id` — Delete post - `POST /upload` — Upload media #### Packages Added - `axios` — HTTP client - `expo-secure-store` — Secure API key storage - `react-native-calendars` — Calendar UI - `@react-native-community/datetimepicker` — Date/time picker for compose ### API Server (`artifacts/api-server`) Express 5 backend. Currently serves `/api/healthz`. Extend for server-side features. ## Key Commands - `pnpm run typecheck` — full typecheck across all packages - `pnpm run build` — typecheck + build all packages - `pnpm --filter @workspace/api-spec run codegen` — regenerate API hooks and Zod schemas from OpenAPI spec - `pnpm --filter @workspace/db run push` — push DB schema changes (dev only) See the `pnpm-workspace` skill for workspace structure, TypeScript setup, and package details.