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 🙏

© 2024 – Pkg Stats / Ryan Hefner

broilerkit

v0.28.0

Published

Utility kit for Broilerplate, including helpers for quickly deploying scalable web apps to AWS cloud

Downloads

12

Readme

BroilerKit

BroilerKit is a framework for quickly developing web apps with modern technologies and deploying them to a scalable, production-ready environment! You can write both frontend and backend in TypeScript (powered by Webpack). You write your front-end with React framework, and server-side rendering (SSR) is supported by default!

You deploy your production-ready web app to Amazon Web Services cloud platform, with minimal setup and very low costs! The hosting is almost free (but not free) on low-traffic sites.

(Disclaimer: By using this utility you are taking the full responsibility for any incurring expenses.)

Feature highlights

  • Write all your code, both front-end and backend, in TypeScript
  • Easily create a full-featured REST API as your backend and database models
  • Your React-based front-end is rendered on server-side by default
  • Easily add the user log in to your app with Facebook and Google authentication
  • No server maintenance: everything will run on AWS platform serverless solutions

Other features

  • Lint your code style with ESLint
  • Polyfill Promise, Symbol and other ES6 features for browsers that do not support them
  • Automatically bundle any images from your HTML, Pug, or Markdown files.
  • Automatically optimize images losslessly for minimal size
  • Generate favicons and related asset files from a single icon image file, and insert references to the HTML pages
  • Refer to your current GIT version with __COMMIT_HASH__, __VERSION__ and __BRANCH__ constants

Deployment features

  • Host your backend on serverless AWS Lambda functions through AWS API Gateway
  • Deploy your compressed, production-ready React front-end to AWS platform, hosted on S3, served globally through CloudFront, and managed with CloudFormation
  • Server-side rendering of the React front-end
  • Make your app available on your custom domain (required)
  • Your app is served using HTTPS! Creation of required certificates are done automatically with Amazon Certificate Manager
  • Host static assets on separate cookieless domain with infinite caching, for maximum performance scoring and reliability
  • Separate stages for your releases, e.g. the production version (prod) and the development version (dev)

What do I need?

To use this utility, you need the following:

Command line tools

The BroilerKit contains a lot of command line utilities to initialize, deploy, manage and inspect your app! You can run these commands with npx. You can print out the help for the available commands:

$ npx broilerkit --help
broilerkit <command>

Commands:
  broilerkit init [directory]      Bootstrap your app with Broilerplate template.    [aliases: pull]
  broilerkit deploy <stage>        Deploy the web app for the given stage.
  broilerkit undeploy <stage>      Deletes the previously deployed web app.
  broilerkit logs <stage> [since]  Print app logs.
  broilerkit compile <stage>       Compile the web app.                             [aliases: build]
  broilerkit preview <stage>       Preview the changes that would be deployed.
  broilerkit describe <stage>      Describes the deployed resources.
  broilerkit serve [stage]         Run the local development server.
  broilerkit db <command>          Manage database tables

Options:
  --appConfigPath  Path to the app configuration                        [string] [default: "app.ts"]
  --debug          Compile assets for debugging                                            [boolean]
  --no-color       Print output without colors                                             [boolean]
  --help           Show help                                                               [boolean]
  --version        Show version number                                                     [boolean]

Creating a web app

To start developing a new web app, first create a GIT repository for it:

git init myapp
cd myapp

Then it is recommended that you apply the Broilerplate template to your project:

npx broilerkit init

If installing fails on OSX you may try to install libpng with Homebrew.

Configuring the app

Remember to add your project metadata to the package.json, for example, name, author, description.

You should change the configuration in app.ts according to your web app's needs.

  • name: A distinct name of your app. Recommended to be in lower case and separate words with dashes, because the name will be used in Amazon resource names and internal host names.
  • stages: Configuration for each different stage that your app has. By default there are dev stage for a development version and prod stage for the production version. You should change the serverRoot and assetsRoot to the domain names that you would like to use for each stage. There is also a special stage local that is used for the locally run development server.

Running locally

To run the app locally, start the local HTTP server and the build watch process:

npx broilerkit serve

Then navigate your browser to the website address as defined in your local stage configuration, which is http://localhost:1111/ by default!

The web page is automatically reloaded when the app is re-built.

Deployment

Prerequisities

Set up AWS credentials

First, create a user and an access key from AWS Identity and Access Management Console.

Then you need to set up your AWS credentials to your development machine. This can be done with aws-cli command line tool, which you may need to install first:

# Install if not already installed
pip install awscli
# Optional: enable command line completion
complete -C aws_completer aws
# Configure your credentials
aws configure

Running deployment

Deployments are run with the following command:

npx broilerkit deploy <stage>

For example, to deploy the development version to the dev stage:

npx broilerkit deploy dev

To deploy the production version to the prod stage:

npx broilerkit deploy prod

The deployment will build your app files, and then upload them to Amazon S3 buckets. It will also use CloudFormation to set up all the required backend, Lambda functions, databases, SSL certificates, etc.

The assets (JavaScript, CSS, images) are uploaded with their names containing hashes, so they won't conflict with existing files. They will be cached infinitely with HTTP headers for maximum performance. The uploaded HTML files are cached for a shorter time.