/node-ts-template

๐Ÿš€ Node.js TypeScript Template

Primary LanguageTypeScriptMIT LicenseMIT

Node.js TypeScript Project Template

GitHub License Buy Me A Coffee

Overview

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.


Features

  • โœจ 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.

Getting Started

Follow these steps to use the template:

1. Clone the Repository:

git clone https://github.com/felipewom/node-ts-template.git your-project-name

2. Install Dependencies:

cd your-project-name
npm install

3. Run in Development Mode:

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.

4. Lint Code:

npm run lint

5. Run Tests:

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.

6. Build for Production:

npm run build

This will build the application for production with tsc.

7. Run in Production Mode:

npm start

This will run the application in production mode with node.

Project Structure

  • ๐Ÿ“ 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.

Contributing

Contributions are welcome! Follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature/your-feature.
  3. Make your changes.
  4. Commit your changes: git commit -m 'Add new feature'.
  5. Push to the branch: git push origin feature/your-feature.
  6. Open a pull request.

License

This project is licensed under the MIT License.