Giter VIP home page Giter VIP logo

dawson-cli's Introduction

dawson

npm version Build Status npm dependencies Coverage Status

dawson is a serverless web framework for Node.js on AWS (CloudFormation, CloudFront, API Gateway, Lambda).
You can use dawson to build and deploy backend code and infrastructure for single-page apps + API, pure APIs or server-rendered pages.

// api.js

import pug from 'pug';
const template = pug.compileFile('template.pug');

export async function greet (event) {
    const name = event.params.path.name
    const age = await getUserAge(name);
    return template({ name, age });
}
greet.api = {
    path: 'greet/{name}'
}
$ npm install -g dawson
$ export AWS_REGION=... AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=...
$ dawson deploy

Documentation

Getting Started Guide, API & CLI Documentation

Examples

Examples & Reference Apps

About

dawson lets you to deploy your serverless Node.js apps on Amazon Web Services. It requires no boilerplate, no init command and no configuration files. Just write your functions and deploy!

You can write your functions using the latest JavaScript version (babel-preset-latest), including async-await, object-rest-spread etc. Functions can be async and can return Promises. There's also built-in authorization support via API Gateway Custom Authorizers.

Each function has its own IAM Execution Role, so you can define fine-graned IAM Policies.
dawson offers first-class support for Single Page Applications: a CloudFront Distribution will be deployed in front of your app, correctly mapping assets and the API origin, so you don't have to worry about CORS. An AWS WAF WebACL can also be attached to CloudFront.

dawson does not bundle your app with webpack, browserify or rollup, so you'll never have to deal with weird things. Your app's devDependencies are stripped out while deploying, keeping the bundle ZIP small.

dawson uses pure CloudFormation templates, following the infrastructure-as-code principle; it requires no local or remote state files which may go out-of-sync or mistakenly be deleted. You can customize your app's template in every part, e.g.: you can add CloudFormation Resources, modify Properties of Resources created by dawson etc. As a free benefit, you get out-of-the-box support for multiple stages and regions.

Finally, dawson will automatically support HTTPS for custom domains thanks to AWS ACM. Also, if you use Route53 your DNS Zone can be automatically updated.

CLI

Using the dawson command you can deploy the infrastructure, inspect logs (in real time, like tail -f) and spin up a full development server so you can run your all locally in an environment will be almost identical to production's. The development server can also run functions locally in response to real AWS Events (S3 Events, DynamoDB Triggers etc.).

$ dawson deploy # deploy your app
$ dawson log -f functionName --follow # get function logs
$ dawson describe # list CloudFormation outputs
$ dawson dev # start a development server

Architecture

https://raw.githubusercontent.com/dawson-org/dawson-cli/images/architecture.png

(additionally for each region you'll deploy to, dawson uses a support stack with an S3 Bucket to store Lambda ZIP bundles and CloudFormation templates)

Changelog

A changelog is maintained in the Releases page.

Contributing

js-semistandard-style
Any contribution is very welcome! You may pick an Issue, fork and start working on that. Should you need any guidance or help please ask :)

We are currently testing only functions that are involved in the Template generation.

Simone Lusenti
Simone Lusenti

๐Ÿ’ป ๐Ÿš‡ ๐Ÿ“– โš ๏ธ ๐Ÿ’ก
Giacomo Consonni
Giacomo Consonni

๐Ÿ’ป
Luca Casartelli
Luca Casartelli

๐Ÿ’ป ๐Ÿ“–

Support

In case you have an issue, make sure you have updated to the latest version (e.g.: npm i dawson@latest), then:

  • search / post on StackOverflow using the dawson tag
  • search / open an issue in this repo
  • contact me on Twitter @Lanzone31

Related

License

Copyright (C) 2016  Simone Lusenti

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

dawson-cli's People

Contributors

giaco9 avatar greenkeeper[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.