How alghamdima/aaaasd works
1. Repository shape
This is a Turborepo monorepo with three customer-facing apps under apps/ and a large set of reusable packages under packages/. The top-level goal is “ship everywhere”: web, mobile, and browser extension share the same product domain, auth, billing, UI, and content systems.
2. Client surfaces
- apps/web: Next.js App Router app for marketing, auth, dashboard, and admin.
- apps/mobile: Expo Router app for onboarding, auth, user/organization dashboards, billing, and settings.
- apps/extension: WXT-based browser extension with background, content script, popup, side panel, new tab, options, tabs, and devtools pages.
Each app has its own route tree and app shell, but the domain modules are structured similarly across platforms.
3. Central API layer
packages/api is the main backend service layer. It is organized by domain modules (auth, billing, organization, storage, admin, ai) with router, query, and mutation files. The web app exposes a catch-all /api/[...route] handler that proxies into this API layer, while mobile and extension use app-local API clients to talk to the same backend contract.
4. Authentication boundary
packages/auth is the shared auth core, with separate client entry points for web and mobile plus server utilities. App code in apps/web and apps/mobile wraps it with platform-specific auth screens, forms, and layouts. Auth-related flows include login, registration, password reset, email verification, two-factor auth, passkeys on web, and invitation flows tied to organizations.
5. Billing boundary
Billing is split into shared business logic and provider adapters:
- packages/billing/shared holds plans, features, prices, subscriptions, and status mapping.
- packages/billing/web supports web commerce providers such as Stripe, Lemon Squeezy, and Polar.
- packages/billing/mobile supports mobile subscription providers such as RevenueCat and Superwall.
The apps consume this through their billing modules and settings pages, while provider-specific webhook handling lives in the billing packages.
6. Domain modules in the apps
The app code is organized by business domain rather than by technical layer:
- auth, billing, organization, user, admin, marketing, common
- mobile adds setup/onboarding and native-specific helpers
- web adds richer admin dashboards and marketing pages
These modules own screen composition, forms, tables, navigation, and page-level state.
7. Content and marketing
packages/cms holds localized MDX content for blog and legal pages. The web app’s marketing routes render this content into blog listings, blog detail pages, and legal pages. This is a clear boundary: editorial content is separated from product data and lives in a dedicated content package.
8. Shared UI and design system
packages/ui is split by platform:
- packages/ui/web contains the web component library, including data-table primitives, dialogs, sidebar, sheet, charts, etc.
- packages/ui/mobile contains native components such as sheets, dropdowns, inputs, tabs, and themed controls.
- packages/ui/shared contains shared assets, SVGs, theme tokens, and global styles.
App modules build screens from these primitives rather than duplicating component logic.
9. Cross-cutting infrastructure packages
Several packages provide app-wide concerns:
- packages/i18n for translations and locale helpers, used by both web and mobile.
- packages/analytics for provider-agnostic tracking across web, mobile, and extension.
- packages/monitoring for error/performance reporting.
- packages/email for transactional templates and provider adapters.
- packages/storage for object storage abstraction.
- packages/shared for common types, logging, schemas, IDs, pagination, and utility helpers.
These packages sit below the app/domain layer and are intended to be reused across all surfaces.
10. Data and persistence
packages/db contains the database schema, migrations, seed/reset scripts, and server helpers. It is the persistence boundary for auth and billing data, and likely backs the API layer’s query/mutation modules. Drizzle migrations indicate schema-first relational persistence rather than a document store.
11. Platform-specific runtime behavior
The three apps differ meaningfully at the runtime boundary:
- Web is server/client hybrid with locale-aware routes, admin views, and proxy/API routing.
- Mobile is native-first, with Expo-specific providers, focus/refetch hooks, theme handling, and native billing integrations.
- Extension has browser-context splits: background script, content script, and UI entrypoints.
Shared business logic is intentionally kept outside these runtimes so it can be reused without leaking platform assumptions.
12. Operational/tooling layer
The repo is built and governed with Turborepo, pnpm workspaces, TypeScript, Vitest, Oxlint/Oxfmt, and GitHub Actions. There are dedicated workflows for testing and publishing web/mobile/extension artifacts, plus scripts for migrations, versioning, and development setup. This makes the monorepo a coordinated multi-target product system rather than a collection of unrelated apps.
Main entry points: web Web · mobile Mobile · api API · extension Extension
Components 20
Apps
Customer-facing runtime surfaces
Packages
Shared domain, platform, and infrastructure libraries
- API · Shared router/query/mutation service layer
packages/api - Auth · Shared authentication client and server utilities
packages/auth - Billing Core · Plans, prices, subscriptions, and status mapping
packages/billing/shared - Billing Web · Stripe, Lemon Squeezy, and Polar integrations
packages/billing/web - Billing Mobile · RevenueCat and Superwall integrations
packages/billing/mobile - CMS · Localized blog and legal content
packages/cms - UI Web · Web components, tables, dialogs, sidebar, charts
packages/ui/web - UI Mobile · Mobile components and themed controls
packages/ui/mobile - UI Shared · Shared assets, SVGs, themes, and styles
packages/ui/shared - i18n · Shared locale helpers and language bundles
packages/i18n - Analytics · Provider-agnostic analytics for all surfaces
packages/analytics - Monitoring · Shared Sentry/PostHog-style observability adapters
packages/monitoring - Email · Transactional email templates and providers
packages/email - Storage · S3-style storage abstraction and server helpers
packages/storage - Database · Relational persistence, migrations, and seed scripts
packages/db - Shared · Types, logging, schemas, IDs, and helpers
packages/shared
Tooling
Repo-wide build, lint, and automation
- Tooling · Turborepo, TypeScript, linting, testing, and scripts
tooling
Connections 35
- Web → API: routes through · Web API handler proxies into shared backend contract
- Mobile → API: calls · Native app uses local API client against shared contract
- Extension → API: calls · Extension uses local API client against shared contract
- Web → Auth: uses · Web auth screens and server/client wrappers
- Mobile → Auth: uses · Mobile auth flows and platform wrappers
- Web → Billing Web: uses · Web commerce and billing portal integrations
- Mobile → Billing Mobile: uses · Native billing and subscription integrations
- Web → CMS: renders · Marketing pages and legal/blog routes consume MDX content
- Web → UI Web: builds with · Web screens use the web component library
- Mobile → UI Mobile: builds with · Native screens use the mobile component library
- Web → UI Shared: shares · Web uses shared tokens, icons, and styles
- Mobile → UI Shared: shares · Mobile uses shared tokens, icons, and styles
- Extension → UI Shared: shares · Extension uses shared tokens, icons, and styles
- Web → i18n: uses · Locale-aware web routes and text
- Mobile → i18n: uses · Mobile localization and language helpers
- Extension → Analytics: reports · Extension tracking and provider wiring
- Web → Analytics: reports · Web analytics providers and page views
- Mobile → Analytics: reports · Mobile analytics providers and permissions
- Web → Monitoring: reports · Web error/performance instrumentation
- Mobile → Monitoring: reports · Mobile error/performance instrumentation
- Extension → Monitoring: reports · Extension error/performance instrumentation
- Web → Email: sends · Auth and contact email flows
- Web → Storage: uses · Web-facing storage boundary for app features
- Mobile → Storage: uses · Native storage boundary for app features
- API → Database: persists to · API queries and mutations sit over relational persistence
- API → Auth: depends on · Auth domain feeds shared backend contract
- API → Billing Core: depends on · Billing routes use shared billing rules
- API → Storage: depends on · Storage router wraps shared storage package
- Web → Shared: uses · Common types, logging, schemas, and utilities
- Mobile → Shared: uses · Common types, logging, schemas, and utilities
- Extension → Shared: uses · Common types, logging, schemas, and utilities
- Tooling → Web: governs · Build, lint, and test setup for web app
- Tooling → Mobile: governs · Build, lint, and test setup for mobile app
- Tooling → Extension: governs · Build, lint, and test setup for extension
- Tooling → API: governs · Build, lint, and test setup for API package