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 🙏

© 2026 – Pkg Stats / Ryan Hefner

gravito-ddd-starter

v1.0.0

Published

Clean Gravito DDD starter template - Generate your own modules with the CLI

Readme

Gravito DDD Starter Template

🚀 Clean, minimal Gravito DDD project starter with automated module generation via CLI.

Quick Start

1. Clone and Install

git clone https://github.com/gravito-framework/gravito-ddd-starter my-app
cd my-app
bun install

2. Start Development Server

bun run dev
# Server running on http://localhost:3000

3. Generate Your First Module

# Install the CLI
bun add -D @gravito/pulse

# Generate a module
bun gravito module generate Payment --ddd-type advanced

# ✅ Automatic:
#    - Complete DDD layer structure
#    - Event sourcing setup (if advanced)
#    - Route integration
#    - Test files

Project Structure

my-app/
├── src/
│   ├── Modules/              # Your DDD modules (auto-generated)
│   │   └── [Generated]/
│   │       ├── Domain/       # Business logic
│   │       ├── Application/  # Use cases
│   │       ├── Presentation/ # HTTP handlers
│   │       └── Infrastructure/ # Implementations
│   ├── routes.ts             # Route registry
│   ├── bootstrap.ts          # Framework configuration
│   └── index.ts              # Application entry
├── config/                   # Configuration
│   ├── app.ts
│   ├── database.ts
│   ├── cache.ts
│   └── index.ts
├── tests/                    # Test files
├── package.json
├── tsconfig.json
└── biome.json

Available CLI Commands

Generate Modules

# Simple CRUD module
bun gravito module generate User --ddd-type simple

# Event Sourcing module
bun gravito module generate Order --ddd-type advanced

# CQRS Read-side module
bun gravito module generate OrderStatistics \
  --ddd-type cqrs-query \
  --subscribes-to OrderCreated,OrderCompleted

Available Options

| Option | Values | Description | |--------|--------|-------------| | --ddd-type | simple, advanced, cqrs-query | Module type | | --subscribes-to | Event names | Events to subscribe to | | --depends-on | Module names | Module dependencies | | --skip-tests | flag | Skip test generation | | --skip-route-integration | flag | Skip route integration |

Development Workflow

# 1. Generate modules as needed
bun gravito module generate Payment
bun gravito module generate Order
bun gravito module generate WalletBalance --ddd-type cqrs-query

# 2. Run tests
bun test

# 3. Start development
bun run dev

# 4. Build for production
bun run build

# 5. Run production build
bun start

Available Scripts

bun run dev              # Development server (hot-reload)
bun run build            # Build for production
bun run start            # Run production build
bun test                 # Run all tests
bun test --watch         # Watch mode
bun run typecheck        # TypeScript type checking
bun run lint             # Lint code with Biome
bun run format           # Format code with Biome

Environment Configuration

Create .env from .env.example:

# Application
PORT=3000
APP_NAME=my-app
APP_ENV=development
APP_DEBUG=true
APP_URL=http://localhost:3000

# Database (optional)
ENABLE_DB=true
DB_CONNECTION=sqlite
DB_DATABASE=database/database.sqlite

# Cache & Redis (optional)
CACHE_DRIVER=memory
REDIS_HOST=127.0.0.1
REDIS_PORT=6379

Next Steps

  1. Generate your first module

    bun gravito module generate User --ddd-type simple
  2. Implement business logic in the Domain layer

  3. Run tests

    bun test
  4. Deploy - Build and run bun start

Architecture

This starter uses Domain-Driven Design (DDD) with:

  • 4-Layer Architecture: Domain → Application → Presentation → Infrastructure
  • DDD Patterns: Aggregates, Value Objects, Domain Services, Repositories
  • Event Sourcing (optional): Event-based state management
  • CQRS (optional): Separate read and write models
  • TDD: Comprehensive test generation

Documentation

License

MIT

Support


Happy coding! 🎉