[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-82001":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":15,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},82001,"express-typescript-starter","ToniR7\u002Fexpress-typescript-starter","ToniR7","Production-ready Node.js boilerplate built with TypeScript 6 and Express 5","",null,"TypeScript",33,5,22,1,0,6,10,3,2.33,"MIT License",false,"main",true,[26,27,28,29],"docker","express","nodejs","typescript","2026-06-12 02:04:22","\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fimages\u002Flogo.png\" alt=\"Express Typescript Starter Logo\" width=\"500\" \u002F>\n\u003C\u002Fp>\n\nA production-ready Express.js boilerplate built with TypeScript, designed to provide a robust, scalable, and secure foundation for your next Node.js API project. This template comes with essential features like strong security, high code quality, and developer-friendly tools, enabling you to focus on building your application while ensuring maintainability and performance right from the start.\n\n## 🌟 Key Features\n\n### 🛠 Core Functionality\n\n- **Web framework**: Fast and minimalist web application framework using [express](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fexpress)\n- **Logging**: Advanced logging with [winston](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fwinston) and [morgan](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fmorgan)\n- **Schema validation**: Ensure the integrity of incoming requests (query params, body) using [zod](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fzod)\n- **Environment Variable Management**: Ensures all required environment variables are present and properly validated using [zod](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fzod)\n- **Error handling**: Comprehensive error management system\n- **Signal handling**: Gracefully handles OS signals like `SIGTERM` and `SIGINT` to ensure proper cleanup and shutdown of the application\n- **API Documentation**: Automatic OpenAPI\u002FSwagger documentation generation using [zod-openapi](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fzod-openapi), seamlessly integrated with Zod schemas to provide always up-to-date API documentation\n\n### 🔒 Security Features\n\n- **CORS protection**: Manage cross-origin requests with [cors](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fcors)\n- **Helmet**: Help secure Express apps by setting HTTP response headers with [helmet](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fhelmet)\n- **Rate limiting**: Safeguard the API against excessive requests and potential DDoS attacks with efficient middleware provided by [express-rate-limit](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fexpress-rate-limit)\n- **Secure authentication**: Robust JWT-based authentication implemented using [jsonwebtoken](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fjsonwebtoken), [jwks-rsa](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fjwks-rsa) and [jwt-decode](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fjwt-decode). Public keys are fetched from Microsoft’s identity platform, tokens are decoded and verified, and user informations (like `username` and `groups`) are extracted. Tokens are validated against audience and issuer claims to ensure only authorized clients can access the API.\n\n### 💻 Code Quality\n\n- **Code formatting**: Consistent code style with [oxfmt](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Foxfmt)\n- **Linting**: Enforce best practices and maintainable code with [oxlint](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Foxlint)\n- **Git Hooks with Husky**: Automated quality gates using [husky](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fhusky) to enforce standards on every commit:\n  - **Pre-commit hook** — Runs the following checks before allowing a commit:\n    - Unit tests to prevent commits that would break the test suite\n    - Lint and format staged files via [lint-staged](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Flint-staged) (oxlint auto-fix + oxfmt)\n      ```json\n      {\n        \"*.{js,jsx,ts,tsx}\": [\"npm run lint:fix\"],\n        \"*.{js,jsx,ts,tsx,md,html,css}\": [\"npm run format\"]\n      }\n      ```\n    - `npm audit` to check for known vulnerabilities\n    - TypeScript type checking to catch type errors\n\n  - **Commit-msg hook** — Enforces [Conventional Commits](https:\u002F\u002Fwww.conventionalcommits.org\u002F) format using [commitlint](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@commitlint\u002Fcli)\n\n### 📖 API Documentation\n\nThis boilerplate includes automatic OpenAPI\u002FSwagger documentation generation that keeps your API docs always in sync with your code.\n\n#### Features\n\n- **Automatic Generation**: Documentation is automatically generated from your Zod schemas using `zod-openapi`\n- **Type Safety**: Leverages TypeScript and Zod for type-safe API definitions\n- **Multiple Formats**: Generates both JSON and YAML formats for maximum compatibility\n- **Rich Descriptions**: Supports detailed descriptions, examples, and metadata for each endpoint\n\n#### Usage\n\n1. **Generate Documentation**: Run `npm run openapi` to generate the latest API documentation\n2. **View Documentation**: The generated files are saved in the `docs\u002Fopenapi\u002F` directory:\n   - `docs\u002Fopenapi\u002F\u003Cpackage-name>.openapi.json` - JSON format for programmatic use\n   - `docs\u002Fopenapi\u002F\u003Cpackage-name>.openapi.yaml` - YAML format for human readability\n\n3. **Schema Definitions**: API schemas are defined in `src\u002Fmodels\u002F` with OpenAPI extensions\n4. **Route Definitions**: OpenAPI route configurations are in `src\u002Fopenapi\u002Froutes\u002F`\n\n#### Example Schema Definition\n\n```typescript\nimport { z } from 'zod'\n\nexport const userSchema = z\n  .strictObject({\n    id: z.string().uuid(),\n    name: z.string().min(1).max(100),\n    email: z.string().email(),\n  })\n  .meta({\n    description: 'User object with basic information',\n    id: 'User'\n    example: {\n      id: '123e4567-e89b-12d3-a456-426614174000',\n      name: 'John Doe',\n      email: 'john.doe@example.com',\n    },\n  })\n```\n\nThe documentation can be viewed using any OpenAPI\u002FSwagger UI tool or integrated into your API gateway.\n\n### 🧪 Testing and Coverage\n\n- **Unit testing**: Powered by [vitest](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fvitest) and [supertest](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fsupertest)\n\n- **Code coverage**: Ensure high code quality and test coverage with Vitest’s built-in coverage reporting\n\n### ⚡ Performance Optimization\n\n- **Hot-reload**: Streamline development with automatic server reload using Node's native `--watch`\n\n### 🔑 Secrets Management\n\n- **Azure Key Vault Integration**: Securely manage secrets using [azure\u002Fidentity](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@azure\u002Fidentity) and [azure\u002Fkeyvault-secrets](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@azure\u002Fkeyvault-secrets)\n\n### 🐳 Deployment\n\n- **Docker support**: Containerization for easy deployment\n\n### 📚 Additional Libraries\n\n- **HTTP Status Codes**: Simplified status code management with [http-status-codes](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fhttp-status-codes)\n\n## 🚀 Getting Started\n\n1. Clone the repository\n   ```sh\n   git clone https:\u002F\u002Fgithub.com\u002FToniR7\u002Fexpress-typescript-starter.git\n   cd express-typescript-starter\n   ```\n2. Install dependecies: `npm install`\n3. Set up your environment variables (you can use the `.env.test` file as a reference to create your own `.env` file)\n4. Run the development server: `npm run dev`\n\n## 📦 Project Structure\n\n```\nproject-name\u002F\n│\n├── .github\u002F                  # GitHub configuration\n│   └── workflows\u002F            # GitHub Actions workflow definitions\n│       └── ci.yml            # CI pipeline (lint, security scan, typecheck, test)\n│\n├── .husky\u002F                   # Git hooks managed by Husky\n│   ├── pre-commit            # Pre-commit hook (tests, linting, audit, typecheck)\n│   └── commit-msg            # Commit message linting with commitlint\n│\n├── docs\u002F                     # Generated documentation\n│   └── openapi\u002F              # OpenAPI specification output directory\n│       ├── openapi.json      # OpenAPI specification in JSON format\n│       └── openapi.yaml      # OpenAPI specification in YAML format\n├── node_modules\u002F             # Installed dependencies\n│\n├── src\u002F                      # Source code\n│   ├── apis\u002F                 # Request handlers for different routes\n│   ├── environment\u002F          # Configuration and environment variable management\n│   ├── errors\u002F               # Custom errors definition\n│   ├── logger\u002F               # Logging utilities (Winston and Morgan)\n│   ├── middlewares\u002F          # Express middleware functions (authentication, validation, error handling, rate limit)\n│   ├── models\u002F               # Schemas definition (Zod schemas with OpenAPI extensions)\n│   ├── openapi\u002F              # OpenAPI documentation generation\n│   ├── routes\u002F               # API route definitions\n│   ├── typings\u002F              # TypeScript type definitions and interfaces\n│   ├── utils\u002F                # Utility functions and helper modules\n│   └── app.ts                # Entry point of the application, initializes the server\n│\n├── .commitlintrc             # Commitlint configuration (Conventional Commits)\n├── .dockerignore             # Files and directories to exclude from Docker builds\n├── .env                      # Environment variables (local development)\n├── .env.test                 # Example environment variables file (for documentation)\n├── .gitignore                # Files and directories to ignore in Git\n├── .lintstagedrc             # Configuration for lint-staged to run linting and formatting on staged files\n├── .npmrc                    # npm configuration\n├── .nvmrc                    # Specifies the Node.js version to use (for nvm compatibility)\n├── .oxfmtrc.json             # Oxfmt configuration file for code formatting\n├── .oxlintrc.json            # Oxlint configuration for linting the codebase\n├── Dockerfile                # Instructions to build a Docker image of the project\n├── LICENSE                   # Project license\n├── package-lock.json         # Lockfile for package versions\n├── package.json              # Project metadata, dependencies, and scripts\n├── README.md                 # Project documentation and setup instructions\n├── tsconfig.json             # TypeScript configuration for development and tooling\n├── vitest.config.ts          # Vitest configuration for running tests\n```\n\n## 🧩 Scripts\n\n### Test\n\n- `npm run test`: Runs Vitest tests. It will execute all the test cases written in the project without coverage reporting.\n- `npm run test:coverage`: Runs Vitest tests with coverage reporting. It generates a code coverage report showing which parts of the code are covered by tests.\n- `npm run test:watch`: Runs Vitest tests in watch mode. It watches for changes in the codebase and automatically reruns tests when files are modified.\n\n### Update\n\n- `npm run updates`: Runs npm-check-updates, a tool that checks for the latest versions of dependencies in the package.json and shows which packages can be updated.\n- `npm run updates:interactive`: Runs npm-check-updates in interactive mode, allowing you to select which packages to update.\n- `npm run updates:upgrade`: Automatically update the versions of dependencies in the package.json to the latest versions.\n\n### Dependencies\n\n- `npm run depcheck`: Runs depcheck, a tool that checks how each dependency is used, which dependencies are useless, and which dependencies are missing from package.json\n\n### Documentation\n\n- `npm run openapi`: Generates OpenAPI\u002FSwagger documentation from Zod schemas. Creates _openapi.json_ and _openapi.yaml_ files under _docs\u002Fopenapi\u002F_ containing the complete API specification that can be used with Swagger UI or other OpenAPI tools.\n\n### Linting and Formatting\n\n- `npm run lint`: Runs oxlint to check for issues in the code. It will output warnings and errors according to the rules defined in the oxlint configuration.\n- `npm run lint:fix`: Runs oxlint with the --fix flag, which automatically fixes any issues it can. It’s useful for cleaning up common problems.\n- `npm run format`: Runs oxfmt to format the code. It will rewrite the code to follow a consistent style, ensuring things like indentation and line breaks are uniform across the codebase.\n- `npm run format:check`: Runs oxfmt in check mode. It verifies that files conform to the formatting rules without modifying them, returning a non-zero exit code if differences are found (useful for CI pipelines).\n- `npm run lint-staged`: Runs lint-staged, which executes oxlint and oxfmt only on staged files according to the configuration in .lintstagedrc. This allows for faster pre-commit checks by only processing files that are about to be committed rather than the entire codebase.\n\n### Development\n\n- `npm run dev`: Runs the development server. This tool watches for changes in TypeScript files and automatically restarts the server.\n- `npm run debug`: Runs the server in debugging mode using the --inspect flag. This allows to attach a debugger to the Node.js process, enabling step-through debugging.\n\n### Type Checking\n\n- `npm run typecheck`: Runs the TypeScript compiler with `--noEmit` to check for type errors without producing output files.\n\n### Production\n\n- `npm run prod`: Runs the application directly with Node.js (using native TypeScript support). This script is for running the app in production.\n\n### Husky Prepare\n\n- `npm run prepare`: Runs the Husky setup. It prepares the Git hooks (like pre-commit and commit-msg hooks) by setting up the necessary files. This is typically used after installing or updating Husky.\n\n## 🔄 GitHub Workflows\n\nThis project includes a **CI Pipeline** (`.github\u002Fworkflows\u002Fci.yml`) that runs automatically on:\n\n- **Push** to `main` or `develop` branches\n- **Pull requests** targeting `main` or `develop` (on open and synchronize events)\n\n### Jobs\n\n| Job               | Description                                                                                                              |\n| ----------------- | ------------------------------------------------------------------------------------------------------------------------ |\n| **lint**          | Installs dependencies and runs `npm run lint` to check code quality with oxlint                                          |\n| **security-scan** | Runs [CodeQL](https:\u002F\u002Fgithub.com\u002Fgithub\u002Fcodeql-action) static analysis for TypeScript to detect security vulnerabilities |\n| **typecheck**     | Runs `npm typecheck` to ensure the codebase has no TypeScript type errors                                                |\n| **test**          | Runs `npm test` to execute the full test suite with Vitest                                                               |\n\nAll four jobs run **in parallel** since they have no dependencies on each other, providing fast feedback on pull requests.\n\n## 👊🏻 Contributing\n\nI welcome contributions through:\n\n- 🐛 Bug Reports\n- 💡 Feature Requests\n- 📚 Documentation Improvements\n- 🛠️ Code Contributions\n","ToniR7\u002Fexpress-typescript-starter 是一个为生产环境准备的 Node.js 项目模板，基于 TypeScript 6 和 Express 5 构建。该项目提供了一系列核心功能，包括高效安全的日志记录、请求参数验证、环境变量管理、全面的错误处理机制以及自动化的 OpenAPI\u002FSwagger 文档生成等。在安全性方面，它通过 CORS 保护、Helmet HTTP 头设置和速率限制来增强应用的安全性，并支持 JWT 认证以确保只有授权用户能够访问 API。此外，通过 oxfmt 和 oxlint 等工具保证了代码风格的一致性和质量，配合 Husky 实现了提交前的质量检查自动化。此模板非常适合用于需要快速搭建稳健且可扩展的后端服务场景中，特别是那些对安全性与代码质量有较高要求的项目。",2,"2026-06-11 04:07:26","CREATED_QUERY"]