GithubHelp home page GithubHelp logo

hartl3y94 / vueslsapp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thiroyoshi/vueslsapp

0.0 0.0 0.0 2.07 MB

This is the serverless application framework using Vue.js and Serverless Framework.

JavaScript 11.69% Python 39.52% HTML 2.02% Vue 46.77%

vueslsapp's Introduction

Vue + Serverless Framework App

Description

This is the serverless application framework using Vue.js and Serverless Framework.

You can build the application that you can ...

  • sign up
  • log in
  • register userinfo
  • change password
  • delete account
  • reset password
  • call REST API with authentication

Requirements

  • node.js
  • Vue.js
  • AWS CLI
  • python 3.7
  • Serverless Framework 1.6 >=

Building

This is the step of building the app at your local.

set up AWS account

  • sign up AWS
  • create AWS IAM user for building app and get access key and secret access key

get your domain, create Hosted zone and create a certificate

  • buy your own domain
    • you can buy it in Route53
  • create Hosted Zone in Route53
  • get Alias Hosted Zone ID
    • Not Hosted Zone ID
  • create a certificate in ACM
    • recommend to use DNS Confirmation

create User Pool and Identity Pool

  • create User Pool and Identity Pool for each env
  • copy ClientId, UserPoolId and IdentityPoolId to
    • for Vue : .env.xxx
    • for serverless : sls_configuration/config/xxx/cognito.yml

create Serverless Dashboard account and app

  • sign up serverless dashboard
  • create app in Serverless Dashboard
    • app name must be same as app in serverless.yml
  • get serverless access key

create a tracking ID of Google Analytics (optional)

  • create account and get tracking ID

set environment vars

  • set below vars to environment vars
    • AWS access key
    • AWS secret access key
    • AWS default region
    • Serverless Access key

set configurations

  • for client app

    • edit .env.XXX and set vars
      • NODE_ENV : for example, dev or prod
      • VUE_APP_API_ORIGIN : your custom domain name for REST API
      • VUE_APP_COGNITO_REGION : your region
      • VUE_APP_GOOGLE_ANALYTICS : optional, tracking Id
  • for backend(REST API)

    • sls_configuration/config/common.yml
      • edit and set below vars
        • ACCOUNT_ID : AWS Account ID
        • DOMAIN : your own domain name you bought
        • ALIAS_HOSTED_ZONEID : you can get this in Route53
        • ALIAS_DNS_NAME : you can get this in Route53
    • serverless.yml
      • you must decide and edit org, app, service
      • app must be same as app name you crated in Serverless Dashboard

install required softwares and libs

  • install required softwares
    • serverless framework
      npm install -g serverless
      
    • pip-tools
      pip install pip-tools
      
    • aws cli
      • ref: https://docs.aws.amazon.com/ja_jp/cli/latest/userguide/install-cliv2-windows.html
  • install libs
    • node modules
      npm install
      
    • python libs
      pip-compile requirements.in
      
      pip install -r requirements.txt -t pylibs
      

build app at local and deploy to AWS

  • build vue app
    • for Dev env
      npm run build-dev
      
    • for Prod env
      npm run build-prod
      
  • create custom domain for API Gateway
    sls create_domain
    
  • deploy serverless app
    sls deploy
    

Reference

vueslsapp's People

Contributors

thiroyoshi 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.