Plush
1.0.0

Plush是用于图片共享的全栈移动应用程序。它使用Expo并在前端进行反应本机,AWS放大为后端服务,并且API服务是使用GraphQL构建的。
此处的应用程序功能的演示视频。
注册/登录后,用户可以执行以下操作:
用户使用开箱即用的AWS放大身份验证流进行身份验证。
用户将重定向到应用程序的唯一屏幕:feed。
当用户上传图片时:
当用户标记不适当的内容时:
当用户喜欢/不利于图片时:
当用户删除图片时:
当用户刷新提要时:
要在本地计算机上运行此应用程序,您需要以下工具:
博览会CLI
npm install -g expo-cliAWS帐户
NPM节点JS
AWS放大CLI
npm install -g @aws-amplify/cliamplify configure (链接逐步视频)。 git clone https://github.com/yhenni1989/plush
cd plush
yarn add aws-amplify aws-amplify-react-native
# or
npm install aws-amplify aws-amplify-react-native
amplify init

amplify add auth
# When prompt, choose: Yes, use the default configuration.
amplify add storage
# Choose: Content (Images, audio, video, etc.)
# Give access to only authenticated users.
# Give users read/write acces.
amplify add api
# Choose GraphQL as the API service.
# Choose an authorization type for the API: Amazon Cognito User Pool
# Do you have an annotated GraphQL schema? Yes
# Provide your schema file path: src/graphQL/schema.graphql
type Picture @model {
id : ID !
pictureOwnerId : String !
pictureOwnerUsername : String !
visibility : Visibility
file : S3Object
likes : [ Like ] @connection ( name : " PictureLikes " )
flags : [ Flag ] @connection ( name : " PictureFlags " )
}
type Like @model {
id : ID !
likeOwnerId : String !
likeOwnerUsername : String !
picture : Picture @connection ( name : " PictureLikes " )
}
type Flag @model {
id : ID !
flagOwnerId : String !
flagOwnerUsername : String !
picture : Picture @connection ( name : " PictureFlags " )
}
type S3Object {
bucket : String !
region : String !
key : String !
uri : String !
}
enum Visibility {
public
private
} amplify push

Do you want to generate code for your newly created GraphQL API: No.
AWS Amplify CLI将创建一个Amazon Cognito用户池和身份池,一个Amazon S3存储桶,用于存储每个用户图片和AWS AppSync GraphQL API,该AppSync GraphQl API使用Amazon DynamedoDB存储元数据有关图片的元数据(即,桶名,喜欢,flags,flags,flags,flags,flags,land,所有者,日期创建日期等)。
yarn
# or
npm install
src/myKeys.js文件中复制您的访问权限和秘密键。 const keys = {
accessKey : 'blablabla' ,
secretKey : 'blablabla' ,
}
export default keys expo start --ios
# or
expo start --android
如果应用程序成功运行,您应该能够按下相机图标,允许访问设备库,然后从设备中选择图片。这将将图片上传到S3,然后进行GraphQl调用,将记录输入DynamoDB。
然后,您可以按“刷新”按钮在屏幕上显示图片。
您可以喜欢/不同,并标记其他用户图片,并删除自己的图片。