`serverAuthSetup` runs twice for `mern+tailwind+auth` and `mevn+tailwind+auth` stacks
Bug
For the two *+tailwind+auth stacks, the Express server setup (which runs npm init -y and installs dependencies) executes twice:
- Once inside the stack setup itself:
mernSetup()callsserverAuthSetup()whenconfig.stack === "mern+tailwind+auth"(utils/installer.js:321-322)mevnTailwindAuthSetup()callsserverAuthSetup()at the end (utils/installer.js:398)
- Then again from
utils/project.js:mern+tailwind+authpath:project.js:204→serverAuthSetup(...)aftermernTailwindSetupmevn+tailwind+authpath:project.js:210→serverAuthSetup(...)aftercopyTemplates
Reproduction
celtrix create→ stackmern+tailwind+auth- Observe
npm init -y+ dependency install output twice for theserver/directory
Impact
- Redundant
npm init -y+ full dependency install → noticeably slower scaffolding. - Second
npm init -yrewritesserver/package.json(dependencies are dropped, then reinstalled) — wasteful and risks losing the deps between the two passes.
Suggested fix
Call serverAuthSetup in exactly one place per stack — either inside the *Setup helper or in project.js, not both. Prefer keeping it in project.js so the auth-server setup is uniform across stacks.
Environment
celtrixv3.0.1
@JoeCelaster I would like to work on this issue.
Local Reproduction Results
I reproduced the reported behavior locally using the Celtrix source code on Windows.
Environment
- OS: Windows
- Stack: MERN + Tailwind + Auth
- Language: TypeScript
- Runtime: Node.js
- Package manager: npm
Steps to reproduce
- Run the local Celtrix CLI.
- Select MERN + Tailwind + Auth.
- Choose TypeScript, Node.js, and npm.
- Enable dependency installation.
- Observe the backend setup output during scaffolding.
Expected behavior
Backend initialization and dependency installation should execute only once.
Actual behavior
The output showed two backend dependency-installation steps:
- First installation: 137 packages added.
- Second installation: dependencies reported as up to date, with 138 packages audited.
Scaffolding completed successfully in 27.4 seconds.
This behavior is consistent with the duplicate server setup described in this issue. Is this issue still available for another contributor to work on?
I would like to work on this issue !
Assign me this issue .
Assign me this issue .
Hey buddy I am working on this issue !