FAQs
Common questions developers have about using NeatNode, its CLI, and its generated templates.
General
How do I create a new project with NeatNode?
Run the CLI directly using npx:
npx neatnodeYou’ll be prompted for:
- Project name
- Template type (Basic, REST API, or Socket)
- Whether to include CRUD modules
After generation, follow the next steps:
cd my-app
npm install
npm run devHow do I change the default template?
You can choose a template during the CLI prompt, or edit the generated files manually later.
If you want to make a new default, open src/config/templates.js and reorder or modify the entries.
How can I add my own custom template?
-
Create a new folder under
backend/templates/(e.g.,express-graphql). -
Add all necessary files:
server.js,src/app.js,package.json, etc. -
Register it in
templates.js:{ name: "GraphQL API", path: path.join(__dirname, "../../templates/express-graphql") } -
Run
npx neatnodeand select your new template from the list.
How do CRUD files get removed?
NeatNode removes CRUD-related files and route references using markers in app.js:
// ROUTE_IMPORTS_START
// ROUTE_IMPORTS_END
// ROUTE_USES_START
// ROUTE_USES_ENDWhen you select “No CRUD” during setup, these files are deleted:
src/models/*.model.jssrc/controllers/*.controller.jssrc/routes/*.route.js
…and their imports and uses are stripped automatically.
Why are my CRUD routes missing?
If you selected “No CRUD” during CLI setup, the example CRUD files were removed intentionally. To restore them, either:
- Re-run the CLI and include CRUD, or
- Copy CRUD modules manually from the template folder.
Can I use TypeScript with NeatNode?
Currently, templates are JavaScript-based, but the structure is TS-friendly. A future update will include:
--typescriptflag support for generating .ts files.
Configuration & Environment
Where do I configure environment variables?
Each template includes a .env.example file.
Copy it and rename to .env, then adjust values like:
PORT=5000
DB_URL=mongodb://localhost:27017/mydbYour app automatically loads these via dotenv in server.js.
How do I change the default port?
Open server.js in your generated project and modify:
const PORT = process.env.PORT || 5000;Then update .env accordingly.
Can I use NeatNode inside an existing project?
You can, but it’s not recommended. The CLI assumes it’s creating a new folder. If you must, use:
npx neatnode .and it’ll scaffold into the current directory.
Troubleshooting
I see “Folder already exists” error
NeatNode won’t overwrite existing directories to avoid data loss. Either:
cd existing-folder && npx neatnode .or create a new one:
npx neatnode my-new-appremoveCrudReferences didn’t clean my app.js file
Make sure your app.js includes both comment markers:
// ROUTE_IMPORTS_START
// ROUTE_IMPORTS_END
// ROUTE_USES_START
// ROUTE_USES_ENDThe regex-based remover depends on these comments.
Why does placeholder replacement not work everywhere?
By default, only occurrences of project-name inside package.json are replaced.
Future updates will support:
{{projectName}}, {{author}}, {{version}}for broader replacement coverage.
How do I update NeatNode?
If globally installed:
npm update -g neatnodeOr if using via npx, it always fetches the latest published version.
Miscellaneous
Where are templates stored?
Templates live inside the CLI package itself, under:
backend/templates/Each template folder is a complete Node.js project with its own dependencies.
Can I deploy generated projects directly?
Yes — each generated project is a self-contained Node.js app. You can deploy it to:
- Render
- Railway
- Vercel (with Node adapter)
- Any VPS (via PM2)
Will NeatNode support monorepo setup?
Planned for future versions.
A --monorepo flag will scaffold independent services (auth, API, socket) under one root.
💬 Still stuck?
If you hit issues not covered here, open a discussion or issue on GitHub .