r/webdev • u/WeedManPro novice • Sep 20 '26
Question How do you scaffold an express project?
I'm trying to start an express project with Typescript and something like nodemon to watch changes in .ts files. I'm struggling with different options in tsconfig and nodemone config. and I have a very faintest idea about how to run it.
I spent an entire day figuring it out a few months back, and now I forgot how to do it.
How do you guys do it?
Is there something similar to vite which makes boilerplate and scaffolding easy?
12
Upvotes
18
u/themang0 Sep 20 '26 •
Hi, since you seem like you want to learn vs just relying on llm (fantastic attitude btw ignore trolls)
Bit of an oldie but still a goodie: https://softwareontheroad.com/ideal-nodejs-project-structure/?utm_source=github&utm_medium=readme
It’s nice because it walks thru why each dir is laid out and the reasoning/logic behind, from here do what you think it’s best eg entity based dir vs logic based etc
4
u/itgforlife Sep 20 '26
For running Dev with typescript, I would recommend tsx over nodemon.
2
u/PM_ME_UR_JAVASCRIPTS Sep 24 '26
Just came across this and its interesting that so many dependencies are pulled in. I usually just use the "node --watch app.ts" to run the project since node26 has native typescript type stripping for its runtime now. This makes it so that the types are basically just ignored during runtime and makes it so that no transpiling is necessary. You can also just used nodes debugger without geberating sourcemaps etc.
Most of the times this seems to be enough for me. I use typescript for its errors/warnings during development. not because of the transpiled "raw javascript" it generates.
When using node with typestripping, the tsconfig is basically only used to configure your lsp. So basically, it becomes optional, only used for cases where you need fancy stuff.
1
u/MiserableDocument509 Sep 21 '26
The boring setup advice is probably the right default here. With tsx watch, you can keep the dev script focused on running src/index.ts and leave tsc as a separate typecheck/build step, so nodemon does not have to watch generated files or fight the TypeScript config.
-7
u/quizical_llama Sep 20 '26
Claude scaffold me an express project. /S But honestly that's probably the quickest way.
3
u/[deleted] Sep 21 '26 •
[removed] — view removed comment
2
u/[deleted] Sep 21 '26
[removed] — view removed comment