
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
nxt-modular
Advanced tools
Berikut versi README.md yang sudah DIUPDATE agar konsisten dengan fitur flag --src dan perilaku generator terbaru.
Perubahan utama:
src/ sebagai default--src di semua bagian relevanThe Strict Modular Architecture Generator for Next.js
🔗 Repository: https://github.com/firzaelbuho/nxt-modular 📦 NPM: https://www.npmjs.com/package/nxt-modular
nxt-modular is a CLI generator for building a strict modular architecture in Next.js, supporting both the Page Router and the App Router.
This tool enforces architectural discipline, not just scaffolding:
anyIf you are looking for a “quick but messy” generator, this tool is not for you.
--src)# Run directly
bunx nxt-modular create home
# Or install globally
bun add -g nxt-modular
npm install -g nxt-modular
# or
pnpm add -g nxt-modular
bunx nxt-modular create home
Output (no src/):
modules/home/
pages/home/index.tsx
src/)bunx nxt-modular create home --src
Output:
src/modules/home/
src/pages/home/index.tsx
bunx nxt-modular create-app home
Output (no src/):
modules/home/
app/home/page.tsx
src/)bunx nxt-modular create-app home --src
Output:
src/modules/home/
src/app/home/page.tsx
create <name>Generate a Next.js Page Router module.
nxt-modular create user-profile
nxt-modular create user-profile --src
Generated:
modules/user-profile/ or src/modules/user-profile/pages/user-profile/index.tsx or src/pages/user-profile/index.tsxcreate-app <name>Generate a Next.js App Router module.
nxt-modular create-app dashboard
nxt-modular create-app dashboard --src
Generated:
modules/dashboard/ or src/modules/dashboard/app/dashboard/page.tsx or src/app/dashboard/page.tsx--src)nxt-modular supports two official directory layouts.
Used by many Next.js projects.
modules/
pages/
app/
Command:
nxt-modular create home
src/-based (opt-in)Used by teams that prefer stricter separation.
src/
├── modules/
├── pages/
└── app/
Command:
nxt-modular create home --src
--srcis explicit by design. The generator does not auto-detect to avoid ambiguity.
| Router Type | Supported |
|---|---|
Page Router (pages/) | ✅ |
App Router (app/) | ✅ |
Important:
index.tsxpage.tsxnxt-modular enforces Strict Modularity:
any)UI renders. Store stores. Service decides. Route loads only.
Example: home
modules/home/
├── index.tsx <- Module UI root (client)
├── store.ts <- Zustand store (state only)
├── service.ts <- All mutations & logic
├── types.ts <- UI state types
├── values.ts <- Default state
└── components/ <- Module-only components
When using
--src, the same structure lives undersrc/modules/.
shared/ or src/shared/index.tsx is the only UI entry pointstore.ts)service.ts)setStateimport HomePage from "@/modules/home";
export default function Page() {
return <HomePage />;
}
import HomePage from "@/modules/home";
export default function Page() {
return <HomePage />;
}
Route files are dumb loaders. Period.
This architecture mandates:
btn, card, modal)max-w-5xl mx-autoThis tool optimizes for long-term sanity, not short-term speed hacks.
MIT License © firzaelbuho
nxt-modular Strict architecture. No shortcuts.
FAQs
CLI generator for Next.js modular architecture (Page Router & App Router)
We found that nxt-modular demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.