Welcome to the Node.js + TypeScript Boilerplate! This repository provides a clean and minimal setup for building applications using Node.js and TypeScript. It includes essential tools such as ESLint for code quality, Prettier for code formatting, and tsup for bundling. It also supports environment variables through .env
files.
- Minimal Setup: Quickly get started with a clean slate.
- TypeScript Support: Leverage the power of TypeScript for better type safety.
- Linting: Use ESLint to maintain code quality.
- Formatting: Automatically format your code with Prettier.
- Bundling: Use tsup for efficient bundling of your application.
- Environment Variables: Manage your app's configuration with
.env
support.
To set up the project, follow these steps:
-
Clone the repository:
git clone https://github.com/srikanthRyali2004/node-ts-boilerplate.git
-
Navigate to the project directory:
cd node-ts-boilerplate
-
Install dependencies:
npm install
-
Create a
.env
file: Copy the example file and configure your environment variables.cp .env.example .env
To start the development server, run:
npm run dev
For production builds, use:
npm run build
You can run tests using:
npm test
The project follows a simple structure:
node-ts-boilerplate/
βββ src/
β βββ index.ts
β βββ ... (other source files)
βββ .env.example
βββ .eslintrc.js
βββ .prettierrc
βββ package.json
βββ tsconfig.json
- src/: Contains the source code of your application.
- .env.example: A template for your environment variables.
- .eslintrc.js: ESLint configuration file.
- .prettierrc: Prettier configuration file.
- package.json: Project metadata and dependencies.
- tsconfig.json: TypeScript configuration file.
You can customize the ESLint and Prettier configurations by modifying the respective files. Adjust the rules in .eslintrc.js
to fit your coding style. Prettier settings can be found in .prettierrc
.
The following scripts are available in this boilerplate:
dev
: Starts the development server with hot reloading.build
: Compiles the TypeScript code into JavaScript.test
: Runs the test suite.lint
: Lints the code using ESLint.format
: Formats the code using Prettier.
You can run any of these scripts using npm run <script-name>
.
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your branch and create a pull request.
Please ensure your code follows the existing style and passes all tests.
This project is licensed under the MIT License. See the LICENSE file for details.
For the latest releases, visit the Releases section. You can download and execute the latest version from there.
This boilerplate provides a solid foundation for building Node.js applications with TypeScript. It includes essential tools and configurations to help you maintain code quality and improve your development workflow.
Feel free to explore the repository, and don't hesitate to reach out if you have any questions or suggestions. Happy coding!