Skip to content
Houzayfa Zakieh
All articles
2 min read

Zakieh: scaffold a Next.js or React project with the architecture you choose

Zakieh is a command-line tool that asks a few questions (framework, architecture, pages) and generates the project, so you stop rebuilding the same folder structure by hand.

  • Next.js
  • React
  • CLI
  • Architecture

Every time I started a new project, the first stretch of time went to the same small things: creating folders, deciding where files should go, adding pages, wiring routes, and adjusting the setup until it felt right. None of it is hard, but all of it takes time, and I kept repeating it.

So I built Zakieh, a command-line tool. You answer a few questions and get a project laid out the way you want, ready to work in.

What it asks you

  • Framework: Next.js (App Router) or React (Vite).
  • Language: TypeScript or JavaScript.
  • Architecture: TBA, FBA or Hybrid.
  • Pages: how many pages the site has and what they are called.
  • Page details: which pages are dynamic (a detail route such as /products/[id]) and which have their own layout.

It then shows you the folder tree to confirm, generates the project, and can initialize git and install dependencies. The base project comes from the official tools (create-next-app and create-vite), so it stays up to date with the frameworks.

The three architectures

  • TBA (type-based): files are grouped by type: components, hooks, services. Simple, and a good fit for small projects.
  • FBA (feature-based): files are grouped by feature or page, so everything for one feature lives together. It scales better for medium and large projects.
  • Hybrid: a shared layer for what is reused everywhere, plus a features layer. This is the one I reach for most often.

The full folder trees for each, in both React and Next.js, are in the architectures guide.

Try it

npm create zakieh@latest

For scripts and CI there is a non-interactive form:

npm create zakieh@latest my-app -- --framework next --arch hybrid --pages home,about,contact --yes

Keep growing the project

The structure does not stop at day one. The same tool adds to an existing project while respecting the architecture you picked:

zakieh add page about
zakieh add feature cart

Where it is now

Zakieh is at version 0.1 and published on npm, under the MIT license. The roadmap lists what comes next, and ideas, bug reports and pull requests are welcome on GitHub.

I build websites and web apps with Next.js and React in Aleppo and remotely. If you have a project, you can get in touch.