I'm starting an Express project with TypeScript and want a development setup that automatically restarts when .ts files change. I'm unsure how to configure npm, tsconfig.json, the TypeScript compiler, and a watcher such as nodemon or tsx. I've set this up before, but it took most of a day and I no longer remember the details. Is there a standard project structure or a tool similar to Vite that can generate a sensible Express boilerplate?
3 Answers
For a small TypeScript Express app, you can usually skip a generator and keep the setup simple. Run `npm init -y`, install Express, TypeScript, `tsx`, and the relevant type packages, then add a development script such as `"dev": "tsx watch src/index.ts"`. Keep the entry point in `src/index.ts`, with separate folders for routes, middleware, and configuration. Your `tsconfig.json` should match how you actually run the app rather than copying a large boilerplate configuration.
A project-structure guide can be useful for understanding why folders such as routes, controllers, services, and configuration are separated. Once you understand the reasoning, adapt the layout to your own application instead of treating one structure as mandatory. For the tooling outside `src`, start with a minimal npm setup and add compiler and watch options only as needed.
There isn’t one universal Express scaffold comparable to Vite. Many developers create the base project manually so they understand every setting and can avoid inheriting unnecessary configuration. Generators or AI can produce a quick starting point, but the result still needs to be reviewed and adjusted to your preferred runtime, module system, folder structure, and development scripts.
That makes sense. I’m looking for a conventional setup I can understand and maintain rather than blindly accepting generated configuration.

That’s helpful for the folder layout. I’m mainly trying to understand the setup from `npm init` through `tsconfig.json`, the module settings, TypeScript compilation, and configuring a file watcher.