This is a starter project for building a backend application using Express, TypeScript, and Webpack.
- Express: Fast and minimalist web framework for Node.js. (v. 5)
- TypeScript: Strongly typed JavaScript for better development experience. (v. 5)
- Webpack: Module bundler for compiling and optimizing the code. (v. 5)
- ESLint: Linting for maintaining code quality. (v. 9)
- Prettier: Code formatting for consistent style. (v. 3)
- Husky: Git hooks for enforcing pre-push checks. (v. 9)
- pnpm: Package manager for managing dependencies. (v. 10)
npm install -g pnpm@latest-10- Clone the repository:
git clone https://github.com/jhordyess/express-ts-starter.git- Navigate to the project folder:
cd express-ts-starter- Install dependencies:
pnpm i- Start the development server:
pnpm dev- Open your browser or API client and interact with the server running at http://localhost:3000.
This template includes two useful npm lifecycle scripts configured in package.json.
prepare: Runs after install and initializes Husky, so Git hooks (likepre-push) are ready automatically.postinstall: Runs after install and executespnpm audit --audit-level moderateto check for known vulnerabilities in dependencies.
What this means:
- When you run
pnpm i, Husky setup is done for you. - A security check is also executed automatically after dependencies are installed.
- If vulnerabilities are found, review and update the affected packages before continuing.
express-ts-starter/
├── .env.example # Example environment variables file.
├── .gitignore # List of files and directories to be ignored by version control.
├── .prettierrc.json # Prettier configuration file.
├── eslint.config.js # ESLint configuration file.
├── package.json # Project configuration and dependencies.
├── pnpm-lock.yaml # pnpm lock file for dependency versions.
├── README.md # Project documentation.
├── tsconfig.json # TypeScript configuration file.
├── webpack.config.js # Webpack configuration file.
├── .husky/ # Directory for Git hooks managed by Husky.
│ ├── pre-push # Pre-push hook to run linting and TypeScript checks.
├── src/
│ ├── index.ts # Main entry point of the application.
│ ├── config.ts # Configuration file for the application.pnpm devpnpm buildpnpm build:validatepnpm startpnpm ts-checkpnpm lintpnpm validatepnpm formatContributions are welcome! If you find any issues or want to enhance the project, feel free to submit a pull request.
Happy coding!