{"id":16181771,"url":"https://github.com/ericclemmons/next.js-conf-2020","last_synced_at":"2025-03-19T01:31:16.082Z","repository":{"id":66108057,"uuid":"305154451","full_name":"ericclemmons/next.js-conf-2020","owner":"ericclemmons","description":"From Front-end to Full Stack with Amplify Framework","archived":false,"fork":false,"pushed_at":"2020-11-09T22:54:51.000Z","size":6640,"stargazers_count":38,"open_issues_count":2,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-10T19:03:20.548Z","etag":null,"topics":["amplify","amplify-js","nextjs","react","ssg","ssr"],"latest_commit_sha":null,"homepage":"https://next-js-conf-2020.ericclemmons.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericclemmons.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-18T17:10:50.000Z","updated_at":"2022-07-27T18:36:04.000Z","dependencies_parsed_at":"2023-07-08T07:31:14.483Z","dependency_job_id":null,"html_url":"https://github.com/ericclemmons/next.js-conf-2020","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/ericclemmons%2Fnext.js-conf-2020","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericclemmons%2Fnext.js-conf-2020/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericclemmons%2Fnext.js-conf-2020/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericclemmons%2Fnext.js-conf-2020/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericclemmons","download_url":"https://codeload.github.com/ericclemmons/next.js-conf-2020/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243960361,"owners_count":20375102,"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":["amplify","amplify-js","nextjs","react","ssg","ssr"],"created_at":"2024-10-10T06:27:36.343Z","updated_at":"2025-03-19T01:31:16.077Z","avatar_url":"https://github.com/ericclemmons.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# From Front-end to Full Stack – Next.js Conf 2020\n\n\u003e This project demonstrates the architecture changes Amplify JS needed to support Next.js,\n\u003e authentication \u0026 data-access in a client-side application,\n\u003e and how to move logic to the server for better performance.\n\n![Screenshot of app](screenshot.png)\n\n## Setup\n\n1. Clone this repo\n\n   ```shell\n   git clone git@github.com:ericclemmons/next.js-conf-2020.git\n   ```\n\n1. Change into the directory \u0026 install the dependencies\n\n   ```shell\n   cd next.js-conf-2020\n\n   yarn install\n   ```\n\n1. **Next, choose your own adventure:**:\n\n   1. You can either continue with the [`main`](https://github.com/ericclemmons/next.js-conf-2020/tree/main) branch \u0026 setup Amplify from scratch (e.g. `amplify init`, `amplify add auth`, `amplify add api`).\n   1. Or, you can checkout the [`live-demo`](https://github.com/ericclemmons/next.js-conf-2020/tree/live-demo) branch and re-use the backend configuration from the presentation.\n\n## New Backend ([`main`](https://github.com/ericclemmons/next.js-conf-2020/tree/main))\n\n1. Initialize Amplify\n\n   ```shell\n   amplify init\n   ```\n\n   \u003cdetails\u003e\n   \u003csummary\u003e\n   More details\u0026hellip;\n   \u003c/summary\u003e\n\n   ```console\n   $ amplify init\n   ? Enter a name for the project nextjsconf2020\n   ? Enter a name for the environment dev\n   ? Choose your default editor: Visual Studio Code\n   ? Choose the type of app that you're building javascript\n   Please tell us about your project\n   ? What javascript framework are you using react\n   ? Source Directory Path:  src\n   ? Distribution Directory Path: build\n   ? Build Command:  npm run-script build\n   ? Start Command: npm run-script start\n   ```\n\n   \u003c/details\u003e\n\n1. Add Authentication\n\n   ```shell\n   amplify add auth\n   ```\n\n   \u003cdetails\u003e\n   \u003csummary\u003e\n   More details\u0026hellip;\n   \u003c/summary\u003e\n\n   ```console\n   $ amplify add auth\n   Do you want to use the default authentication and security configuration? Default configuration\n   Warning: you will not be able to edit these selections.\n   How do you want users to be able to sign in? Username\n   Do you want to configure advanced settings? No, I am done.\n   ```\n\n   \u003c/details\u003e\n\n1. Add API\n\n   ```shell\n   amplify add api\n   ```\n\n   \u003cdetails\u003e\n   \u003csummary\u003e\n   More details\u0026hellip;\n   \u003c/summary\u003e\n\n   ```console\n   $ amplify add api\n   ? Please select from one of the below mentioned services: GraphQL\n   ? Provide API name: nextjsconf2020\n   ? Choose the default authorization type for the API API key\n   ? Enter a description for the API key:\n   ? After how many days from now the API key should expire (1-365): 7\n   ? Do you want to configure advanced settings for the GraphQL API Yes, I want to make some additional changes.\n   ? Configure additional auth types? Yes\n   ? Choose the additional authorization types you want to configure for the API Amazon Cognito User Pool\n   Cognito UserPool configuration\n   Use a Cognito user pool configured as a part of this project.\n   ? Configure conflict detection? No\n   ? Do you have an annotated GraphQL schema? No\n   ? Choose a schema template: Single object with fields (e.g., “Todo” with ID, name, description)\n   ```\n\n   \u003c/details\u003e\n\n   Next, you'll be prompted to edit your schema:\n\n   \u003e ? Do you want to edit the schema now? **Yes**\n\n   Replace the contents of your editor with the following, then save:\n\n   ```gql\n   type Post\n     @model\n     # See: https://docs.amplify.aws/cli/graphql-transformer/directives#owner-authorization\n     @auth(rules: [{ allow: owner }, { allow: public, operations: [read] }])\n     # See: https://docs.amplify.aws/cli/graphql-transformer/directives#how-to-use-key\n     @key(name: \"postsBySlug\", fields: [\"slug\"], queryField: \"postsBySlug\") {\n     id: ID!\n     title: String!\n     slug: String!\n     tags: [String!]!\n     snippet: String!\n     content: String!\n     published: Boolean!\n   }\n   ```\n\n1. Deploy your backend to the cloud\n\n   ```shell\n   amplify push\n   ```\n\n   \u003cdetails\u003e\n   \u003csummary\u003e\n   More details\u0026hellip;\n   \u003c/summary\u003e\n\n   ```console\n   ? Do you want to generate code for your newly created GraphQL API Yes\n   ? Choose the code generation language target javascript\n   ? Enter the file name pattern of graphql queries, mutations and subscriptions src/graphql/**/*.js\n   ? Do you want to generate/update all possible GraphQL operations - queries, mutations and subscriptions Yes\n   ? Enter maximum statement depth [increase from default if your schema is deeply nested] 2\n   ```\n\n   \u003c/details\u003e\n\n1. Run the app locally\n\n   ```shell\n   yarn dev\n   ```\n\nVisit http://localhost:3000/ to view the app!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericclemmons%2Fnext.js-conf-2020","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericclemmons%2Fnext.js-conf-2020","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericclemmons%2Fnext.js-conf-2020/lists"}