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

rak

v0.5.1

Published

Opinionated skeleton to quickly set up a new React app.

Downloads

43

Readme

Build Status codecov Renovate

Rak (React App Kit) is an opinionated skeleton to quickly set up a project with React, Babel, Webpack & friends.

What's inside

Rak includes and configures the following components to help you build a rock-solid, scalable app with best practices and zero configuration.

Using it in a project

Rak requires Node 20. In addition, to use the automatic AWS deployment features, you'll need both an AWS account and a GitHub account.

Start a new Project with Rak by creating an empty directory and installing rak into it.

mkdir my-new-project
cd my-new-project

Next, run rak using npx. It doesn't take any arguments, and will set up a project using the name of the folder you created as the project name.

npx rak

You can also use the latest master version of rak by running:

npx bjacobel/rak

Some details about your newly created folder structure and dependencies will be printed while Rak is setting up. After it's done, commit your project to git:

git init && git add --all && git commit -m "Initial commit"

and start developing! Your next steps might include:

  • Configuring project information (like domain, name and analytics/error logging IDs) in ./config.js.
  • Pushing your repo to GitHub. (Public and private repos are supported.)
  • Setting up GitHub Actions for your repo.
    • Add your AWS_ACCESS_TOKEN_ID and AWS_SECRET_ACCESS_TOKEN to the Secrets for your repo at https://github.com/[username]/[repo]/settings/secrets
    • Also add other optional environment variables, like SENTRY_AUTH_TOKEN for deploy tracking and sourcemap support in Sentry.
  • Setting up Codecov for your repo.
    • Add a API key for Codecov to the Secrets for the repo as CODECOV_TOKEN
    • Coverage stats will be automatically uploaded, but you'll need to authorize Codecov against your GitHub account and add the app to the repo to get pull request comments with coverage information.
    • Make sure to update the badge at the top of the readme to point to your new Codecov SVG.
  • Updating the readme to remove all the stuff about the boilerplate and to say a bit about your new project.
  • Removing or modifying the example components and services to do... whatever your new app does.

Development

The offline-caching service worker doesn't play nicely with HMR or webpack-dev-werver, so it's disabled by default. To enable it, you can either build the site in production mode, or use the SW_ENABLE environment variable:

SW_ENABLE=true yarn webpack

You should see LOG from GenerateSW in the output. Don't use this option with WDS (yarn start); you'll kill your browser.

When building flat files locally, its important to serve them with a server that implements a correct 404 redirection behavior. Use:

npx http-server dist -a localhost --proxy http://localhost:8080\?

Deployment

Rak includes a CloudFormation template that can create & configure all the AWS resources it needs. You'll want to create the CloudFormation stack before you push to your master branch for the first time. To do that:

  1. Add AWS configuration to your environment. See the AWS doc on configuring the command-line interface.
  2. Add project configuration to ./config.js, including the name of your project and the domain it'll live at.
  3. Build your CloudFormation stack with yarn deploy-utils launch.

CloudFormation will create the following resources:

  • an S3 bucket to host static files
  • a CloudFront distribution to serve as a CDN
  • an AWS Certificate Manager SSL certificate, so the site can be served over HTTPS
  • A Route53 hosted domain, which contains DNS routes for your domain
  • A Route53 DNS record for your site
  • Another Route53 DNS record for www., if your site sits at a domain apex

This will take about 30 minutes. While it's going, leaving the yarn deploy-utils launch process running will tail CloudFormation events to your console. You can also log into the AWS Management Console to track the progress of your stack.

Once it's reached the CREATE_COMPLETE status:

  1. Get the nameservers (ns-xxx.awsdns-xxx.tld) for your new Route53 hosted zone, and point your domain to these nameservers in your registrar's DNS console. These changes may take a while to take effect.
  2. Push or merge your code to the master branch. GitHub Actions will test, lint, bundle and deploy your code to S3, and you should see it at your domain shortly.

Thanks to