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.