GithubHelp home page GithubHelp logo

buildor-pages-rs's Introduction

Buildor Pages

Requirements

  • AWS Profile (tested with Admin privileges)
  • NodeJS: ^16.16
  • Rust
    • cargo: 1.61
    • rustup: 1.24.3

Usage

Dependencies

$ npm install
$ rustup target add x86_64-unknown-linux-gnu
$ cargo install cargo-lambda --version=0.9.0

Compile Rust code:

$ npm run build:lambdas

Infrastructure

  1. Prepare env vars:

    $ cp .example.env .env
    # Update values in .env
    $ source .env
  2. (First time action) Bootstrap AWS environment:

    $ npm run cdk -- bootstrap aws://$AWS_ACCOUNT/$AWS_REGION --toolkit-stack-name $(echo $APP_PREFIX)Toolkit --profile <name>
  3. Deploy Tables:

    $ npm run cdk -- deploy $(echo $APP_PREFIX)TablesStack --toolkit-stack-name $(echo $APP_PREFIX)Toolkit --profile <name>
  4. Resources to automatically deploy SPAs:

    $ npm run cdk -- deploy $(echo $APP_PREFIX)DeployStack --toolkit-stack-name $(echo $APP_PREFIX)Toolkit --profile <name>
  5. Deploy API:

    $ npm run cdk -- deploy $(echo $APP_PREFIX)APIStack --require-approval never --toolkit-stack-name $(echo $APP_PREFIX)Toolkit --profile <name>
    $ npm run cdk -- deploy $(echo $APP_PREFIX)APIUsersStack --force --require-approval never --toolkit-stack-name $(echo $APP_PREFIX)Toolkit --profile <name>
    $ npm run cdk -- deploy $(echo $APP_PREFIX)APIProjectsStack --force --require-approval never --toolkit-stack-name $(echo $APP_PREFIX)Toolkit --profile <name>
    $ npm run cdk -- deploy $(echo $APP_PREFIX)APIDeploymentStack --require-approval never --toolkit-stack-name $(echo $APP_PREFIX)Toolkit --profile <name>
  6. Test API Endpoints:

Once the APIDeploymentStack is deployed, you should be able to see the API URL in the command logs. Use that URL in the following commands:

# List users
$ curl -vvv <API_URL>/users

# Register a new user
$ curl -vvv <API_URL>/users -d '{"fname": "John", "lname": "Doe"}'

Clean Up

$ npm run cdk -- destroy --force $(echo $APP_PREFIX)APIProjectsStack --toolkit-stack-name $(echo $APP_PREFIX)Toolkit --profile <name>
$ npm run cdk -- destroy --force $(echo $APP_PREFIX)APIUsersStack --toolkit-stack-name $(echo $APP_PREFIX)Toolkit --profile <name>
$ npm run cdk -- destroy --force $(echo $APP_PREFIX)APIStack --toolkit-stack-name $(echo $APP_PREFIX)Toolkit --profile <name>
$ npm run cdk -- destroy --force $(echo $APP_PREFIX)DeployStack --toolkit-stack-name $(echo $APP_PREFIX)Toolkit --profile <name>
$ npm run cdk -- destroy --force $(echo $APP_PREFIX)TablesStack --toolkit-stack-name $(echo $APP_PREFIX)Toolkit --profile <name>

buildor-pages-rs's People

Contributors

ccddan avatar

Watchers

 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.