Rekomendasi #5 â Turborepo Setup for Consolidated Projects | Generated 27 Maret 2026
Setelah consolidation (93 â ~20 projects), semua apps bisa di-manage dalam satu repository menggunakan Turborepo. Ini memberikan:
Turborepo hanya rebuild apps yang berubah. Deploy 1 app tanpa rebuild semua 20.
UI components, utilities, dan configs shared across apps â zero duplication.
Satu repo, satu PR workflow, satu CI/CD pipeline. Easier code review & maintenance.
Vercel Remote Cache gratis â build artifacts di-cache, tim lain langsung pakai tanpa rebuild.
ibnu-workspace/ âââ turbo.json # Turborepo config âââ package.json # Root workspace config âââ vercel.json # Global Vercel settings â âââ apps/ # All deployable applications â âââ superapp/ # app.heyibnu.com (merged from 15 projects) â â âââ package.json â â âââ vercel.json â â âââ src/ â â âââ index.html â â âââ modules/ # life, pro, skill, business, etc. â â â âââ superapp-gov/ # superapp.bangkim.com (merged from 7 projects) â â âââ package.json â â âââ src/ â â â âââ gov-dashboard/ # dashboard.bangkim.com â â âââ package.json â â âââ src/ â â â âââ gov-data/ # data.bangkim.com â â âââ package.json â â âââ src/ â â â âââ finance/ # finance.heyibnu.com (merged from 8 projects) â â âââ package.json â â âââ src/ â â â âââ ai-hub/ # ai.heyibnu.com â â âââ package.json â â âââ src/ â â â âââ tech-toolkit/ # tools.heyibnu.com â â âââ package.json â â âââ src/ â â â âââ learning/ # learning.heyibnu.com (merged from 9 projects) â â âââ package.json â â âââ src/ â â â âââ career/ # career.heyibnu.com â â âââ package.json â â âââ src/ â â â âââ productivity/ # productivity.heyibnu.com â â âââ package.json â â âââ src/ â â â âââ portfolio/ # heyibnu.com â â âââ package.json â â âââ src/ â â â âââ hub/ # hub.heyibnu.com â âââ package.json â âââ src/ â âââ packages/ # Shared packages â âââ ui/ # Shared UI components (nav, theme, cards) â â âââ package.json â â âââ src/ â â â âââ nav.js â â â âââ theme.js â â â âââ card.js â â â âââ index.js â â âââ styles/ â â âââ base.css â â â âââ utils/ # Shared utilities (fetch, auth, storage) â â âââ package.json â â âââ src/ â â âââ api.js â â âââ storage.js â â âââ helpers.js â â â âââ config/ # Shared configs (ESLint, Prettier, TypeScript) â âââ eslint-config/ â âââ prettier-config/ â âââ tsconfig/ â âââ .github/ âââ workflows/ âââ ci.yml # GitHub Actions CI with Turborepo
{
"$schema": "https://turbo.build/schema.json",
"globalDependencies": ["**/.env"],
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**", "!.next/cache/**"],
"cache": true
},
"dev": {
"persistent": true,
"cache": false
},
"lint": {
"dependsOn": ["^build"],
"cache": true
},
"deploy": {
"dependsOn": ["build", "lint"],
"cache": false
}
}
}{
"name": "ibnu-workspace",
"private": true,
"workspaces": ["apps/*", "packages/*"],
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev",
"lint": "turbo run lint",
"build:superapp": "turbo run build --filter=superapp",
"build:gov": "turbo run build --filter=superapp-gov --filter=gov-dashboard --filter=gov-data",
"deploy:all": "turbo run deploy"
},
"devDependencies": {
"turbo": "^2.3.0"
}
}{
"buildCommand": "cd ../.. && npx turbo run build --filter=superapp",
"outputDirectory": "dist",
"installCommand": "npm install",
"framework": null
}Setiap app di monorepo bisa deploy ke Vercel project terpisah dengan domain sendiri:
| App | Vercel Project | Domain | Root Directory |
|---|---|---|---|
| superapp | superapp-main | app.heyibnu.com | apps/superapp |
| superapp-gov | superappgov | superapp.bangkim.com | apps/superapp-gov |
| gov-dashboard | dashboard-monitoring | dashboard.bangkim.com | apps/gov-dashboard |
| gov-data | databangkim | data.bangkim.com | apps/gov-data |
| finance | finance | finance.heyibnu.com | apps/finance |
| ai-hub | llmai | ai.heyibnu.com | apps/ai-hub |
| tech-toolkit | koleksiapi | tools.heyibnu.com | apps/tech-toolkit |
| learning | ibnu-learning-journey | learning.heyibnu.com | apps/learning |
| career | career-job | career.heyibnu.com | apps/career |
| productivity | productivity | productivity.heyibnu.com | apps/productivity |
| portfolio | ibnu-portfolio | heyibnu.com | apps/portfolio |
| hub | ibnu-hub | hub.heyibnu.com | apps/hub |
// packages/ui/src/nav.js // Shared navigation component used by ALL apps export function createNav(config) { const nav = document.createElement('nav'); nav.className = 'ibnu-nav'; nav.innerHTML = ` <div class="nav-brand"> <a href="${config.homeUrl || '/'}">${config.title}</a> </div> <div class="nav-links"> ${config.links.map(l => \`<a href="\${l.url}" class="\${l.active ? 'active' : ''}">\${l.label}</a>\` ).join('')} </div> <div class="nav-hub"> <a href="https://hub.heyibnu.com">ð Hub</a> </div> `; return nav; } // packages/ui/src/theme.js // Unified dark theme applied across all apps export const theme = { bg: '#0a0a0a', surface: '#141414', border: '#2a2a2a', text: '#f5f5f5', muted: '#a0a0a0', accent: '#3b82f6', success: '#22c55e', error: '#ef4444', warn: '#eab308' }; export function injectTheme() { const style = document.createElement('style'); style.textContent = Object.entries(theme) .map(([k,v]) => `--${k}:${v}`).join(';'); document.head.appendChild(style); }
Create new repo ibnu-workspace, install Turborepo, setup workspace structure dengan apps/ dan packages/ directories.
Build @ibnu/ui (nav, theme, cards), @ibnu/utils (API helpers, storage), @ibnu/config (ESLint, Prettier, TypeScript configs).
Move each of the ~12 consolidated apps into apps/ directory. Update imports to use shared packages. Verify builds pass.
Update each Vercel project's root directory setting to point to its app directory. Setup build commands with Turborepo filter.
Link Turborepo to Vercel for remote cache. Build artifacts cached & shared â subsequent builds ~70% faster.
GitHub Actions workflow with turbo run build --filter=...[HEAD^1] â only CI affected apps on each push.
| Metric | Before (93 repos) | After Monorepo | Improvement |
|---|---|---|---|
| Cold Build (all) | N/A (separate repos) | ~3 min | One command |
| Incremental Build | Always full rebuild | ~30s (changed only) | ~70% faster |
| Shared Code Updates | Copy-paste to 93 repos | 1 change, auto-propagate | ~99% less effort |
| Dependency Management | 93 package.jsons | 1 root + 12 apps | ~87% fewer |
| CI Pipeline | 93 separate pipelines | 1 smart pipeline | Unified |
| Code Consistency | No enforcement | Shared lint/format | 100% consistent |
| Prerequisite | Status | Notes |
|---|---|---|
| Rekomendasi #2: Consolidation | ð Plan Complete | Must complete consolidation before monorepo migration |
| Rekomendasi #4: Domain Strategy | â Done | Domains already mapped â monorepo preserves these |
| Rekomendasi #8: Framework Standardization | â³ Parallel | Can migrate to Next.js during monorepo setup |
Monorepo Architecture Plan v1.0 â Generated by Claude for Subkhan Ibnu Aji â 27 Maret 2026
Part of Vercel & GitHub Infrastructure Audit Series