yabasha/monolith
This project provides a robust, scalable architecture for modern full-stack development by combining a Laravel 12 backend with a Next.js 16 frontend in a unified monorepo. It is designed for developers who value explicit structure, clear boundaries between application layers, and high-performance workflows. By organizing the core application code within an apps directory and isolating shared UI primitives in a packages workspace, it enables teams to build complex systems while maintaining a consistent design language.
Technically, the repository leverages Bun workspaces to manage dependency linking, ensuring fast installs and efficient HMR across local and containerized environments. The stack is carefully integrated using Docker for the backend infrastructure—including MySQL, Redis, and Nginx—while keeping the Next.js frontend running natively for an optimal developer experience. Notable design highlights include a centralized shadcn/ui library that is explicitly transpiled for the Next.js application, preventing common integration issues with Tailwind CSS and TypeScript when working across package boundaries.
This monorepo serves as a blueprint for long-term project viability, prioritizing maintainability through strict ownership definitions and a balanced approach to framework integration. It is an excellent resource for engineers looking to learn how to bridge the gap between heavy-duty backend frameworks and high-performance frontend tools in a single, well-documented repository.
- Stars
- 2
- Forks
- 0
- Language
- TypeScript
- Updated
- 4mo ago
§ Readme
Edit on GitHub ↗🧱 Yabasha.dev Monorepo
A modern full-stack monorepo powered by Bun workspaces, combining a Laravel 12 backend, Next.js 16 frontend, and a shared React UI library built with Tailwind + shadcn/ui.
This repo is designed for high DX, clear boundaries, and long-term scalability — no framework wars, just solid engineering.
🧠 Architecture Overview
This monorepo uses Bun v1.3.0 workspaces to manage multiple applications and shared packages in a single repository.
Tech Stack
| Layer | Technology | Notes |
|---|---|---|
| Backend | Laravel 12 | API, Jobs, Queues, Filament Admin |
| Frontend | Next.js 16 | App Router, TypeScript |
| UI | React + Tailwind | Shared components (shadcn/ui style) |
| Workspaces | Bun | Fast installs, workspace linking |
| Infra | Docker | MySQL, Redis, Horizon, Nginx |
📁 Repository Structure
.
├── apps/
│ ├── backend/ # Laravel 12 API + Filament Admin
│ │ ├── app/ # Core application code
│ │ ├── bootstrap/
│ │ ├── config/
│ │ ├── database/
│ │ ├── public/
│ │ ├── resources/
│ │ ├── routes/
│ │ ├── storage/
│ │ ├── tests/
│ │ ├── composer.json
│ │ ├── artisan
│ │ └── ... # Standard Laravel structure
│ │
│ └── web/ # Next.js 16 frontend application
│ ├── src/
│ │ ├── app/ # App Router pages/layouts
│ │ ├── components/ # App-specific components
│ │ ├── lib/ # Utilities/helpers
│ │ └── styles/
│ ├── public/
│ ├── next.config.ts # Includes transpilePackages config
│ ├── package.json
│ ├── tailwind.config.ts
│ └── tsconfig.json
│
├── packages/
│ └── ui/ # Shared UI library (@yabasha/ui)
│ ├── src/
│ │ ├── components/ # Shared components (shadcn/ui style)
│ │ ├── lib/
│ │ │ └── utils.ts # cn(), helpers, etc.
│ │ └── index.ts # Export surface
│ ├── package.json
│ ├── tsconfig.json
│ └── tailwind.config.ts # (optional) if needed for building
│
├── docker/
│ └── nginx/
│ └── default.conf # Nginx config for Laravel
│
├── docker-compose.yml # MySQL + Redis + Horizon + Nginx + Backend
├── package.json # Root Bun workspaces + proxy scripts
├── bun.lock
├── tsconfig.json # Base TS config shared by web + ui
└── README.md
🚀 Getting Started
Prerequisites
Make sure you have:
- Bun v1.3.0+
- Docker + Docker Compose
- PHP 8.3+
- Composer
📦 Install Dependencies
From the repo root:
bun install
| Bun automatically links workspace packages like @yabasha/ui using workspace:*.
🐳 Start Backend (Laravel + MySQL + Redis)
docker compose up -d --build
Laravel will be available at:
Useful services:
Mailpit → http://localhost:8025
Meilisearch → http://localhost:7700
First-time Laravel setup
docker exec -it yabasha-backend bash
php artisan key:generate
php artisan migrate
php artisan storage:link
🌐 Start Frontend (Next.js)
From the repo root:
bun run dev
Frontend runs at:
🎨 Shared UI Package (@yabasha/ui)
The UI package lives in:
packages/ui
It contains reusable React components (shadcn-style) shared across apps.
Add a new UI component
bun run ui:add
This runs shadcn add inside the UI package, not the app — intentional and clean.
Using UI components in Next.js
import { Button } from "@yabasha/ui";
export default function Page() {
return <Button>Click me</Button>;
}
⚙️ Why transpilePackages Is Required
Next.js does not transpile workspace packages by default.
We explicitly enable this in:
apps/web/next.config.ts
transpilePackages: ["@yabasha/ui"];
Without this: ❌ Tailwind classes may break ❌ TypeScript may fail ❌ Hot reload becomes unreliable
With it: ✅ Clean imports ✅ Proper HMR ✅ Zero hacks
🧑💻 Developer Experience (DX) Tips
🔥 Strong Recommendations
-
Run frontend locally, backend via Docker → Faster HMR, fewer container rebuilds
-
Keep UI logic dumb → No API calls, no app-specific state in packages/ui
-
Prefer composition over inheritance → Especially for UI primitives
🧠 Optional DX Upgrades (Worth It)
If this repo grows, strongly consider:
- ✅ Turborepo for task orchestration
- ✅ Shared ESLint + Prettier config
- ✅ Docker Compose override for Next.js container
- ✅ GitHub Actions CI
- ✅ Storybook for @yabasha/ui
- ✅ Changesets if you ever publish UI packages
🧭 Philosophy
This monorepo is built around a few principles:
- Clear ownership (apps vs packages)
- Fast feedback loops
- Minimal magic
- Explicit configuration over convention
- Scales from solo dev → team
🧪 Common Commands
bun run dev # Start Next.js frontend
bun run build # Build frontend
bun run lint # Lint frontend
bun run ui:add # Add shadcn component to UI package
docker compose up -d # Start backend stack
docker compose down # Stop backend stack
Happy hacking 🚀
If you break it — good, that means you’re pushing it 😄
📚 License
MIT License
§ Cite this project
For papers, blog posts, & AI referencesBashar Ayyash. (2026). yabasha/monolith [Computer software]. https://yabasha.dev/open-source/monolith§ Related repositories
yabasha/composable-ai-stack
The Composable AI Stack (CAS) is a production-ready monorepo template designed for developers building AI-integrated SaaS applications. It provides a structured, modular foundation that abstracts the complexity of scaling from localized prototyping to robust enterprise deployments. By standardizing the integration of LLMs, database interactions, and billing logic, it enables teams to focus on core product features rather than boilerplate architecture.
- TypeScript
- 1 stars
- 0 forks
- updated 1d ago
yabasha/yabasha-gex
GEX is a versatile command-line interface tool designed to help developers audit, document, and manage their Node.js package environments. It provides a structured approach to generating reproducible reports for local projects and globally installed packages. By supporting multiple runtime environments—Node.js (npm), Bun, Yarn, and pnpm—it serves as a unified utility for teams needing to track dependency states, enforce license compliance, or simplify vulnerability auditing across diverse infrastructure.
- TypeScript
- 1 stars
- 0 forks
- updated 1d ago
yabasha/cas
@yabasha/cas is a command-line interface tool designed to instantly scaffold professional-grade, AI-ready monorepos. It is tailored for developers building production SaaS applications who require a standardized, high-performance foundation built on the Composable AI Stack. By providing interactive prompts and CLI-driven configuration, the tool allows users to selectively integrate complex architectural components like background workers, external API gateways, and automated evaluation harnesses without manual setup.
- TypeScript
- 0 stars
- 0 forks
- updated 1d ago