This is a template for kickstart Node.js TypeScript projects with best practices in mind.
It includes configurations for ESLint, Prettier, Jest, and Zod to ensure code quality, consistency, and maintainability.
- ✨ Node.js + TypeScript: Build robust applications with TypeScript in a Node.js environment.
- 🧹 ESLint and Prettier: Enforce code quality and formatting standards.
- 🚦 Jest: Testing framework for unit and integration tests.
- 🔒 Zod: Enforce strong typing and validate data structures.
Follow these steps to use the template:
git clone https://github.com/felipewom/node-ts-template.git your-project-name
cd your-project-name
npm install
npm run dev
This will run the application in development mode with ts-node-dev
and hot reloading.
npm run debug
You can also run the application in debug mode with ts-node-dev
and hot reloading.
npm run lint
npm test
This will run all tests with jest
unit-tests and e2e-tests.
You can also run tests separately:
npm run test:unit
This will run unit-tests with jest
.
npm run test:e2e
This will run e2e-tests with jest
.
npm run build
This will build the application for production with tsc
.
npm start
This will run the application in production mode with node
.
- 📁 src: Application source code.
- 📁 tests: Test files.
- 📁 templates: Template files for project generation (if applicable).
- 📄 .eslintrc.js: ESLint configuration.
- 📄 .prettierrc.js: Prettier configuration.
- 📄 jest.config.js: Jest configuration.
- 📄 tsconfig.json: TypeScript configuration.
Contributions are welcome! Follow these steps to contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature
. - Make your changes.
- Commit your changes:
git commit -m 'Add new feature'
. - Push to the branch:
git push origin feature/your-feature
. - Open a pull request.
This project is licensed under the MIT License.