A modern Node.js boilerplate with ESLint, Prettier, and GitHub Actions integration for automated code quality management. This template helps you kickstart Node.js projects with best practices for code formatting, linting, and CI/CD.
- Node.js v20+ support
- ESLint configuration for consistent code quality
- Prettier integration for automatic code formatting
- GitHub Actions workflow for continuous integration
- VSCode workspace settings and recommended extensions
- Environment variable support with dotenv
- Development mode with automatic server restarts
├── .env # Environment variables
├── .gitattributes # Git attributes configuration
├── .github/
│ └── workflows/
│ └── lint.yml # GitHub Actions workflow
├── .gitignore # Git ignore configuration
├── .prettierrc.json # Prettier configuration
├── .vscode/
│ └── Workspace.code-workspace # VSCode workspace settings
├── app.js # Main application entry point
├── eslint.config.js # ESLint configuration
└── package.json # Project dependencies and scripts
Before you begin, ensure you have installed:
- Node.js (v20 or higher)
- npm (v7 or higher)
-
Clone the repository:
git clone https://github.com/Adib23704/Nodejs-Boilerplate.git cd Nodejs-Boilerplate
-
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env
Edit the
.env
file with your configuration values.
Start the development server with hot reload:
npm run dev
Start the production server:
npm start
Run ESLint to check code quality:
npm run lint
Automatically fix linting issues:
npm run lint:fix
Format code using Prettier:
npm run format
Check code formatting:
npm run format:check
This project includes GitHub Actions workflows that automatically run on push and pull requests to the master
branch:
- Linting check
- Format verification
- Dependency security scan
Configure additional checks in .github/workflows/lint.yml
.
This project includes VSCode workspace settings and recommended extensions. To use them:
- Open the project in VSCode
- Install recommended extensions when prompted
- Use the workspace settings from
Workspace.code-workspace
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.