npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

create-hexa-framework-app

v2.1.9

Published

Create Hexa Framework project with customizable templates, databases, and transport layers. Includes powerful CLI like Laravel Artisan!

Readme

🚀 create-hexa-framework-app

npm version npm downloads License: MIT TypeScript Node.js

The most productive way to build TypeScript APIs with hexagonal architecture

Quick StartCLI GuideRelease NotesChangelog


Scaffold Hexa Framework projects with powerful CLI tools similar to Laravel Artisan! Generate complete CRUD systems in seconds, manage databases, and boost your productivity by 600x. ⚡

✨ What's New in v2.1.1

🔥 Hexa CLI - Powerful Development Tools!

Generate complete CRUD systems in seconds:

# Create a new project
npx create-hexa-framework-app my-api

# Generate complete CRUD with 7 files + Prisma model
cd my-api
npm run hexa generate crud Product -- --fields "name:string,price:number,stock:number"

# Output:
# ✔ Entity generated
# ✔ Repository generated
# ✔ Service generated
# ✔ Controller generated
# ✔ Router generated
# ✔ Validation schemas generated
# ✔ Prisma model generated

📖 Read Full CLI Documentation

📦 Installation

Using npx (Recommended)

npx create-hexa-framework-app my-api

Global Installation

npm install -g create-hexa-framework-app
create-hexa-framework-app my-api

🎯 Usage

Interactive Mode

npx create-hexa-framework-app

Akan muncul prompt:

? Enter project name: my-blog-api
? Select template: (Use arrow keys)
  ❯ Full Auth - JWT + Refresh Token with Express
    Basic Auth - Simple JWT Auth
    Empty - Blank Hexa project

Direct Mode

npx create-hexa-framework-app my-blog-api --template full-auth --database postgresql --transports rest,graphql

With CLI Commands

After creating your project:

cd my-blog-api
npm run hexa list              # Show all commands
npm run hexa generate crud Post   # Generate CRUD
npm run hexa db migrate        # Run migrations
npm run hexa serve             # Start dev server

📂 Generated Project Structure

my-blog-api/
├── src/
│   ├── core/                    # Domain Layer
│   │   ├── entities/            # Domain entities
│   │   ├── repositories/        # Repository interfaces
│   │   └── services/            # Business services
│   ├── adapters/                # Infrastructure Layer
│   │   └── postgres/
│   │       └── repositories/    # Prisma implementations
│   ├── transports/              # Presentation Layer
│   │   └── api/
│   │       ├── controllers/     # REST controllers
│   │       ├── routers/         # Express routers
│   │       │   └── v1/
│   │       └── validations/     # Zod schemas
│   ├── policies/                # Authorization
│   │   ├── authMiddleware.ts
│   │   └── permissionMiddleware.ts
│   ├── mappers/                 # Data transformation
│   │   └── response/
│   └── configs/                 # Configuration
│       ├── database.ts
│       └── env.ts
├── prisma/
│   └── schema.prisma            # Database schema
├── .env.example                 # Environment template
├── .gitignore
├── package.json
├── tsconfig.json
└── README.md

⚙️ What's Included

Dependencies

  • @hexa-framework/core - Base classes dan utilities
  • express - Web framework
  • @prisma/client - Database ORM
  • zod - Schema validation
  • jsonwebtoken - JWT authentication
  • bcrypt - Password hashing
  • helmet - Security headers
  • cors - CORS middleware
  • express-rate-limit - Rate limiting
  • winston - Logging
  • dotenv - Environment variables

Dev Dependencies

  • TypeScript - Type safety
  • ts-node-dev - Development server
  • @types/ - Type definitions
  • prisma - Database migrations
  • eslint - Code linting
  • prettier - Code formatting

Scripts

{
  "dev": "ts-node-dev --respawn src/index.ts",
  "build": "tsc",
  "start": "node dist/index.js",
  "prisma:generate": "prisma generate",
  "prisma:migrate": "prisma migrate dev",
  "prisma:studio": "prisma studio"
}

🚀 Next Steps

After creating your project:

1. Navigate to Project

cd my-blog-api

2. Configure Environment

Copy and edit .env:

copy .env.example .env

Edit .env:

NODE_ENV=development
PORT=3000
DATABASE_URL="postgresql://user:password@localhost:5432/mydb"
JWT_SECRET=your-super-secret-key-change-this
CORS_ORIGIN=http://localhost:3000

3. Setup Database

npx prisma generate
npx prisma migrate dev --name init

4. Generate Your First Resource

Install CLI:

npm install -g @hexa-framework/cli

Generate resource:

hexa generate resource post

This creates:

  • src/core/entities/post.entity.ts
  • src/core/repositories/post.repository.ts
  • src/core/services/post.service.ts
  • src/adapters/postgres/repositories/post.repository.adapter.ts
  • src/transports/api/controllers/post.controller.ts
  • src/transports/api/routers/v1/post.router.ts
  • src/transports/api/validations/post.validation.ts
  • src/mappers/response/post.mapper.ts

5. Run Development Server

npm run dev

Server akan running di http://localhost:3000

6. Test API

# Health check
curl http://localhost:3000/health

# Your resources (jika sudah generate)
curl http://localhost:3000/api/v1/posts

📚 Documentation

Dokumentasi lengkap tersedia di:

🤝 Contributing

Contributions are welcome! Please check our Contributing Guide.

📄 License

MIT © lutfian.rhdn

🔗 Links


Made with ❤️ by lutfian.rhdn