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

jaws-stack

v0.0.1

Published

The Javascript + AWS Web Application Boilerplate

Downloads

14

Readme

JAWS stack javascript aws node.js express auroradb dynamodb lambda

JAWS: The Javascript + AWS Stack

This stack uses new tools from Amazon Web Services to completely redefine how to build massively scalable (and cheap) web applications.

####Follow the "Installation Guide" in the Wiki to get started!

The Goals Of JAWS Are:
  • Use No Servers: Never deal with scaling/deploying/maintaing/monitoring servers again.
  • Isolated Components: The JAWS back-end is comprised entirely of AWS Lambda Functions. You can develop/update/configure each separately without affecting any other part of your application. Your app never goes down... only individual API routes can go down.
  • Scale Infinitely: A back-end comprised of Lambda functions comes with a ton of concurrency and you can easily enable multi-region redundancy.
  • Be Cheap As Possible: Lambda functions run only when they are called, and you only pay for when they are run.

##Architecture

JAWS stack diagram javascript aws node.js express auroradb dynamodb lambda

####API There are no servers are included in this stack. The entire back-end is comprised of Lambda functions which are organized in the api folder. Each of your API URLs points to one of these Lambda functions. This way, the code for each API Route is completely isolated, enabling you to develop/update/configure/deploy/maintain code for specific API urls at any time without affecting any other part of your application(!!!). Think of each Lambda function as a "Controller", in traditional MVC structure.

You can either use the AWS Management Console's API Gateway User Interface to create your API, or define your API in the api_swagger.json file and deploy instantly via AWS's Swagger Import Tool (Recommended).

####Lib The lib folder/module contains re-useable code you can use across all of your Lambda functions, which can be thought of as your "Models". It's an npm module that can be required into your Lambda functions, like any other.

Since Lambda can be slow to initialize on cold-starts (after ~5 mins of inactivity), this module is designed so that you do not have to require all of its code, but instead you can require in only the code that your Lambda function needs. For example:

// This only loads code needed for the User Model
var ModelUser = require('jaws-lib').models.User;

While developing, make sure you create an npm sym-link between this module and all of your Lambda functions. This way, all of the changes in the lib folder will be instantly available in every one of your Lambda functions when you run/test them locally. Check out the wiki for instructions.

####CLI This stack comes with its own command line interface to help you test your API Lambda Functions locally and deploy them. The commands are:

Run A Lambda Function Locally

Make sure you in the root folder of your Lambda function (api/users/signup) and enter this:

$ jaws run

Deploy A Lambda Function

Make sure you in the root folder of your Lambda function (api/users/signup) and enter this:

$ jaws deploy

Start A Local Server

Make sure you in thesite folder of the JAWS app and enter this:

$ jaws server

####Site Your website/client-side application. These assets can be uploaded and served from S3 for super fast response times.

##Roadmap

  • Incorporate the AWS API Gateway Swagger Import Tool
  • Write the swagger.json for the current API functions
  • Add Swagger import commands to the CLI
  • Add on to the site to use the API Routes, after they are deployed
  • Write a JAWS CLI command to build and deploy site assets
  • Write more API examples

##Starring

Javascript:

  • Node.js (in AWS Lambda functions)
  • jQuery (in your front-end site)

AWS Services:

  • DynamoDB - Managed, NOSQL data storage
  • Lambda - Build worker tasks that you can spawn and scale infinitely.
  • API Gateway - Launch an API with urls pointing to your Lambda functions
  • S3 - Host static assets for your site here

Other:

  • JSON Web Tokens

##Other