Apache License 2.0

项目介绍

amazon-archives/aws-amplify-vue 是一个托管在 GitHub 上的开源项目,主要使用 JavaScript 编写,采用 Apache License 2.0 许可证,目前获得 344 个 Star、87 次 Fork。

仓库全名
amazon-archives/aws-amplify-vue
开源许可证
Apache License 2.0
Star 数
344
Fork 数
87
未关闭 Issue
8

README 摘要

AWS Amplify Vue Starter A VueJs starter app integrated with aws-amplify. Please submit issues to the aws-amplify repository. Getting Started AWS Amplify Integration Explained Setup AWS Amplify Auth Routing Storage Components License Getting Started 1. Clone project and install dependencies 2. Copy your aws-exports file into the src directory, or intialize a new AWS Amplify CLI project: 3. Start the project Check…

完整内容见 GitHub 原始 README 或本页 。

常见问题

aws-amplify-vue 用什么语言开发?

主要使用 JavaScript 编写,采用 Apache License 2.0 许可证,目前有 344 个 Star。

aws-amplify-vue 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 aws-amplify-vue 的源码?

可以直接克隆仓库:git clone https://github.com/amazon-archives/aws-amplify-vue.git,默认分支为 master;安装与运行步骤见仓库 README。

aws-amplify-vue 最近还在维护吗?

仓库最近一次更新为 2020年6月17日,当前有 8 个未关闭 Issue;Star 数为 344,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

A Vue.js starter app integrated with AWS Amplify

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
518
价值分
232
活跃状态
归档

语言占比

HTML
JavaScript
Vue

README

AWS Amplify Vue Starter

A VueJs starter app integrated with aws-amplify. Please submit issues to the aws-amplify repository.

Getting Started

  1. Clone project and install dependencies
$ git clone https://github.com/aws-samples/aws-amplify-vue.git
$ cd aws-amplify-vue-sample
$ npm install
  1. Copy your aws-exports file into the src directory, or intialize a new AWS Amplify CLI project:
$ npm install -g @aws-amplify/cli

$ amplify init

$ amplify add auth
$ > Yes, use the default configuration.

$ amplify add storage
$ > Content (Images, audio, video, etc.)
...
$ > Auth users only
$ > read/write

$ amplify add api
$ > GraphQL
...
$ > Amazon Cognito User Pool
$ Do you have an annotated GraphQL schema? N
$ Do you want a guided schema creation? Y
$ > Single object with fields (e.g. "Todo" with id, name description)
$ Do you want to edit the schema now? Y

  type Todo @model {
  id: ID!
  note: String!
  done: Boolean
}

$ amplify push
$ Do you want to generate code for your newly created GraphQL API N

  1. Start the project
$ npm start

Check http://localhost:8080/

Setup AWS Amplify

It is recommended to configure Amplify library at the entry point of application. Here we choose main.js

import Amplify from 'aws-amplify';
import { components } from 'aws-amplify-vue'; 
import aws_exports from './aws-exports'

...

Amplify.configure(aws_exports)

...

new Vue({
  el: '#app',
  router: router,
  template: '<App/>',
  components: { 
    App,
    ...components
  }
})

We then install the AmplifyPlugin in the application’s router/index.js file:

import { AmplifyPlugin } from 'aws-amplify-vue';

...


Vue.use(AmplifyPlugin, AmplifyModules);

This makes the Amplify library available throughout the application as a Vue Plugin.

Authentication Components

This sample uses three auth-related components from the aws-amplify-vue package:

  • Authenticator

    • allows new users to signup, signin, and complete verification/multifactor authentication steps.
    • included in the router as the default route that is shown when the user is not logged in.
  • SetMFA

    • included in the profile page
    • allows users to select their preferred MFA types
    • you can configure the MFA options that are dispayed in the SetMFA component by binding a mfaConfig object to the component like so:
    <amplify-set-mfa v-bind:mfaConfig="mfaConfig"></amplify-set-mfa>
    
    ...
    
    mfaConfig = {
      mfaTypes: ['SMS', 'TOTP', 'None']
    }
    
    

Storage Components

In this sample, src/amplify package register a group of Amplify related components. Other than Auth components, there are two storage related components:

  • PhotoPicker
    • showcase usage of Amplify Storage on binary data uploads
  • S3Image
    • showcase usage of Amplify Storage on binary data display

Logging

This application uses verbose logging by default. You can change the log level by altering the line window.LOG_LEVEL = 'VERBOSE'; in App.vue.

License

This library is licensed under the Apache 2.0 License.

评论

暂无评论