express-typescript-api-best-practices

Scaffold Express and TypeScript REST APIs with layered architecture and JWT authentication.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/MILLERMARRU/express-typescript-api-best-practices --skill express-typescript-api-best-practices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: express-typescript-api-best-practices
Source: https://github.com/MILLERMARRU/express-typescript-api-best-practices/tree/main
Command: npx skills add https://github.com/MILLERMARRU/express-typescript-api-best-practices --skill express-typescript-api-best-practices

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance for building enterprise-grade REST APIs using Express.js and TypeScript, emphasizing SOLID principles, layered architecture, and scalable, secure patterns.

Core Features & Use Cases

  • Layered architecture (Routes → Controllers → Services → Models) for maintainability and testability
  • JWT authentication, Argon2 password hashing, RBAC with role-based access control
  • Validation with Zod, OpenAPI/Swagger documentation, and standardized error handling
  • Transaction management patterns and performance best practices for production-scale APIs

Quick Start

Use the express-typescript-api-best-practices skill to scaffold or refactor REST API endpoints with enterprise-grade patterns.

Frequently Asked Questions about express-typescript-api-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a production-ready REST API with Express and TypeScript?

Build production-ready REST APIs using Express and TypeScript by implementing a layered architecture (Routes → Controllers → Services → Models) with SOLID principles, JWT authentication, Zod validation, Argon2 password hashing, and OpenAPI/Swagger documentation for enterprise-grade scalability and security.

What's the best way to structure role-based access control in an Express API?

Implement RBAC in Express by combining JWT tokens with role-based middleware in your controller layer, validating permissions before service execution, and documenting access policies in OpenAPI specs for consistent enforcement across all endpoints.

How do I validate request data and document API endpoints with OpenAPI?

Validate requests using Zod schemas in your controller layer, then generate OpenAPI/Swagger documentation from those schemas and endpoint definitions to create both runtime validation and comprehensive API documentation automatically.

Can I use Sequelize with a layered architecture for database transactions?

Yes. Sequelize integrates into the Models layer of a layered architecture, enabling transaction management patterns and performance optimization while keeping database logic separate from business logic in Services.

What are the limitations of JWT authentication for APIs?

JWT tokens are stateless but cannot be revoked mid-session without external state stores. Pair JWT with short expiration windows, refresh token rotation, and role-based validation in middleware to mitigate token compromise and enforce access policies in production.

Do I need TypeScript to implement these enterprise API patterns?

TypeScript is not strictly required but provides type safety that catches validation and schema errors at compile time, reducing runtime failures and making layered architecture contracts (between Routes, Controllers, Services) explicit and verifiable.