How voidagency/vactory_nextjs works
Project Type & Purpose
• Type: Monorepo housing multiple Next.js applications, shared packages, documentation site, and CI/CD/deployment scripts.
• Purpose:
– Provide a starter Next.js app (apps/starter) with built-in auth & API routes.
– Host a production site (apps/capital-azur) that uses shared UI and content-type packages.
– Offer a Storybook playground (apps/playground) for UI component development & testing.
– Serve a Docusaurus docs site (apps/docs).
– Publish a suite of reusable NPM packages under packages/ (ui kit, Next.js framework extensions, CMS integrations).
– Containerize via Docker and deploy via Capistrano.
File Structure
• Root level: lerna.json & turbo.json (monorepo manager), Dockerfile & docker-compose.yml, Capistrano folder (deploy scripts), global configs (tsconfig.json, .eslintrc.json, etc.).
• apps/: four Next.js-based apps—starter, capital-azur, playground, docs—each with its own pages/, components/, styles/, and build configs.
• packages/:
– ui: themed React components + Storybook config.
– next: Next.js utilities (i18n, proxies, SSR/SSG helpers).
– next-banners, next-blocks, next-news, next-page, next-paragraphs, next-user: modular “plugins” for content types, CMS fetchers, auth flows.
– headlessui: patched fork of HeadlessUI.
• Capistrano/: deployment recipes for staging & production.
• Scripts/: detection of unused code, monorepo helpers.
Key Insights from README
• Docker multi-stage build targets: runner_app (starter), runner_ui (storybook), runner_docs (docusaurus).
• Capistrano commands to deploy apps/starter to remote servers using SSH keys.
• No built-in backend database—external CMS and auth providers via next-user.
Main Components
A. Developer Environment & Monorepo
– Editor/IDE
– Git & Bitbucket Repo
– Lerna/Turbo (monorepo orchestration)
B. Codebase Modules
– apps/starter (Next.js SSR/SSG + API routes)
– apps/capital-azur (production site)
– apps/playground (Storybook + Next.js preview)
– apps/docs (Docusaurus docs site)
– packages/ui (React component library + themes)
– packages/next & other plugins (CMS & auth integrations)
C. Build & Packaging
– Docker daemon (multi-stage builds)
– docker-compose (local dev orchestration)
– Git push → CI triggers Lerna/Turbo, Docker build, artifact publish
E. Container Registry (if used)
F. Deployment
– Capistrano invoking SSH to staging/production servers
– Docker run containers (runner_app, runner_ui, runner_docs)
G. Runtime & External Services
– External Headless CMS APIs (used by next-news, next-blocks)
– Auth provider or custom next-user endpoints
– CDN / Static asset hosting (public/ folder)
Architectural Patterns
• Monorepo for code sharing
• Modular plugin architecture (each packages/next-* is independent)
• Multi-stage container images for development vs. production
• Server-side rendering and static site generation via Next.js
• Storybook as isolated component playground
Technologies & Frameworks
• Node.js & Next.js
• React (packages/ui)
• Docusaurus (apps/docs)
• Storybook (apps/playground + packages/ui)
• Tailwind CSS (present throughout apps)
• Lerna/Turbo (monorepo)
• Docker / docker-compose
• Capistrano / SSH deployment
• External CMS (e.g., Drupal) & Auth services