在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):amazon-archives/aws-appsync-chat开源软件地址(OpenSource Url):https://github.com/amazon-archives/aws-appsync-chat开源编程语言(OpenSource Language):JavaScript 94.4%开源软件介绍(OpenSource Introduction):ChattReal-Time Offline Ready Chat App written with GraphQL, AWS AppSync, & AWS Amplify Features
Technologies
ScreensBuilding the App (automated)This project contains an Amplify project (
npm install -g @aws-amplify/cli
git clone https://github.com/aws-samples/aws-appsync-chat.git
npm install
amplify init
amplify push
npm start
If you'd like to tear down the project & delete all of the resources created by this project, run the amplify delete Building the App (manually)You can also manually set up your resources if you would like. If you would like to manually create & configure the resources for this project, follow these steps:
npm install -g @aws-amplify
amplify configure
git clone https://github.com/aws-samples/aws-appsync-chat.git
npm install
amplify init
amplify add auth
amplify add api
type User
@model
@auth(rules: [{ allow: owner, ownerField: "id", queries: null }]) {
id: ID!
username: String!
conversations: [ConvoLink] @connection(name: "UserLinks")
messages: [Message] @connection(name: "UserMessages")
createdAt: String
updatedAt: String
}
type Conversation
@model(
mutations: { create: "createConvo" }
queries: { get: "getConvo" }
subscriptions: null
)
@auth(rules: [{ allow: owner, ownerField: "members" }]) {
id: ID!
messages: [Message] @connection(name: "ConvoMsgs", sortField: "createdAt")
associated: [ConvoLink] @connection(name: "AssociatedLinks")
name: String!
members: [String!]!
createdAt: String
updatedAt: String
}
type Message
@model(subscriptions: null, queries: null)
@auth(rules: [{ allow: owner, ownerField: "authorId" }]) {
id: ID!
author: User @connection(name: "UserMessages", keyField: "authorId")
authorId: String
content: String!
conversation: Conversation! @connection(name: "ConvoMsgs")
messageConversationId: ID!
createdAt: String
updatedAt: String
}
type ConvoLink
@model(
mutations: { create: "createConvoLink", update: "updateConvoLink" }
queries: null
subscriptions: null
) {
id: ID!
user: User! @connection(name: "UserLinks")
convoLinkUserId: ID
conversation: Conversation! @connection(name: "AssociatedLinks")
convoLinkConversationId: ID!
createdAt: String
updatedAt: String
}
type Subscription {
onCreateConvoLink(convoLinkUserId: ID!): ConvoLink
@aws_subscribe(mutations: ["createConvoLink"])
onCreateMessage(messageConversationId: ID!): Message
@aws_subscribe(mutations: ["createMessage"])
}
amplify push
npm start
If you'd like to tear down the project & delete all of the resources created by this project, run the amplify delete Hosting with the AWS Amplify ConsoleThe AWS Amplify Console provides continuous deployment and hosting for modern web apps (single page apps and static site generators) with serverless backends. Continuous deployment allows developers to deploy updates to either the frontend or backend (Lambda functions, GraphQL resolvers) on every code commit to the Git repository.
AboutSchemaThis application utilizes 4 database tables:
LicenseThis library is licensed under the Apache 2.0 License. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论