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

content-workers-node-starter

v1.0.0

Published

Content Workers Node.js starter template - Production-ready traditional server deployment

Readme

Content Workers Node.js Starter

Production-ready Node.js starter template for Content Workers CMS
Traditional server deployment with full Node.js ecosystem support and enterprise-grade features.

Node.js TypeScript License

🚀 Quick Start

# 1. Complete setup (dependencies, keys, migrations)
npm run setup

# 2. Start development server
npm run dev

# 3. Open admin interface
open http://localhost:6545/admin

That's it! Your Content Workers CMS is ready to use.

✨ What's Included

🏗️ Core Architecture

  • Node.js Adapter - Traditional server deployment with clustering support
  • SQLite/PostgreSQL - Flexible database options (SQLite for dev, PostgreSQL for prod)
  • TypeScript - Full type safety with modern ES modules
  • Hot Reload - Instant development feedback with nodemon

📦 Built-in Features

  • Content Management - Pages and blogs with translations and revisions
  • Admin Interface - Full-featured CMS admin panel
  • Media Library - Image processing and file management
  • User Management - Role-based permissions and authentication
  • API Server - RESTful API with automatic documentation

🔧 Production Ready

  • Docker Support - Multi-stage builds with health checks
  • PM2 Integration - Process management and clustering
  • Environment Management - Separate dev/prod configurations
  • Security - Automatic key generation and secure defaults
  • Monitoring - Logging, health checks, and metrics
  • Backup System - Automated database and file backups

📋 Project Structure

content-workers-node-starter/
├── 📁 src/
│   └── 📁 collections/          # Content type definitions
│       ├── pages.ts             # Website pages
│       └── blogs.ts             # Blog posts
├── 📁 scripts/                  # Automation scripts
│   ├── setup.js                 # Complete project setup
│   ├── generate-keys.js         # Security key generation
│   └── deploy.js                # Production deployment
├── 📁 logs/                     # Application logs
├── 📁 data/                     # SQLite database files
├── 📁 uploads/                  # Media uploads
├── 📁 backups/                  # Automated backups
├── 🔧 cw.config.ts              # Main configuration
├── 🔧 tsconfig.json             # TypeScript configuration
├── 🐳 Dockerfile                # Docker container setup
├── 🐳 docker-compose.yml        # Multi-service orchestration
├── ⚡ ecosystem.config.js       # PM2 process management
├── 🔐 .env.example              # Environment template
├── 🔐 .env.production           # Production environment template
└── 📖 README.md                 # This documentation

🔧 Configuration Options

🗄️ Database Configuration

SQLite (Default - Zero Setup)

// Automatic - no configuration needed
// Perfect for development and small deployments
// Database file: content-workers.sqlite

PostgreSQL (Production Recommended)

# Add to .env
DATABASE_URL=postgres://user:pass@localhost:5432/content_workers
DATABASE_SSL=true

🔐 Authentication Plugins

GitHub OAuth

npm install @content-workers/auth-github
# Add to .env
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret

Google OAuth

npm install @content-workers/auth-google
# Add to .env
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret

📧 Email Services

Resend (Recommended)

npm install @content-workers/plugin-resend
# Add to .env
RESEND_API_KEY=your_resend_api_key
RESEND_WEBHOOK_SECRET=your_webhook_secret

SMTP (Nodemailer)

npm install @content-workers/plugin-nodemailer
# Add to .env
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
[email protected]
SMTP_PASS=your_app_password
SMTP_SECURE=false

💾 Storage & Caching

Redis Cache

npm install @content-workers/plugin-redis
# Add to .env
REDIS_CONNECTION=redis://localhost:6379
REDIS_PASSWORD=your_redis_password

S3-Compatible Storage

npm install @content-workers/plugin-s3
# Add to .env
S3_ACCESS_KEY=your_access_key
S3_SECRET_KEY=your_secret_key
S3_BUCKET=your-bucket-name
S3_REGION=us-east-1
S3_ENDPOINT=https://s3.amazonaws.com

🛠️ Development Commands

# 🚀 Development
npm run dev                    # Start development server
npm run dev:hot               # Start with hot reload (watches all files)
npm run type-check            # TypeScript type checking

# 🏗️ Building
npm run build                 # Build for production
npm run start                 # Start production server
npm run start:prod           # Start with production environment

# 🗄️ Database
npm run migrate              # Run database migrations
npm run migrate:rollback     # Rollback last migration
npm run migrate:reset        # Reset all migrations
npm run migrate:fresh        # Reset and re-run all migrations

# 🔐 Security
npm run generate-keys        # Generate security keys
npm run setup               # Complete project setup

# 🧹 Maintenance
npm run clean               # Clean build artifacts and logs
npm run backup              # Create database and file backup
npm run restore             # Restore from backup

🚀 Deployment Options

🐳 Docker Deployment (Recommended)

Single Container

# Build and run
npm run docker:build
npm run docker:run

# Or use deployment script
npm run deploy:docker

Docker Compose (Full Stack)

# Start all services (app + postgres + redis + nginx)
npm run docker:compose

# Development mode
npm run docker:compose:dev

PM2 Deployment (Traditional)

# Install PM2 globally
npm install -g pm2

# Deploy with PM2
npm run deploy

# Or manual PM2 commands
npm run pm2:start           # Start application
npm run pm2:stop            # Stop application
npm run pm2:restart         # Restart application
npm run pm2:logs            # View logs

🌐 Manual Deployment

# 1. Build application
npm run build

# 2. Set production environment
export NODE_ENV=production

# 3. Run migrations
npm run migrate

# 4. Start server
npm start

🔍 Advanced Features

📊 Monitoring & Logging

  • Health Checks - Built-in health endpoints for load balancers
  • Structured Logging - JSON logs with request tracing
  • PM2 Monitoring - Process monitoring and automatic restarts
  • Docker Health Checks - Container health monitoring

🔒 Security Features

  • Automatic Key Generation - Cryptographically secure keys
  • Environment Validation - Zod schema validation for all env vars
  • Secure Defaults - Production-ready security configuration
  • SSL Support - HTTPS configuration for production

📈 Performance Optimization

  • Clustering - Multi-core CPU utilization with PM2
  • Caching - Redis integration for session and data caching
  • Database Optimization - Connection pooling and query optimization
  • Static Asset Serving - Efficient file serving with proper headers

🔄 DevOps Integration

  • CI/CD Ready - GitHub Actions, GitLab CI, Jenkins compatible
  • Environment Management - Separate dev/staging/prod configurations
  • Backup Automation - Scheduled database and file backups
  • Zero-Downtime Deployment - Rolling updates with PM2

🆚 When to Choose This Starter

Perfect For:

  • Enterprise Applications - Need full Node.js ecosystem access
  • Complex Business Logic - Server-side processing and integrations
  • Traditional Infrastructure - VPS, dedicated servers, on-premise
  • File System Operations - Local file processing and storage
  • Maximum Flexibility - Custom plugins and extensive customization

🤔 Consider Alternatives If:

📚 Documentation & Resources

📖 Official Documentation

🎓 Learning Resources

🤝 Community & Support

🏆 Production Checklist

Before deploying to production, ensure you have:

  • [ ] Security Keys - Generated unique production keys (not development keys)
  • [ ] Database - Configured PostgreSQL for production (not SQLite)
  • [ ] Environment Variables - Set all required production environment variables
  • [ ] SSL Certificate - Configured HTTPS with valid SSL certificate
  • [ ] Reverse Proxy - Set up nginx or similar for load balancing
  • [ ] Monitoring - Configured logging, metrics, and alerting
  • [ ] Backups - Set up automated database and file backups
  • [ ] Domain - Configured custom domain and DNS
  • [ ] CDN - Set up CDN for static assets (optional but recommended)
  • [ ] Error Tracking - Integrated error tracking service (Sentry, etc.)

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🚀 Ready to build something amazing?

Get StartedView DocumentationJoin Community

Built with ❤️ by the Content Workers team