I'm starting an Express project with TypeScript and want a development setup that automatically restarts when .ts files change. I've struggled with the different tsconfig options, nodemon or similar watch tools, and the basic commands needed to compile and run everything. I figured this out once before but have forgotten the details. Is there a common setup or a tool similar to Vite that makes Express project scaffolding easier?
3 Answers
Generators and AI-created boilerplates can be quick, but they often produce a setup you don’t fully understand or that doesn’t match your preferences. A project-structure guide can help explain how to organize the source code, but it’s still worth creating the package scripts and compiler configuration yourself. That gives you a clean foundation and makes future changes much easier to reason about.
A useful approach is to start with npm init, choose your module system deliberately, and then configure TypeScript, the compiler output directory, and a development watch command separately. Tools like tsx can watch and execute TypeScript directly, so you may not need both nodemon and a separate TypeScript watcher during development. Once the basics work, add stricter compiler settings and project structure gradually.
For a small TypeScript Express app, you can skip a generator and build the setup yourself. Run npm init -y, install express, typescript, tsx, and the appropriate type packages, then add a script like "dev": "tsx watch src/index.ts". Keep the initial structure simple with folders such as src, routes, middleware, and config. Your tsconfig should match the Node runtime you’re actually using rather than coming from a large boilerplate template.

That makes sense. I’m mainly looking for the setup outside the src folder—npm initialization, tsconfig, module settings, the TypeScript compiler, and the development watch command.