{"id":13517179,"url":"https://github.com/amazon-archives/aws-appsync-chat","last_synced_at":"2025-03-31T07:31:08.722Z","repository":{"id":45982670,"uuid":"167450644","full_name":"amazon-archives/aws-appsync-chat","owner":"amazon-archives","description":"Real-Time Offline Ready Chat App written with GraphQL, AWS AppSync, \u0026 AWS Amplify","archived":true,"fork":false,"pushed_at":"2020-04-07T21:48:28.000Z","size":625,"stargazers_count":557,"open_issues_count":17,"forks_count":300,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-05-21T13:57:34.024Z","etag":null,"topics":["aws-amplify","aws-appsync","graphql","offline","react","real-time","serverless"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amazon-archives.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-24T22:57:04.000Z","updated_at":"2024-05-21T04:59:32.000Z","dependencies_parsed_at":"2022-07-18T12:48:07.009Z","dependency_job_id":null,"html_url":"https://github.com/amazon-archives/aws-appsync-chat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-archives%2Faws-appsync-chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-archives%2Faws-appsync-chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-archives%2Faws-appsync-chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-archives%2Faws-appsync-chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amazon-archives","download_url":"https://codeload.github.com/amazon-archives/aws-appsync-chat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246433164,"owners_count":20776545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-amplify","aws-appsync","graphql","offline","react","real-time","serverless"],"created_at":"2024-08-01T05:01:30.762Z","updated_at":"2025-03-31T07:31:07.883Z","avatar_url":"https://github.com/amazon-archives.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"![](src/assets/hero1.jpg)\n\n## Chatt\n\nReal-Time Offline Ready Chat App written with GraphQL, AWS AppSync, \u0026 AWS Amplify\n\n## Features\n\n- User management\n- Routing (React Router)\n- Real-time\n- Offline ready (conflict resolution handled for you when user comes back online)\n\n## Technologies\n\n- AWS AppSync\n- AWS Amplify\n- GraphQL\n- MobX\n- React Router\n- React Apollo\n- Glamor\n\n## Screens\n\n![](src/assets/hero2.jpg)\n\n## Building the App (automated)\n\nThis project contains an Amplify project (`/amplify`) already configured \u0026 ready to be deployed. Deploying this project will create the following resources in your account: an authentication configuration using Amazon Cognito, an AWS AppSync GraphQL API, \u0026 a DynamoDB table.\n\n1. Make sure you are on the newest version of the AWS Amplify CLI\n\n```sh\nnpm install -g @aws-amplify/cli\n```\n\n\u003e You must also have the CLI configured with a user from your AWS account (`amplify configure`). For a walkthrough of how to do this, check out [this](https://www.youtube.com/watch?v=fWbM5DLh25U) video.\n\n2. Clone Chatt\n\n```sh\ngit clone https://github.com/aws-samples/aws-appsync-chat.git\n```\n\n3. Install dependencies\n\n```sh\nnpm install\n```\n\n4. Initialize the amplify project\n\n```sh\namplify init\n```\n- Enter a name for the environment __master__\n\n5. Push the new resources to the cloud\n\n```sh\namplify push\n```\n\n6. Run the project\n\n```sh\nnpm start\n```\n\n7. Deleting the project resources\n\nIf you'd like to tear down the project \u0026 delete all of the resources created by this project, run the `delete` command.\n\n```sh\namplify delete\n```\n\n\n## Building the App (manually)\n\nYou can also manually set up your resources if you would like. If you would like to manually create \u0026 configure the resources for this project, follow these steps:\n\n1. Install \u0026 configure the Amplify CLI\n\n```sh\nnpm install -g @aws-amplify\n\namplify configure\n```\n\n2. Clone Chatt\n\n```sh\ngit clone https://github.com/aws-samples/aws-appsync-chat.git\n```\n\n3. Install dependencies\n\n```sh\nnpm install\n```\n\n4. Delete the amplify folder\n\n5. Initialize a new Amplify project\n\n```sh\namplify init\n```\n\n6. Add authentication\n\n```sh\namplify add auth\n```\n\n\u003e Here, either choose the default security choice or configure your own.\n\n7. Add the api\n\n```sh\namplify add api\n```\n\n\u003e Choose Cognito User Pools as the authentication type.\n\u003e When prompted for the GraphQL schema, use the following schema:\n\n```graphql\ntype User \n  @model \n  @auth(rules: [{ allow: owner, ownerField: \"id\", queries: null }]) {\n  id: ID!\n  username: String!\n  conversations: [ConvoLink] @connection(name: \"UserLinks\")\n  messages: [Message] @connection(name: \"UserMessages\")\n\tcreatedAt: String\n\tupdatedAt: String\n}\n\ntype Conversation\n  @model(\n    mutations: { create: \"createConvo\" }\n    queries: { get: \"getConvo\" }\n    subscriptions: null\n  )\n  @auth(rules: [{ allow: owner, ownerField: \"members\" }]) {\n  id: ID!\n  messages: [Message] @connection(name: \"ConvoMsgs\", sortField: \"createdAt\")\n  associated: [ConvoLink] @connection(name: \"AssociatedLinks\")\n  name: String!\n  members: [String!]!\n\tcreatedAt: String\n\tupdatedAt: String\n}\n\ntype Message \n  @model(subscriptions: null, queries: null) \n  @auth(rules: [{ allow: owner, ownerField: \"authorId\" }]) {\n  id: ID!\n  author: User @connection(name: \"UserMessages\", keyField: \"authorId\")\n  authorId: String\n  content: String!\n  conversation: Conversation! @connection(name: \"ConvoMsgs\")\n  messageConversationId: ID!\n\tcreatedAt: String\n\tupdatedAt: String\n}\n\ntype ConvoLink \n  @model(\n    mutations: { create: \"createConvoLink\", update: \"updateConvoLink\" }\n    queries: null\n    subscriptions: null\n  ) {\n  id: ID!\n  user: User! @connection(name: \"UserLinks\")\n  convoLinkUserId: ID\n  conversation: Conversation! @connection(name: \"AssociatedLinks\")\n  convoLinkConversationId: ID!\n\tcreatedAt: String\n\tupdatedAt: String\n}\n\ntype Subscription {\n  onCreateConvoLink(convoLinkUserId: ID!): ConvoLink\n    @aws_subscribe(mutations: [\"createConvoLink\"])\n  onCreateMessage(messageConversationId: ID!): Message\n    @aws_subscribe(mutations: [\"createMessage\"])\n}\n```\n\n8. Run the `push` command to create the resources in your account:\n\n```sh\namplify push\n```\n\n9. Run the project\n\n```sh\nnpm start\n```\n\n10. Deleting the project resources\n\nIf you'd like to tear down the project \u0026 delete all of the resources created by this project, run the `delete` command.\n\n```sh\namplify delete\n```\n\n## Hosting with the AWS Amplify Console\n\nThe [AWS Amplify Console](https://console.amplify.aws) 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.\n\n1. Push your code to a Git repository of your choice.\n1. Login to the [AWS Amplify Console](https://console.aws.amazon.com/amplify/home) and choose **Connect app**\n1. Connect your repository and branch.\n1. Accept the default build settings.\n1. Give the Amplify Console permission to deploy backend resources with your frontend. This will allow the Console to detect changes to your backend on every code commit. If you do not have a service role, follow the prompts to create one.\n1. Review your changes and then choose **Save and deploy**. You app will now be available at `https://master.unique-id.amplifyapp.com`.\n\n## About\n\n### Schema\n\nThis application utilizes 4 database tables:\n\n- User table (stores user's identity information)\n- Conversation table (stores conversations)\n- Messages table (stores messages)\n- ConvoLinkTable (stores relations between conversations \u0026 users)\n\n## License\n\nThis library is licensed under the Apache 2.0 License. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-archives%2Faws-appsync-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famazon-archives%2Faws-appsync-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-archives%2Faws-appsync-chat/lists"}