graph TD
A[Monorepo Root] --> B[packages/mobile]
A --> C[packages/server]
A --> D[turbo.json]
A --> E[pnpm-workspace.yaml]
A --> F[.gitignore]
B --> G[Expo SDK 51]
B --> H[React Native 0.74]
B --> I[TypeScript Strict]
C --> J[Node.js 20]
C --> K[Express]
C --> L[Transformers.js]
C --> M[TypeScript Strict]
style A fill:#2ecc71,stroke:#27ae60
style B fill:#3498db,stroke:#2980b9
style C fill:#9b59b6,stroke:#8e44ad
mbcc/
├── packages/
│ ├── mobile/
│ │ ├── src/
│ │ ├── __tests__/
│ │ ├── package.json
│ │ ├── tsconfig.json
│ │ ├── .eslintrc.js
│ │ └── jest.config.js
│ └── server/
│ ├── src/
│ ├── __tests__/
│ ├── package.json
│ ├── tsconfig.json
│ ├── .eslintrc.js
│ └── jest.config.js
├── turbo.json
├── pnpm-workspace.yaml
├── .gitignore
└── ARCHITECTURE.md
turbo.json:
{
"$schema": "https://turborepo.org/schema.json",
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
},
"test": {
"dependsOn": ["build"],
"outputs": []
},
"lint": {
"outputs": []
},
"dev": {
"cache": false
}
}
}pnpm-workspace.yaml:
packages:
- "packages/*".gitignore:
node_modules/
dist/
.expo/
.env
*.log
package.json:
{
"name": "mobile",
"version": "1.0.0",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"test": "jest",
"lint": "eslint . --max-warnings=0"
},
"dependencies": {
"expo": "~51.0.0",
"expo-status-bar": "~1.10.0",
"react": "18.2.0",
"react-native": "0.74.1"
},
"devDependencies": {
"@types/react": "~18.2.45",
"@types/react-native": "~0.74.1",
"@typescript-eslint/eslint-plugin": "^7.3.0",
"@typescript-eslint/parser": "^7.3.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.7.0",
"typescript": "5.4.2"
}
}tsconfig.json (strict mode):
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "react-native",
"lib": ["esnext"],
"moduleResolution": "node",
"noEmit": true,
"strict": true,
"target": "esnext"
}
}package.json:
{
"name": "server",
"version": "1.0.0",
"scripts": {
"build": "tsc",
"start": "node dist/index.js",
"dev": "ts-node-dev src/index.ts",
"test": "jest",
"lint": "eslint . --max-warnings=0"
},
"dependencies": {
"express": "4.19.2",
"@xenova/transformers": "^2.17.0"
},
"devDependencies": {
"@types/express": "4.17.21",
"@types/jest": "^29.5.12",
"@types/node": "20.14.0",
"@typescript-eslint/eslint-plugin": "^7.3.0",
"@typescript-eslint/parser": "^7.3.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"jest": "^29.7.0",
"ts-jest": "^29.1.2",
"ts-node-dev": "^2.0.0",
"typescript": "5.4.2"
}
}tsconfig.json (strict mode):
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"outDir": "dist",
"rootDir": "src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}ESLint Configuration (both packages):
- Airbnb base config
- TypeScript support
- React hooks rules
- Prettier integration
--max-warnings=0enforced
Jest Configuration:
- 100% test coverage requirement
- Transformers for TypeScript
- Mocking for native modules
-
Monorepo with Turborepo: Enables:
- Shared tooling configuration
- Cross-package dependencies
- Cached builds (turbo)
- Atomic deployments
-
React Native with Expo:
- Unified development workflow
- Over-the-air updates
- Managed native dependencies
-
Transformers.js:
- Browser-based ML without Python
- Pretrained sentiment analysis models
- ONNX runtime for performance
-
Strict Quality Gates:
- TypeScript strict null checks
- ESLint zero-warning policy
- Jest 85% coverage enforcement
sequenceDiagram
participant Dev as Developer
participant Turbo as Turborepo
participant Mobile as Mobile App
participant Server as Backend Server
Dev->>Turbo: pnpm run dev
Turbo->>Mobile: expo start
Turbo->>Server: ts-node-dev
Mobile->>Server: API Requests
Server->>Mobile: JSON Responses
To implement:
pnpm install- Install dependenciespnpm run dev- Start dev environmentpnpm run test- Run all testspnpm run lint- Check code quality