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

@1fe/starter-app

v0.0.4

Published

A production-ready template for creating your own 1fe instance. This application serves as both the reference implementation powering [demo.1fe.com](https://demo.1fe.com) and as the git template used by `create-1fe-app`.

Downloads

19

Readme

1fe Starter App 🚀

A production-ready template for creating your own 1fe instance. This application serves as both the reference implementation powering demo.1fe.com and as the git template used by create-1fe-app.

🎯 What is this?

This starter app demonstrates how to build a complete 1fe instance using @1fe/server and @1fe/shell. It includes:

  • Examples for live configurations for live configurations, CSP settings, and environment management
  • Two environments: Integration and Production setups
  • Example widgets and plugin integrations

📋 Prerequisites

  • Node.js >= 22
  • Yarn (package manager)

🚀 Quick Start

1. Using create-1fe-app (Recommended)

npx @1fe/create-1fe-app my-1fe-app
cd my-1fe-app
yarn install
yarn dev

2. Access Your Application by going to http://localhost:3001

📦 Project Structure

src/
├── configs/
│   ├── ecosystem-configs.ts    # Live configurations
│   ├── critical-libs.ts        # Critical library URLs
│   └── env.ts                  # Environment configuration
├── csp-configs.ts              # Content Security Policy settings
├── server.ts                   # Express server setup
├── shell/                      # Shell components and utilities
└── public/                     # Static assets

⚙️ Configuration

Environment Variables

Create a .env file based on .env.example:

| Variable | Description | Default | | --------------------- | ---------------- | ------------- | | PORT | Server port | 3001 | | NODE_ENV | Environment mode | development | | SERVER_BUILD_NUMBER | Build identifier | local |

Live Configurations

Update src/configs/ecosystem-configs.ts to point to your CDN:

export const configManagement: OneFEConfigManagement = {
  widgetVersions: {
    url: 'https://your-cdn.com/configs/widget-versions.json',
  },
  libraryVersions: {
    url: 'https://your-cdn.com/configs/lib-versions.json',
  },
  dynamicConfigs: {
    url: 'https://your-cdn.com/configs/live.json',
  },
  refreshMs: 30 * 1000,
};

CSP Configuration

Modify src/csp-configs.ts to allow your CDN domains:

export const cspConfigs = {
  'script-src': [
    "'self'",
    "'unsafe-inline'",
    'https://your-cdn.com',
    // ... other sources
  ],
  // ... other CSP directives
};

🛠️ Development Commands

# Start development server (client + server)
yarn dev

# Build for production
yarn build

# Start production server
yarn start

# Run tests
yarn test

# Type checking
yarn typecheck

# Linting
yarn lint

🌍 Deployment

This starter app can be deployed to any platform that supports Node.js applications:

Deploy to Render

Deploy to Render

Deploy to Heroku

Deploy to Heroku

Deploy to Vercel

yarn global add vercel
vercel --prod

Deploy to Railway

yarn global add @railway/cli
railway deploy

Deploy to AWS/Azure/GCP

Follow the respective platform documentation for Node.js applications. The built application is a standard Express.js server.

🔗 Widget Integration

Adding New Widgets

  1. Build your widget using 1fe-widget-starter-kit
  2. Deploy widget assets to your CDN
  3. Update widget-versions.json with your widget's information
  4. Configure the widget in your live.json file
  5. Update CSP settings if needed for new domains

Example Widget Configuration

// In your live.json
{
  "widgets": {
    "basePrefix": "https://your-cdn.com/widgets/",
    "configs": [
      {
        "widgetId": "@your-org/your-widget",
        "plugin": {
          "enabled": true,
          "route": "/your-widget"
        }
      }
    ]
  }
}

🔧 Customization

Branding & Styling

  • Update src/shell/components/ for custom layout components
  • Modify CSS variables in your shell styles
  • Replace favicon and other assets in src/public/

Adding Custom Utilities

  • Extend the shell utilities in src/shell/utils/
  • Update the platform props interface
  • Ensure new utilities are available to widgets via the sandbox

Environment-Specific Configuration

  • Create environment-specific config files
  • Use environment variables for sensitive data
  • Set up different CDN endpoints per environment

🤝 Related Projects

📖 Documentation

🐛 Troubleshooting

Common Issues

CSP Errors: Make sure your CDN domains are added to csp-configs.ts Widget Loading Failures: Verify your live configurations are accessible and valid Build Errors: Ensure all dependencies are installed and Node.js version is >= 22

Getting Help

📄 License

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


Ready to build your 1fe instance? Check out our comprehensive documentation or explore the live demo!