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

@denispro2006/duke-storage

v1.0.0

Published

Stateless file storage microservice for the Duke Messenger platform

Downloads

126

Readme

duke-storage

Stateless file storage microservice for the Duke Messenger platform. Abstracts over multiple storage backends behind a single REST API with file validation, metadata persistence, and streaming delivery.

Quick Start

# 1. Install dependencies
cd duke-storage
npm install

# 2. Configure environment
cp .env.example .env
# Edit .env — at minimum set STORAGE_BACKEND and DATABASE_URL

# 3. Run database migration (if using PostgreSQL)
psql $DATABASE_URL -f docs/migration.sql

# 4. Start the service
npm run dev

Service starts on http://localhost:3001 by default.

Docker Compose

cp .env.example .env
docker compose up -d
curl http://localhost:3001/healthz

Architecture

Client
  │ HTTP REST
  ▼
API Layer (Express + multer)
  │ Auth middleware → Validation → Controller
  ▼
Storage Adapter (StorageProvider interface)
  ├── LocalStorage  (dev / single-node)
  └── MinioStorage  (production / multi-node)

Metadata Store (PostgreSQL)

API

| Method | Path | Description | |--------|------|-------------| | POST | /upload | Upload a file (multipart/form-data) | | GET | /files/:id/:filename | Download / stream a file | | GET | /files/:id/meta | Get file metadata | | DELETE | /files/:id | Delete a file | | GET | /buckets/:bucket/files | List files in a bucket | | GET | /healthz | Health check (no auth) |

See docs/api.md for the full reference.

Storage Backends

| Backend | STORAGE_BACKEND | Use case | |---------|------------------|----------| | Local Disk | local | Development, single-node | | MinIO | minio | Production, multi-node |

Environment Variables

Copy .env.example to .env. Key variables:

STORAGE_BACKEND=local          # or minio
DATABASE_URL=postgres://...    # PostgreSQL connection string
JWT_SECRET=your-secret         # for token verification
MAX_FILE_SIZE=52428800         # 50 MB default
ALLOWED_MIME_TYPES=image/,video/,audio/,application/pdf

Scripts

npm start          # Production
npm run dev        # Hot reload (nodemon)
npm test           # All tests
npm run test:unit  # Unit tests only

License

MIT © duke-messenger contributors