├── LICENSE ├── README.md ├── firebase-jwt ├── .gitignore ├── README.md ├── app │ ├── index.html │ └── main.js └── functions │ ├── index.js │ ├── package-lock.json │ └── package.json ├── gatsby-contentful-auth0 ├── README.md ├── app │ ├── .env.EXAMPLE │ ├── .gitignore │ ├── .prettierrc │ ├── README.md │ ├── gatsby-browser.js │ ├── gatsby-config.js │ ├── gatsby-node.js │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── components │ │ │ ├── Playlist.js │ │ │ └── style.css │ │ ├── pages │ │ │ ├── account.js │ │ │ ├── callback.js │ │ │ └── index.js │ │ └── utils │ │ │ └── auth.js │ └── static │ │ └── favicon.ico ├── auth0 │ └── insert_user_rule.js └── hasura │ ├── config.yaml │ ├── metadata │ ├── actions.graphql │ ├── actions.yaml │ ├── allow_list.yaml │ ├── cron_triggers.yaml │ ├── databases │ │ ├── databases.yaml │ │ └── default │ │ │ └── tables │ │ │ ├── public_album.yaml │ │ │ ├── public_playlist.yaml │ │ │ ├── public_playlist_track.yaml │ │ │ ├── public_track.yaml │ │ │ ├── public_users.yaml │ │ │ └── tables.yaml │ ├── query_collections.yaml │ ├── remote_schemas.yaml │ ├── rest_endpoints.yaml │ └── version.yaml │ └── migrations │ └── default │ └── 1613666112230_init │ └── up.sql ├── gatsby-postgres-graphql ├── .gitignore ├── README.md ├── assets │ ├── add_table.jpg │ ├── browse_rows.jpg │ ├── gatsby-postgres-graphql.png │ ├── insert_data.jpg │ └── test_app.jpg ├── config.yaml ├── gatsby-browser.js ├── gatsby-config.js ├── gatsby-ssr.js ├── hasura │ ├── config.yaml │ ├── metadata │ │ ├── actions.graphql │ │ ├── actions.yaml │ │ ├── allow_list.yaml │ │ ├── cron_triggers.yaml │ │ ├── databases │ │ │ ├── databases.yaml │ │ │ └── default │ │ │ │ └── tables │ │ │ │ └── public_author.yaml │ │ ├── query_collections.yaml │ │ ├── remote_schemas.yaml │ │ └── version.yaml │ └── migrations │ │ └── default │ │ └── 1613663714522_init │ │ └── up.sql ├── package.json └── src │ ├── components │ ├── AddAuthor.js │ └── AuthorList.js │ ├── pages │ └── index.js │ └── utils │ └── apollo.js ├── graphql-benchmark ├── README.md ├── benchmark.sh ├── config.query.hasura.yaml ├── config.query.node.yaml ├── docker-compose.hasura.yml ├── docker-compose.node.yml ├── hasura │ ├── config.yaml │ ├── metadata │ │ ├── actions.graphql │ │ ├── actions.yaml │ │ ├── allow_list.yaml │ │ ├── api_limits.yaml │ │ ├── backend_configs.yaml │ │ ├── cron_triggers.yaml │ │ ├── databases │ │ │ ├── databases.yaml │ │ │ └── default │ │ │ │ └── tables │ │ │ │ ├── public_Album.yaml │ │ │ │ ├── public_Artist.yaml │ │ │ │ ├── public_Customer.yaml │ │ │ │ ├── public_Employee.yaml │ │ │ │ ├── public_Genre.yaml │ │ │ │ ├── public_Invoice.yaml │ │ │ │ ├── public_InvoiceLine.yaml │ │ │ │ ├── public_MediaType.yaml │ │ │ │ ├── public_Playlist.yaml │ │ │ │ ├── public_PlaylistTrack.yaml │ │ │ │ ├── public_Track.yaml │ │ │ │ └── tables.yaml │ │ ├── graphql_schema_introspection.yaml │ │ ├── inherited_roles.yaml │ │ ├── metrics_config.yaml │ │ ├── network.yaml │ │ ├── opentelemetry.yaml │ │ ├── query_collections.yaml │ │ ├── remote_schemas.yaml │ │ ├── rest_endpoints.yaml │ │ └── version.yaml │ └── migrations │ │ └── default │ │ ├── 1673475378052_add_chinook_db │ │ ├── down.sql │ │ └── up.sql │ │ └── 1673475378053_apply_chinook_seed │ │ └── up.sql ├── nodejs │ ├── .dockerignore │ ├── .gitignore │ ├── Dockerfile │ ├── codegen.ts │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── dataloader.ts │ │ ├── db.ts │ │ ├── generated │ │ │ └── graphql.ts │ │ ├── main.ts │ │ ├── schema.graphql │ │ └── utils.ts │ └── tsconfig.json ├── report.hasura.json └── report.nodejs.json ├── gridsome-postgres-graphql ├── .gitignore ├── README.md ├── gridsome.config.js ├── gridsome.server.js ├── package.json ├── src │ ├── components │ │ └── README.md │ ├── favicon.png │ ├── layouts │ │ ├── Default.vue │ │ └── README.md │ ├── main.js │ ├── pages │ │ ├── Articles.vue │ │ ├── Index.vue │ │ └── README.md │ └── templates │ │ └── README.md ├── static │ └── README.md └── yarn.lock ├── nextjs-13 ├── .eslintrc.json ├── .gitignore ├── README.md ├── app │ ├── [id] │ │ └── page.tsx │ ├── components │ │ └── orders.tsx │ ├── globals.css │ ├── head.tsx │ ├── layout.tsx │ ├── loading.tsx │ ├── page.module.css │ └── page.tsx ├── client.ts ├── codegen.ts ├── docker-compose.yaml ├── gql │ ├── fragment-masking.ts │ ├── gql.ts │ ├── graphql.ts │ └── index.ts ├── hasura │ ├── config.yaml │ ├── metadata │ │ ├── actions.graphql │ │ ├── actions.yaml │ │ ├── allow_list.yaml │ │ ├── api_limits.yaml │ │ ├── cron_triggers.yaml │ │ ├── databases │ │ │ ├── databases.yaml │ │ │ └── default │ │ │ │ └── tables │ │ │ │ ├── public_address.yaml │ │ │ │ ├── public_order.yaml │ │ │ │ ├── public_order_product.yaml │ │ │ │ ├── public_order_status.yaml │ │ │ │ ├── public_product.yaml │ │ │ │ ├── public_product_category_enum.yaml │ │ │ │ ├── public_product_review.yaml │ │ │ │ ├── public_site_admin.yaml │ │ │ │ ├── public_user.yaml │ │ │ │ └── tables.yaml │ │ ├── graphql_schema_introspection.yaml │ │ ├── inherited_roles.yaml │ │ ├── network.yaml │ │ ├── query_collections.yaml │ │ ├── remote_schemas.yaml │ │ ├── rest_endpoints.yaml │ │ └── version.yaml │ ├── migrations │ │ └── default │ │ │ └── 1646834482402_init │ │ │ └── up.sql │ └── seeds │ │ └── default │ │ ├── 01_A_user_seeds.sql │ │ ├── 01_B_user_address_seeds.sql │ │ ├── 02_product_seeds_sanitized.sql │ │ ├── 03_A_order_seeds.sql │ │ ├── 03_B_order_product_seeds.sql │ │ └── 04_default_user_login_seeds.sql ├── lib │ ├── gql │ │ ├── fragment-masking.ts │ │ ├── gql.ts │ │ ├── graphql.ts │ │ └── index.ts │ └── service │ │ ├── client.ts │ │ └── queries.graphql ├── next.config.js ├── package-lock.json ├── package.json ├── pages │ └── api │ │ └── hello.ts ├── public │ ├── favicon.ico │ └── vercel.svg ├── queries.graphql ├── service │ ├── client.ts │ └── queries.graphql └── tsconfig.json ├── nextjs-8-serverless ├── with-apollo-jwt │ ├── .gitignore │ ├── README.md │ ├── app │ │ ├── components │ │ │ ├── ArticleList.js │ │ │ ├── header.js │ │ │ └── layout.js │ │ ├── lib │ │ │ ├── init-apollo.js │ │ │ └── with-apollo-client.js │ │ ├── next.config.js │ │ ├── now.json │ │ ├── package.json │ │ ├── pages │ │ │ ├── _app.js │ │ │ ├── articles.js │ │ │ ├── index.js │ │ │ ├── login.js │ │ │ └── signup.js │ │ ├── server.js │ │ ├── utils │ │ │ └── auth.js │ │ └── yarn.lock │ └── hasura │ │ ├── config.yaml │ │ ├── metadata │ │ ├── actions.graphql │ │ ├── actions.yaml │ │ ├── allow_list.yaml │ │ ├── cron_triggers.yaml │ │ ├── databases │ │ │ ├── databases.yaml │ │ │ └── default │ │ │ │ └── tables │ │ │ │ ├── public_article.yaml │ │ │ │ ├── public_role.yaml │ │ │ │ ├── public_user.yaml │ │ │ │ ├── public_user_role.yaml │ │ │ │ └── tables.yaml │ │ ├── query_collections.yaml │ │ ├── remote_schemas.yaml │ │ ├── rest_endpoints.yaml │ │ └── version.yaml │ │ └── migrations │ │ └── default │ │ └── 1613664987061_init │ │ └── up.sql └── with-apollo │ ├── .gitignore │ ├── README.md │ ├── components │ ├── App.js │ ├── AuthorList.js │ ├── ErrorMessage.js │ └── Header.js │ ├── lib │ ├── init-apollo.js │ └── with-apollo-client.js │ ├── next.config.js │ ├── now.json │ ├── package-lock.json │ ├── package.json │ └── pages │ ├── _app.js │ ├── about.js │ └── index.js ├── nextjs-incremental-static-regeneration ├── .env.local.example ├── .eslintrc.json ├── .gitignore ├── README.md ├── docker-compose.yml ├── hasura │ ├── config.yaml │ ├── metadata │ │ ├── actions.graphql │ │ ├── actions.yaml │ │ ├── allow_list.yaml │ │ ├── cron_triggers.yaml │ │ ├── databases │ │ │ ├── databases.yaml │ │ │ └── default │ │ │ │ └── tables │ │ │ │ ├── public_post.yaml │ │ │ │ └── tables.yaml │ │ ├── query_collections.yaml │ │ ├── remote_schemas.yaml │ │ ├── rest_endpoints.yaml │ │ └── version.yaml │ └── migrations │ │ └── default │ │ └── 1647304090289_init │ │ └── up.sql ├── next-env.d.ts ├── next.config.js ├── package-lock.json ├── package.json ├── pages │ ├── _app.tsx │ ├── api │ │ └── revalidate.ts │ └── index.tsx ├── public │ ├── favicon.ico │ └── vercel.svg ├── styles │ ├── Home.module.css │ └── globals.css └── tsconfig.json ├── nextjs-postgres-graphql ├── .env.example ├── .gitignore ├── README.md ├── assets │ ├── Permissions-Table-Data-Hasura.png │ ├── add-variable.png │ ├── demo-app.png │ ├── hasura-variables.png │ └── nextjs-postgres-graphql.png ├── config.js ├── package.json └── pages │ ├── AuthorList.js │ └── index.js ├── nuxtjs-postgres-graphql ├── .gitignore ├── README.md ├── apollo │ ├── clientConfig.js │ └── queries │ │ ├── fetchArticle.gql │ │ └── fetchAuthor.gql ├── assets │ └── README.md ├── components │ └── README.md ├── layouts │ ├── README.md │ └── default.vue ├── middleware │ └── README.md ├── nuxt.config.js ├── package-lock.json ├── package.json ├── pages │ ├── README.md │ ├── article │ │ └── _id.vue │ └── index.vue ├── plugins │ ├── README.md │ └── apollo-error-handler.js ├── static │ ├── README.md │ └── favicon.ico └── store │ └── README.md ├── quasar-framework-vue-graphql ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .postcssrc.js ├── README.md ├── apollo.config.js ├── babel.config.js ├── jsconfig.json ├── package.json ├── public │ ├── favicon.ico │ └── icons │ │ ├── favicon-128x128.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ └── favicon-96x96.png ├── quasar.config.js ├── quasar.extensions.json ├── src │ ├── App.vue │ ├── apollo │ │ └── index.js │ ├── assets │ │ └── quasar-logo-vertical.svg │ ├── boot │ │ ├── .gitkeep │ │ └── apollo.js │ ├── css │ │ ├── app.scss │ │ └── quasar.variables.scss │ ├── index.template.html │ ├── layouts │ │ └── MainLayout.vue │ ├── pages │ │ ├── Articles.vue │ │ ├── ErrorNotFound.vue │ │ └── IndexPage.vue │ └── router │ │ ├── index.js │ │ └── routes.js └── yarn.lock ├── react-apollo-todo ├── .dockerignore ├── .eslintrc.json ├── .gitignore ├── CONTRIBUTING.md ├── Dockerfile ├── Procfile ├── README.md ├── cypress.env.json ├── cypress.json ├── cypress │ ├── fixtures │ │ └── example.json │ ├── helpers │ │ ├── common.js │ │ └── dataHelpers.js │ ├── integration │ │ ├── todos │ │ │ ├── private-todos │ │ │ │ ├── spec.js │ │ │ │ └── test.js │ │ │ └── public-todos │ │ │ │ ├── spec.js │ │ │ │ └── test.js │ │ ├── users │ │ │ └── online │ │ │ │ ├── spec.js │ │ │ │ └── test.js │ │ └── validators │ │ │ └── validators.js │ ├── plugins │ │ └── index.js │ └── support │ │ ├── commands.js │ │ └── index.js ├── hasura │ ├── config.yaml │ ├── metadata │ │ ├── actions.graphql │ │ ├── actions.yaml │ │ ├── allow_list.yaml │ │ ├── cron_triggers.yaml │ │ ├── databases │ │ │ ├── databases.yaml │ │ │ └── default │ │ │ │ └── tables │ │ │ │ ├── public_online_users.yaml │ │ │ │ ├── public_todos.yaml │ │ │ │ └── public_users.yaml │ │ ├── query_collections.yaml │ │ ├── remote_schemas.yaml │ │ └── version.yaml │ └── migrations │ │ └── default │ │ └── 1613664692358_init │ │ └── up.sql ├── package.json ├── public │ ├── favicon.ico │ ├── favicon.png │ ├── index.html │ └── manifest.json └── src │ ├── apollo.js │ ├── components │ ├── App.js │ ├── Auth │ │ ├── Auth.js │ │ └── auth0-variables.js │ ├── Callback │ │ ├── Callback.js │ │ └── loading.svg │ ├── Home │ │ └── Home.js │ ├── LandingPage │ │ └── LandingPage.js │ ├── OnlineUsers │ │ └── OnlineUsers.js │ └── Todo │ │ ├── TodoFilters.js │ │ ├── TodoInput.js │ │ ├── TodoItem.js │ │ ├── TodoPrivateList.js │ │ ├── TodoPrivateWrapper.js │ │ ├── TodoPublicList.js │ │ ├── TodoPublicWrapper.js │ │ └── TodoQueries.js │ ├── images │ ├── React-logo.png │ ├── apollo.png │ ├── auth.png │ ├── checked.svg │ ├── graphql.png │ ├── green-logo-white.svg │ ├── logo.svg │ ├── right-img.png │ └── right-img1.png │ ├── index.js │ ├── routes.js │ ├── styles │ └── App.css │ └── utils │ ├── constants.js │ ├── history.js │ └── utils.js ├── react-relay ├── .babelrc ├── .gitignore ├── README.md ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt ├── relay.config.js ├── schema.graphql ├── src │ ├── App.js │ ├── RelayEnvironment.js │ ├── components │ │ ├── RestaurantReviews.js │ │ └── shared │ │ │ ├── Badge.js │ │ │ ├── Button.js │ │ │ ├── Form.js │ │ │ ├── InputForm.js │ │ │ ├── List.js │ │ │ └── Logo.js │ ├── fetchGraphQL.js │ ├── index.css │ ├── index.js │ └── serviceWorker.js └── yarn.lock ├── react-static-graphql ├── .babelrc ├── .eslintrc.js ├── .gitignore ├── README.md ├── assets │ └── author_fk.png ├── package.json ├── public │ └── robots.txt ├── src │ ├── App.js │ ├── apollo.js │ ├── app.css │ ├── containers │ │ └── Post.js │ ├── graphql │ │ └── queries.js │ ├── index.js │ └── pages │ │ ├── 404.js │ │ ├── about.js │ │ ├── blog.js │ │ └── index.js ├── static.config.js └── yarn.lock ├── react-weather-analytics-app ├── README.md ├── app │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── manifest.json │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── App.test.js │ │ ├── Navbar.js │ │ ├── charts │ │ ├── StyledBarChart.js │ │ └── index.js │ │ ├── index.css │ │ ├── index.js │ │ └── logo.svg └── hasura │ ├── config.yaml │ └── metadata │ └── hasura_metadata_2023_06_14_13_52_11_024.json ├── realtime-chat-vue ├── .browserslistrc ├── .eslintrc.js ├── .gitignore ├── README.md ├── babel.config.js ├── package-lock.json ├── package.json ├── postcss.config.js ├── public │ ├── favicon.ico │ └── index.html └── src │ ├── App.css │ ├── App.vue │ ├── assets │ └── logo.png │ ├── components │ ├── ApolloExample.vue │ ├── Banner.vue │ ├── ChatWrapper.vue │ ├── HelloWorld.vue │ ├── MessageList.vue │ ├── OnlineUsers.vue │ ├── RenderMessages.vue │ ├── TextBox.vue │ └── TypingIndicator.vue │ ├── graphql │ ├── AddUserMutation.gql │ ├── emitOnlineEvent.gql │ ├── emitTypingEvent.gql │ ├── fetchMessages.gql │ ├── fetchOnlineUsersSubscription.gql │ ├── getUserTyping.gql │ ├── insertMessage.gql │ └── subscribeToNewMessages.gql │ ├── images │ ├── Vue-logo.png │ ├── apollo.png │ ├── auth.png │ ├── chat-app-bg.jpg │ ├── chat-app.png │ ├── graphql.png │ └── green-logo-white.svg │ ├── main.js │ ├── router.js │ ├── services │ └── storage.js │ ├── store.js │ ├── views │ ├── Home.vue │ └── Login.vue │ └── vue-apollo.js ├── realtime-chat ├── .gitignore ├── Dockerfile ├── README.md ├── docker-compose.yml ├── hasura │ ├── config.yaml │ ├── metadata │ │ ├── actions.graphql │ │ ├── actions.yaml │ │ ├── allow_list.yaml │ │ ├── cron_triggers.yaml │ │ ├── databases │ │ │ ├── databases.yaml │ │ │ └── default │ │ │ │ └── tables │ │ │ │ ├── public_message.yaml │ │ │ │ ├── public_user.yaml │ │ │ │ ├── public_user_online.yaml │ │ │ │ └── public_user_typing.yaml │ │ ├── query_collections.yaml │ │ ├── remote_schemas.yaml │ │ └── version.yaml │ └── migrations │ │ └── default │ │ └── 1613650170829_init │ │ └── up.sql ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── favicon.png │ ├── index.html │ └── manifest.json ├── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── components │ │ ├── Banner.js │ │ ├── Chat.js │ │ ├── ChatWrapper.js │ │ ├── LandingPage.js │ │ ├── Main.js │ │ ├── MessageList.js │ │ ├── OnlineUsers.js │ │ ├── RenderMessages.js │ │ ├── Textbox.js │ │ └── TypingIndicator.js │ ├── hasura_logo_200.png │ ├── hooks │ │ └── useInterval.js │ ├── images │ │ ├── React-logo.png │ │ ├── apollo.png │ │ ├── auth.png │ │ ├── chat-app-bg.jpg │ │ ├── chat-app.png │ │ ├── graphql.png │ │ └── green-logo-white.svg │ ├── index.css │ ├── index.js │ ├── logo.svg │ └── reportWebVitals.js └── yarn.lock ├── realtime-location-tracking ├── .env ├── .gitignore ├── Dockerfile ├── README.md ├── hasura │ ├── config.yaml │ ├── metadata │ │ ├── actions.graphql │ │ ├── actions.yaml │ │ ├── allow_list.yaml │ │ ├── cron_triggers.yaml │ │ ├── databases │ │ │ ├── databases.yaml │ │ │ └── default │ │ │ │ └── tables │ │ │ │ ├── public_vehicle.yaml │ │ │ │ └── public_vehicle_location.yaml │ │ ├── query_collections.yaml │ │ ├── remote_schemas.yaml │ │ └── version.yaml │ └── migrations │ │ └── default │ │ └── 1614593585596_init │ │ └── up.sql ├── package.json ├── public │ ├── favicon.ico │ ├── favicon.png │ ├── index.html │ └── manifest.json └── src │ ├── App.test.js │ ├── App │ ├── App.css │ ├── App.js │ └── MapContainer.js │ ├── UserInfo │ ├── UserInfo.css │ └── UserInfo.js │ ├── Vehicle │ ├── Vehicle.css │ └── Vehicle.js │ ├── apollo.js │ ├── assets │ ├── carbon.png │ └── hasura.png │ ├── constants.js │ ├── hooks │ ├── useInterval.js │ └── usePrevious.js │ ├── index.css │ ├── index.js │ └── mapInfo │ ├── drivingJson.js │ └── location.js ├── realtime-poll ├── .dockerignore ├── .gitignore ├── Dockerfile ├── README.md ├── hasura │ ├── config.yaml │ ├── metadata │ │ ├── actions.graphql │ │ ├── actions.yaml │ │ ├── allow_list.yaml │ │ ├── cron_triggers.yaml │ │ ├── databases │ │ │ ├── databases.yaml │ │ │ └── default │ │ │ │ └── tables │ │ │ │ ├── public_online_users.yaml │ │ │ │ ├── public_option.yaml │ │ │ │ ├── public_poll.yaml │ │ │ │ ├── public_poll_results.yaml │ │ │ │ ├── public_user.yaml │ │ │ │ └── public_vote.yaml │ │ ├── query_collections.yaml │ │ ├── remote_schemas.yaml │ │ └── version.yaml │ └── migrations │ │ └── default │ │ └── 1613651085741_init │ │ └── up.sql ├── package.json ├── public │ ├── favicon.ico │ ├── favicon.png │ ├── index.html │ └── manifest.json ├── src │ ├── App.css │ ├── App.jsx │ ├── App.test.js │ ├── Components.jsx │ ├── GraphQL.jsx │ ├── Poll.jsx │ ├── Result.jsx │ ├── Users.jsx │ ├── apollo.js │ ├── img │ │ ├── hasura_logo_200.png │ │ └── logo-white.svg │ ├── index.css │ ├── index.js │ └── session.js └── yarn.lock ├── serverless-etl ├── Dockerfile ├── README.md ├── algolia-logo.svg ├── arch.png ├── cloudfunction │ ├── .gcloudignore │ ├── .gitignore │ ├── index.js │ └── package.json ├── favicon.png ├── hasura │ ├── config.yaml │ ├── metadata │ │ ├── actions.graphql │ │ ├── actions.yaml │ │ ├── allow_list.yaml │ │ ├── cron_triggers.yaml │ │ ├── databases │ │ │ ├── databases.yaml │ │ │ └── default │ │ │ │ └── tables │ │ │ │ └── public_book.yaml │ │ ├── query_collections.yaml │ │ ├── remote_schemas.yaml │ │ └── version.yaml │ └── migrations │ │ └── default │ │ └── 1613663969839_init │ │ └── up.sql ├── hasura_logo.png ├── index.css ├── index.html ├── index.js └── package.json ├── serverless-push ├── Dockerfile ├── README.md ├── arch.png ├── cloudfunction │ ├── .gcloudignore │ ├── .gitignore │ ├── index.js │ └── package.json ├── favicon.png ├── firebase-messaging-sw.js ├── hasura │ ├── config.yaml │ ├── metadata │ │ ├── actions.graphql │ │ ├── actions.yaml │ │ ├── allow_list.yaml │ │ ├── cron_triggers.yaml │ │ ├── databases │ │ │ ├── databases.yaml │ │ │ └── default │ │ │ │ └── tables │ │ │ │ └── public_message.yaml │ │ ├── query_collections.yaml │ │ ├── remote_schemas.yaml │ │ └── version.yaml │ └── migrations │ │ └── default │ │ └── 1613664119718_init │ │ └── up.sql ├── hasura_logo.png ├── index.css ├── index.html ├── index.js ├── manifest.json └── package.json ├── streaming-subscriptions-chat ├── .dockerignore ├── .gitignore ├── Dockerfile ├── README.md ├── docker-compose.yml ├── hasura │ ├── config.yaml │ ├── metadata │ │ ├── actions.graphql │ │ ├── actions.yaml │ │ ├── allow_list.yaml │ │ ├── cron_triggers.yaml │ │ ├── databases │ │ │ ├── databases.yaml │ │ │ └── default │ │ │ │ └── tables │ │ │ │ ├── public_message.yaml │ │ │ │ ├── public_user.yaml │ │ │ │ ├── public_user_online.yaml │ │ │ │ └── public_user_typing.yaml │ │ ├── query_collections.yaml │ │ ├── remote_schemas.yaml │ │ └── version.yaml │ └── migrations │ │ └── default │ │ └── 1613650170829_init │ │ └── up.sql ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── favicon.png │ ├── index.html │ └── manifest.json └── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── components │ ├── Banner.js │ ├── BetaAccessForm.js │ ├── Chat.js │ ├── ChatWrapper.js │ ├── ExternalLinkIcon.js │ ├── LandingPage.js │ ├── Main.js │ ├── MessageList.js │ ├── OnlineUsers.js │ ├── RenderMessages.js │ ├── Textbox.js │ └── TypingIndicator.js │ ├── hasura_logo_200.png │ ├── hooks │ └── useInterval.js │ ├── images │ ├── React-logo.png │ ├── auth.png │ ├── chat-app-bg.jpg │ ├── chat-app.png │ ├── graphql.png │ └── green-logo-white.svg │ ├── index.css │ ├── index.js │ ├── logo.svg │ ├── reportWebVitals.js │ └── styles │ ├── StyledChatApp.js │ └── theme.js ├── svelte-apollo ├── .gitignore ├── README.md ├── now.json ├── package-lock.json ├── package.json ├── public │ ├── favicon.png │ ├── global.css │ └── index.html ├── rollup.config.js └── src │ ├── AddAuthor.svelte │ ├── App.svelte │ ├── Articles.svelte │ ├── Authors.svelte │ ├── AuthorsSubscription.svelte │ ├── apollo.js │ └── main.js ├── tic-tac-toe-react ├── README.md ├── client │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.png │ │ ├── index.html │ │ └── manifest.json │ └── src │ │ ├── App.css │ │ ├── App.js │ │ ├── App.test.js │ │ ├── Router.js │ │ ├── components │ │ ├── Boards │ │ │ ├── BoardsList.js │ │ │ └── BoardsWrapper.js │ │ ├── Game │ │ │ ├── Logs.js │ │ │ ├── Play.js │ │ │ └── TicTacToe.js │ │ ├── Navbar.js │ │ └── Utils.js │ │ ├── index.css │ │ ├── index.js │ │ ├── logo.svg │ │ └── utils.js ├── docker-compose.yaml ├── hasura │ ├── config.yaml │ ├── metadata │ │ ├── actions.graphql │ │ ├── actions.yaml │ │ ├── allow_list.yaml │ │ ├── cron_triggers.yaml │ │ ├── databases │ │ │ ├── databases.yaml │ │ │ └── default │ │ │ │ └── tables │ │ │ │ ├── public_board.yaml │ │ │ │ ├── public_move.yaml │ │ │ │ └── public_user.yaml │ │ ├── query_collections.yaml │ │ ├── remote_schemas.yaml │ │ └── version.yaml │ └── migrations │ │ └── default │ │ └── 1557215655320_init.up.sql └── remote-schema │ ├── .dockerignore │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── index.js │ ├── package-lock.json │ └── package.json ├── todo-auth0-jwt ├── .dockerignore ├── .gitignore ├── README.md ├── hasura │ ├── config.yaml │ ├── metadata │ │ ├── actions.graphql │ │ ├── actions.yaml │ │ ├── allow_list.yaml │ │ ├── cron_triggers.yaml │ │ ├── databases │ │ │ ├── databases.yaml │ │ │ └── default │ │ │ │ └── tables │ │ │ │ └── public_todo.yaml │ │ ├── query_collections.yaml │ │ ├── remote_schemas.yaml │ │ └── version.yaml │ └── migrations │ │ └── default │ │ └── 1613665146384_init │ │ └── up.sql └── todo-app │ ├── .gitignore │ ├── Dockerfile │ ├── exec.ps1 │ ├── exec.sh │ ├── package-lock.json │ ├── package.json │ ├── public │ ├── favicon.ico │ └── index.html │ └── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── Auth │ ├── Auth.js │ └── auth0-variables.js │ ├── Callback │ ├── Callback.js │ └── loading.svg │ ├── Home │ └── Home.js │ ├── Todo │ ├── Todo.css │ ├── Todo.js │ ├── TodoComponent.js │ ├── TodoInput.js │ ├── TodoList.js │ └── graphQueries │ │ └── todoQueries.js │ ├── constants.js │ ├── history.js │ ├── index.css │ ├── index.js │ └── routes.js ├── vuejs-auth0-graphql ├── .gitignore ├── app │ ├── .browserslistrc │ ├── .dockerignore │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── auth_config.json │ ├── babel.config.js │ ├── exec.ps1 │ ├── exec.sh │ ├── loading.svg │ ├── package-lock.json │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ └── logo.png │ ├── server.js │ ├── src │ │ ├── App.vue │ │ ├── assets │ │ │ └── loading.svg │ │ ├── auth │ │ │ └── authService.js │ │ ├── components │ │ │ ├── Callback.vue │ │ │ └── NavBar.vue │ │ ├── directives │ │ │ └── highlight.js │ │ ├── main.js │ │ ├── plugins │ │ │ └── auth.js │ │ ├── router.js │ │ ├── views │ │ │ ├── Home.vue │ │ │ └── Profile.vue │ │ └── vue-apollo.js │ └── vue.config.js └── hasura │ ├── config.yaml │ ├── metadata │ ├── actions.graphql │ ├── actions.yaml │ ├── allow_list.yaml │ ├── cron_triggers.yaml │ ├── databases │ │ ├── databases.yaml │ │ └── default │ │ │ └── tables │ │ │ ├── public_article.yaml │ │ │ └── public_users.yaml │ ├── query_collections.yaml │ ├── remote_schemas.yaml │ └── version.yaml │ └── migrations │ └── default │ └── 1613664247608_init │ └── up.sql ├── vuetify-vuex-todo-graphql ├── .browserslistrc ├── .eslintrc.js ├── .gitignore ├── .postcssrc.js ├── README.md ├── babel.config.js ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── img │ │ └── icons │ │ │ ├── android-chrome-192x192.png │ │ │ ├── android-chrome-512x512.png │ │ │ ├── apple-touch-icon-120x120.png │ │ │ ├── apple-touch-icon-152x152.png │ │ │ ├── apple-touch-icon-180x180.png │ │ │ ├── apple-touch-icon-60x60.png │ │ │ ├── apple-touch-icon-76x76.png │ │ │ ├── apple-touch-icon.png │ │ │ ├── favicon-16x16.png │ │ │ ├── favicon-32x32.png │ │ │ ├── msapplication-icon-144x144.png │ │ │ ├── mstile-150x150.png │ │ │ └── safari-pinned-tab.svg │ ├── index.html │ ├── manifest.json │ └── robots.txt ├── src │ ├── App.vue │ ├── apollo.js │ ├── assets │ │ └── logo.png │ ├── components │ │ ├── FooterInfo.vue │ │ └── TodoItem.vue │ ├── main.js │ ├── registerServiceWorker.js │ ├── router.js │ ├── store.js │ ├── views │ │ └── Home.vue │ └── vuetify.js └── vue.config.js └── whatsapp-clone-typescript-react ├── README.md ├── auth-server ├── .dockerignore ├── .gitignore ├── Dockerfile ├── Procfile ├── README.md ├── app.js ├── config │ └── passport.js ├── controllers │ └── user.js ├── db │ ├── errors.js │ ├── migrations │ │ └── 20180917160913_users.js │ └── schema.js ├── knexfile.js ├── package-lock.json └── package.json ├── hasura ├── config.yaml ├── metadata │ ├── actions.graphql │ ├── actions.yaml │ ├── allow_list.yaml │ ├── cron_triggers.yaml │ ├── databases │ │ ├── databases.yaml │ │ └── default │ │ │ └── tables │ │ │ ├── public_chat.yaml │ │ │ ├── public_chat_group_admins.yaml │ │ │ ├── public_chat_users.yaml │ │ │ ├── public_message.yaml │ │ │ ├── public_message_user.yaml │ │ │ ├── public_recipient.yaml │ │ │ └── public_users.yaml │ ├── query_collections.yaml │ ├── remote_schemas.yaml │ └── version.yaml └── migrations │ └── default │ └── 1613665372189_init │ └── up.sql └── react-app ├── .dockerignore ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── codegen-interpreter.ts ├── codegen.js ├── now.json ├── package.json ├── public ├── assets │ ├── chat-background.jpg │ ├── default-group-pic.jpg │ ├── default-profile-pic.jpg │ └── whatsapp-icon.png ├── favicon.png ├── index.html └── manifest.json ├── renovate.json ├── src ├── App.css ├── App.test.tsx ├── App.tsx ├── apollo-client.ts ├── components │ ├── AnimatedSwitch.tsx │ ├── AuthScreen │ │ ├── SignInForm.tsx │ │ ├── SignUpForm.tsx │ │ └── index.tsx │ ├── ChatRoomScreen │ │ ├── ChatNavbar.tsx │ │ ├── MessageBox.tsx │ │ ├── MessagesList.tsx │ │ └── index.tsx │ ├── ChatsListScreen │ │ ├── AddChatButton.tsx │ │ ├── ChatsList.tsx │ │ ├── ChatsNavbar.tsx │ │ └── index.tsx │ ├── GroupDetailsScreen │ │ ├── CompleteGroupButton.tsx │ │ ├── GroupDetailsNavbar.tsx │ │ └── index.tsx │ ├── Navbar.tsx │ ├── NewChatScreen │ │ ├── NewChatNavbar.tsx │ │ ├── NewGroupButton.tsx │ │ └── index.tsx │ ├── NewGroupScreen │ │ ├── CreateGroupButton.tsx │ │ ├── NewGroupNavbar.tsx │ │ └── index.tsx │ ├── SettingsScreen │ │ ├── SettingsForm.tsx │ │ ├── SettingsNavbar.tsx │ │ └── index.tsx │ └── UsersList.tsx ├── graphql │ ├── .gitignore │ ├── fragments │ │ ├── chat.fragment.ts │ │ ├── index.ts │ │ ├── message.fragment.ts │ │ ├── messageUser.fragment.ts │ │ └── user.fragment.ts │ ├── queries │ │ ├── chats.query.ts │ │ ├── index.ts │ │ ├── me.query.ts │ │ └── users.query.ts │ └── subscriptions │ │ ├── chatUpdated.subscription.ts │ │ ├── index.ts │ │ ├── messageAdded.subscription.ts │ │ └── userUpdated.subscription.ts ├── index.css ├── index.tsx ├── logo.svg ├── polyfills │ └── react-apollo-hooks.ts ├── react-app-env.d.ts ├── serviceWorker.js └── services │ ├── auth.service.tsx │ ├── cache.service.tsx │ └── picture.service.tsx ├── tsconfig.json ├── tslint.json └── yarn.lock /firebase-jwt/.gitignore: -------------------------------------------------------------------------------- 1 | firebase.json 2 | .firebaserc 3 | node_modules 4 | config.js 5 | -------------------------------------------------------------------------------- /firebase-jwt/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Firebase Auth + Hasura JWT example 4 | 5 | 6 |

Firebase Auth + Hasura JWT example

7 |
8 | Email: 9 | Password: 10 | 11 |
12 | 13 |
14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /firebase-jwt/functions/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "functions", 3 | "description": "Cloud Functions for Firebase", 4 | "scripts": { 5 | "serve": "firebase serve --only functions", 6 | "shell": "firebase functions:shell", 7 | "start": "npm run shell", 8 | "deploy": "firebase deploy --only functions", 9 | "logs": "firebase functions:log" 10 | }, 11 | "dependencies": { 12 | "firebase-admin": "~6.0.0", 13 | "firebase-functions": "^2.0.3" 14 | }, 15 | "private": true 16 | } 17 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/app/.env.EXAMPLE: -------------------------------------------------------------------------------- 1 | # ./.env 2 | # Get these values at https://manage.auth0.com and create a new file called .env.development 3 | AUTH0_DOMAIN= 4 | AUTH0_CLIENTID= 5 | AUTH0_CALLBACK= -------------------------------------------------------------------------------- /gatsby-contentful-auth0/app/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "endOfLine": "lf", 3 | "semi": false, 4 | "singleQuote": false, 5 | "tabWidth": 2, 6 | "trailingComma": "es5" 7 | } 8 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/app/gatsby-config.js: -------------------------------------------------------------------------------- 1 | const fetch = require(`node-fetch`) 2 | const { createHttpLink } = require(`apollo-link-http`) 3 | 4 | module.exports = { 5 | plugins: [ 6 | { 7 | resolve: 'gatsby-source-graphql', 8 | options: { 9 | typeName: 'HASURA', 10 | fieldName: 'hasura', 11 | createLink: (pluginOptions) => { 12 | return createHttpLink({ 13 | uri: 'http://localhost:8080/v1/graphql', 14 | headers: { 15 | }, 16 | fetch, 17 | }) 18 | }, 19 | }, 20 | }, 21 | ] 22 | }; 23 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/app/src/components/style.css: -------------------------------------------------------------------------------- 1 | nav > a { 2 | padding: 10px 5px; 3 | } 4 | .newPlaylistSection { 5 | padding-top: 10px; 6 | } 7 | .newPlaylist { 8 | padding: 10px 0px; 9 | } 10 | .playlistBtn { 11 | padding: 5px 10px; 12 | border-radius: 2px; 13 | border-color: lightgreen; 14 | } -------------------------------------------------------------------------------- /gatsby-contentful-auth0/app/src/pages/callback.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { handleAuthentication } from "../utils/auth" 3 | 4 | const Callback = () => { 5 | handleAuthentication() 6 | 7 | return

Loading...

8 | } 9 | 10 | export default Callback 11 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/app/src/pages/index.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | import { Link } from "gatsby" 3 | 4 | export default () => ( 5 |
6 |

Hello Gatsby!

7 | Go to your account 8 |
9 | ) 10 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/app/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/gatsby-contentful-auth0/app/static/favicon.ico -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080/ 3 | api_paths: 4 | v1_query: v1/query 5 | v2_query: v2/query 6 | v1_metadata: v1/metadata 7 | graphql: v1/graphql 8 | config: v1alpha1/config 9 | pg_dump: v1alpha1/pg_dump 10 | version: v1/version 11 | metadata_directory: metadata 12 | migrations_directory: migrations 13 | seeds_directory: seeds 14 | actions: 15 | kind: synchronous 16 | handler_webhook_baseurl: http://localhost:3000 17 | codegen: 18 | framework: "" 19 | output_dir: "" 20 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/gatsby-contentful-auth0/hasura/metadata/actions.graphql -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: default 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | database_url: 6 | from_env: SAMPLE_APPS_DATABASE_URL 7 | isolation_level: read-committed 8 | pool_settings: 9 | connection_lifetime: 600 10 | idle_timeout: 180 11 | max_connections: 50 12 | retries: 1 13 | use_prepared_statements: false 14 | tables: "!include default/tables/tables.yaml" 15 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/metadata/databases/default/tables/public_album.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: album 3 | schema: public 4 | array_relationships: 5 | - name: tracks 6 | using: 7 | foreign_key_constraint_on: 8 | column: album_id 9 | table: 10 | name: track 11 | schema: public 12 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/metadata/databases/default/tables/public_playlist.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: playlist 3 | schema: public 4 | object_relationships: 5 | - name: user 6 | using: 7 | foreign_key_constraint_on: user_id 8 | array_relationships: 9 | - name: playlist_tracks 10 | using: 11 | foreign_key_constraint_on: 12 | column: playlist_id 13 | table: 14 | name: playlist_track 15 | schema: public 16 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/metadata/databases/default/tables/public_playlist_track.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: playlist_track 3 | schema: public 4 | object_relationships: 5 | - name: playlist 6 | using: 7 | foreign_key_constraint_on: playlist_id 8 | - name: track 9 | using: 10 | foreign_key_constraint_on: track_id 11 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/metadata/databases/default/tables/public_track.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: track 3 | schema: public 4 | object_relationships: 5 | - name: album 6 | using: 7 | foreign_key_constraint_on: album_id 8 | array_relationships: 9 | - name: playlist_tracks 10 | using: 11 | foreign_key_constraint_on: 12 | column: track_id 13 | table: 14 | name: playlist_track 15 | schema: public 16 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/metadata/databases/default/tables/public_users.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: users 3 | schema: public 4 | array_relationships: 5 | - name: playlists 6 | using: 7 | foreign_key_constraint_on: 8 | column: user_id 9 | table: 10 | name: playlist 11 | schema: public 12 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/metadata/databases/default/tables/tables.yaml: -------------------------------------------------------------------------------- 1 | - "!include public_album.yaml" 2 | - "!include public_playlist.yaml" 3 | - "!include public_playlist_track.yaml" 4 | - "!include public_track.yaml" 5 | - "!include public_users.yaml" 6 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/metadata/rest_endpoints.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /gatsby-contentful-auth0/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/assets/add_table.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/gatsby-postgres-graphql/assets/add_table.jpg -------------------------------------------------------------------------------- /gatsby-postgres-graphql/assets/browse_rows.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/gatsby-postgres-graphql/assets/browse_rows.jpg -------------------------------------------------------------------------------- /gatsby-postgres-graphql/assets/gatsby-postgres-graphql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/gatsby-postgres-graphql/assets/gatsby-postgres-graphql.png -------------------------------------------------------------------------------- /gatsby-postgres-graphql/assets/insert_data.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/gatsby-postgres-graphql/assets/insert_data.jpg -------------------------------------------------------------------------------- /gatsby-postgres-graphql/assets/test_app.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/gatsby-postgres-graphql/assets/test_app.jpg -------------------------------------------------------------------------------- /gatsby-postgres-graphql/config.yaml: -------------------------------------------------------------------------------- 1 | endpoint: https://gatsby-graphql.hasura.app 2 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/gatsby-browser.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { ApolloProvider } from "@apollo/react-hooks"; 3 | import { client } from "./src/utils/apollo"; 4 | 5 | export const wrapRootElement = ({ element }) => ( 6 | {element} 7 | ); 8 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/gatsby-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | { 4 | resolve: "gatsby-source-graphql", 5 | options: { 6 | typeName: "HASURA", 7 | fieldName: "hasura", 8 | url: process.env.GATSBY_HASURA_GRAPHQL_URL, 9 | refetchInterval: 10 // Refresh every 60 seconds for new data 10 | } 11 | } 12 | ] 13 | }; 14 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/gatsby-ssr.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { ApolloProvider } from "@apollo/react-hooks"; 3 | import { client } from "./src/utils/apollo"; 4 | 5 | export const wrapRootElement = ({ element }) => ( 6 | {element} 7 | ); 8 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080/ 3 | api_paths: 4 | v1_query: v1/query 5 | v2_query: v2/query 6 | v1_metadata: v1/metadata 7 | graphql: v1/graphql 8 | config: v1alpha1/config 9 | pg_dump: v1alpha1/pg_dump 10 | version: v1/version 11 | metadata_directory: metadata 12 | migrations_directory: migrations 13 | seeds_directory: seeds 14 | actions: 15 | kind: synchronous 16 | handler_webhook_baseurl: http://localhost:3000 17 | codegen: 18 | framework: "" 19 | output_dir: "" 20 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/hasura/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: default 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | database_url: 6 | from_env: SAMPLE_APPS_DATABASE_URL 7 | pool_settings: 8 | idle_timeout: 180 9 | max_connections: 50 10 | retries: 1 11 | tables: 12 | - "!include default/tables/public_author.yaml" 13 | functions: [] 14 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/hasura/metadata/databases/default/tables/public_author.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: author 3 | schema: public 4 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/hasura/migrations/default/1613663714522_init/up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE public.author ( 2 | id integer NOT NULL, 3 | name text NOT NULL 4 | ); 5 | CREATE SEQUENCE public.author_id_seq 6 | AS integer 7 | START WITH 1 8 | INCREMENT BY 1 9 | NO MINVALUE 10 | NO MAXVALUE 11 | CACHE 1; 12 | ALTER SEQUENCE public.author_id_seq OWNED BY public.author.id; 13 | ALTER TABLE ONLY public.author ALTER COLUMN id SET DEFAULT nextval('public.author_id_seq'::regclass); 14 | ALTER TABLE ONLY public.author 15 | ADD CONSTRAINT author_pkey PRIMARY KEY (id); 16 | -------------------------------------------------------------------------------- /gatsby-postgres-graphql/src/pages/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | import AddAuthor from "../components/AddAuthor"; 4 | import AuthorList from "../components/AuthorList"; 5 | 6 | const Index = () => ( 7 |
8 |

My Authors

9 | 10 | 11 |
12 | ); 13 | 14 | export default Index; -------------------------------------------------------------------------------- /gatsby-postgres-graphql/src/utils/apollo.js: -------------------------------------------------------------------------------- 1 | import ApolloClient from "apollo-boost"; 2 | import fetch from "isomorphic-fetch"; 3 | 4 | export const client = new ApolloClient({ 5 | uri: process.env.GATSBY_HASURA_GRAPHQL_URL, 6 | fetch 7 | }); 8 | -------------------------------------------------------------------------------- /graphql-benchmark/docker-compose.node.yml: -------------------------------------------------------------------------------- 1 | services: 2 | postgres: 3 | image: postgres:15 4 | restart: always 5 | volumes: 6 | - db_data:/var/lib/postgresql/data 7 | ports: 8 | - "5432:5432" 9 | environment: 10 | POSTGRES_PASSWORD: postgrespassword 11 | node: 12 | build: ./nodejs 13 | ports: 14 | - "8080:8080" 15 | depends_on: 16 | - "postgres" 17 | volumes: 18 | db_data: 19 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080 3 | metadata_directory: metadata 4 | actions: 5 | kind: synchronous 6 | handler_webhook_baseurl: http://localhost:3000 7 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/graphql-benchmark/hasura/metadata/actions.graphql -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/api_limits.yaml: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/backend_configs.yaml: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: default 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | database_url: 6 | from_env: PG_DATABASE_URL 7 | isolation_level: read-committed 8 | use_prepared_statements: false 9 | tables: "!include default/tables/tables.yaml" 10 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/databases/default/tables/public_Album.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: Album 3 | schema: public 4 | object_relationships: 5 | - name: Artist 6 | using: 7 | foreign_key_constraint_on: ArtistId 8 | array_relationships: 9 | - name: Tracks 10 | using: 11 | foreign_key_constraint_on: 12 | column: AlbumId 13 | table: 14 | name: Track 15 | schema: public 16 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/databases/default/tables/public_Artist.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: Artist 3 | schema: public 4 | array_relationships: 5 | - name: Albums 6 | using: 7 | foreign_key_constraint_on: 8 | column: ArtistId 9 | table: 10 | name: Album 11 | schema: public 12 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/databases/default/tables/public_Customer.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: Customer 3 | schema: public 4 | object_relationships: 5 | - name: Employee 6 | using: 7 | foreign_key_constraint_on: SupportRepId 8 | array_relationships: 9 | - name: Invoices 10 | using: 11 | foreign_key_constraint_on: 12 | column: CustomerId 13 | table: 14 | name: Invoice 15 | schema: public 16 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/databases/default/tables/public_Employee.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: Employee 3 | schema: public 4 | object_relationships: 5 | - name: Employee 6 | using: 7 | foreign_key_constraint_on: ReportsTo 8 | array_relationships: 9 | - name: Customers 10 | using: 11 | foreign_key_constraint_on: 12 | column: SupportRepId 13 | table: 14 | name: Customer 15 | schema: public 16 | - name: Employees 17 | using: 18 | foreign_key_constraint_on: 19 | column: ReportsTo 20 | table: 21 | name: Employee 22 | schema: public 23 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/databases/default/tables/public_Genre.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: Genre 3 | schema: public 4 | array_relationships: 5 | - name: Tracks 6 | using: 7 | foreign_key_constraint_on: 8 | column: GenreId 9 | table: 10 | name: Track 11 | schema: public 12 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/databases/default/tables/public_Invoice.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: Invoice 3 | schema: public 4 | object_relationships: 5 | - name: Customer 6 | using: 7 | foreign_key_constraint_on: CustomerId 8 | array_relationships: 9 | - name: InvoiceLines 10 | using: 11 | foreign_key_constraint_on: 12 | column: InvoiceId 13 | table: 14 | name: InvoiceLine 15 | schema: public 16 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/databases/default/tables/public_InvoiceLine.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: InvoiceLine 3 | schema: public 4 | object_relationships: 5 | - name: Invoice 6 | using: 7 | foreign_key_constraint_on: InvoiceId 8 | - name: Track 9 | using: 10 | foreign_key_constraint_on: TrackId 11 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/databases/default/tables/public_MediaType.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: MediaType 3 | schema: public 4 | array_relationships: 5 | - name: Tracks 6 | using: 7 | foreign_key_constraint_on: 8 | column: MediaTypeId 9 | table: 10 | name: Track 11 | schema: public 12 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/databases/default/tables/public_Playlist.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: Playlist 3 | schema: public 4 | array_relationships: 5 | - name: PlaylistTracks 6 | using: 7 | foreign_key_constraint_on: 8 | column: PlaylistId 9 | table: 10 | name: PlaylistTrack 11 | schema: public 12 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/databases/default/tables/public_PlaylistTrack.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: PlaylistTrack 3 | schema: public 4 | object_relationships: 5 | - name: Playlist 6 | using: 7 | foreign_key_constraint_on: PlaylistId 8 | - name: Track 9 | using: 10 | foreign_key_constraint_on: TrackId 11 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/databases/default/tables/tables.yaml: -------------------------------------------------------------------------------- 1 | - "!include public_Album.yaml" 2 | - "!include public_Artist.yaml" 3 | - "!include public_Customer.yaml" 4 | - "!include public_Employee.yaml" 5 | - "!include public_Genre.yaml" 6 | - "!include public_Invoice.yaml" 7 | - "!include public_InvoiceLine.yaml" 8 | - "!include public_MediaType.yaml" 9 | - "!include public_Playlist.yaml" 10 | - "!include public_PlaylistTrack.yaml" 11 | - "!include public_Track.yaml" 12 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/graphql_schema_introspection.yaml: -------------------------------------------------------------------------------- 1 | disabled_for_roles: [] 2 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/inherited_roles.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/metrics_config.yaml: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/network.yaml: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/opentelemetry.yaml: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/rest_endpoints.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /graphql-benchmark/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /graphql-benchmark/nodejs/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /graphql-benchmark/nodejs/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | report.hasura.json 4 | report.node.json 5 | -------------------------------------------------------------------------------- /graphql-benchmark/nodejs/Dockerfile: -------------------------------------------------------------------------------- 1 | # https://www.andreadiotallevi.com/blog/how-to-create-a-production-image-for-a-node-typescript-app-using-docker-multi-stage-builds 2 | 3 | FROM node:18-alpine AS builder 4 | WORKDIR /app 5 | COPY . . 6 | RUN npm ci 7 | RUN npx tsc 8 | 9 | FROM node:18-alpine 10 | ENV NODE_ENV=production 11 | RUN apk add --no-cache tini 12 | WORKDIR /app 13 | COPY package.json . 14 | COPY package-lock.json . 15 | RUN npm ci --production 16 | COPY --from=builder ./app/dist ./dist 17 | COPY --from=builder ./app/src/schema.graphql ./dist 18 | EXPOSE 3000 19 | ENTRYPOINT [ "/sbin/tini", "--", "node", "dist/main.js" ] 20 | -------------------------------------------------------------------------------- /graphql-benchmark/nodejs/codegen.ts: -------------------------------------------------------------------------------- 1 | 2 | import type { CodegenConfig } from '@graphql-codegen/cli'; 3 | 4 | const config: CodegenConfig = { 5 | overwrite: true, 6 | schema: "./src/schema.graphql", 7 | generates: { 8 | "src/generated/graphql.ts": { 9 | plugins: ["typescript", "typescript-resolvers"] 10 | } 11 | } 12 | }; 13 | 14 | export default config; 15 | -------------------------------------------------------------------------------- /graphql-benchmark/nodejs/src/db.ts: -------------------------------------------------------------------------------- 1 | import postgres from 'postgres' 2 | 3 | const sql = postgres(process.env["PG_DATABASE_URL"] || 'postgres://postgres:postgrespassword@postgres:5432/postgres', { ssl: 'require' }); 4 | 5 | export default sql; 6 | -------------------------------------------------------------------------------- /graphql-benchmark/nodejs/src/utils.ts: -------------------------------------------------------------------------------- 1 | export function keyByArray(input: T[], id: keyof T) { 2 | return input.reduce((acc, result) => { 3 | const existing = acc[result[id] as string | number]; 4 | acc[result[id as keyof T] as string | number] = existing 5 | ? [...existing, result] 6 | : [result]; 7 | return acc; 8 | }, {} as Record); 9 | } 10 | -------------------------------------------------------------------------------- /graphql-benchmark/nodejs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/node18-strictest/tsconfig.json", 3 | "include": ["src"], 4 | "compilerOptions": { 5 | "outDir": "dist" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /gridsome-postgres-graphql/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | .cache 3 | .DS_Store 4 | src/.temp 5 | node_modules 6 | dist 7 | .env 8 | .env.* 9 | -------------------------------------------------------------------------------- /gridsome-postgres-graphql/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-gridsome-site", 3 | "private": true, 4 | "scripts": { 5 | "start": "gridsome develop", 6 | "build": "gridsome build", 7 | "develop": "gridsome develop", 8 | "explore": "gridsome explore" 9 | }, 10 | "dependencies": { 11 | "@gridsome/source-graphql": "^0.1.0", 12 | "gridsome": "^0.7.23" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /gridsome-postgres-graphql/src/components/README.md: -------------------------------------------------------------------------------- 1 | Add components that will be imported to Pages and Layouts to this folder. 2 | Learn more about components here: https://gridsome.org/docs/components 3 | 4 | You can delete this file. -------------------------------------------------------------------------------- /gridsome-postgres-graphql/src/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/gridsome-postgres-graphql/src/favicon.png -------------------------------------------------------------------------------- /gridsome-postgres-graphql/src/layouts/README.md: -------------------------------------------------------------------------------- 1 | Layout components are used to wrap pages and templates. Layouts should contain components like headers, footers or sidebars that will be used across the site. 2 | 3 | Learn more about Layouts: https://gridsome.org/docs/layouts 4 | 5 | You can delete this file. -------------------------------------------------------------------------------- /gridsome-postgres-graphql/src/main.js: -------------------------------------------------------------------------------- 1 | // This is the main.js file. Import global CSS and scripts here. 2 | // The Client API can be used here. Learn more: gridsome.org/docs/client-api 3 | 4 | import DefaultLayout from '~/layouts/Default.vue' 5 | 6 | export default function (Vue, { router, head, isClient }) { 7 | // Set default layout as a global component 8 | Vue.component('Layout', DefaultLayout) 9 | } 10 | -------------------------------------------------------------------------------- /gridsome-postgres-graphql/src/pages/README.md: -------------------------------------------------------------------------------- 1 | Pages are usually used for normal pages or for listing items from a GraphQL collection. 2 | Add .vue files here to create pages. For example **About.vue** will be **site.com/about**. 3 | Learn more about pages: https://gridsome.org/docs/pages 4 | 5 | You can delete this file. -------------------------------------------------------------------------------- /gridsome-postgres-graphql/src/templates/README.md: -------------------------------------------------------------------------------- 1 | Templates for **GraphQL collections** should be added here. 2 | To create a template for a collection called `WordPressPost` 3 | create a file named `WordPressPost.vue` in this folder. 4 | 5 | Learn more: https://gridsome.org/docs/templates 6 | 7 | You can delete this file. -------------------------------------------------------------------------------- /gridsome-postgres-graphql/static/README.md: -------------------------------------------------------------------------------- 1 | Add static files here. Files in this directory will be copied directly to `dist` folder during build. For example, /static/robots.txt will be located at https://yoursite.com/robots.txt. 2 | 3 | This file should be deleted. -------------------------------------------------------------------------------- /nextjs-13/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /nextjs-13/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | .pnpm-debug.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | -------------------------------------------------------------------------------- /nextjs-13/app/globals.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | padding: 0; 4 | margin: 0; 5 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, 6 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; 7 | } 8 | 9 | a { 10 | color: inherit; 11 | text-decoration: none; 12 | } 13 | 14 | * { 15 | box-sizing: border-box; 16 | } 17 | 18 | @media (prefers-color-scheme: dark) { 19 | html { 20 | color-scheme: dark; 21 | } 22 | body { 23 | color: white; 24 | background: black; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /nextjs-13/app/head.tsx: -------------------------------------------------------------------------------- 1 | export default function Head() { 2 | return ( 3 | <> 4 | Create Next App 5 | 6 | 7 | 8 | 9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /nextjs-13/app/loading.tsx: -------------------------------------------------------------------------------- 1 | export default function Loading() { 2 | // You can add any UI inside Loading, including a Skeleton. 3 | return
loading
; 4 | } 5 | -------------------------------------------------------------------------------- /nextjs-13/app/page.tsx: -------------------------------------------------------------------------------- 1 | export default async function Home() { 2 | return
Choose a product!
; 3 | } 4 | -------------------------------------------------------------------------------- /nextjs-13/client.ts: -------------------------------------------------------------------------------- 1 | import { GraphQLClient } from "graphql-request"; 2 | 3 | export const gqlClient = new GraphQLClient(process.env.NEXT_PUBLIC_HASURA_GRAPHQL_URL!, { fetch }); 4 | -------------------------------------------------------------------------------- /nextjs-13/gql/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./gql" 2 | export * from "./fragment-masking" -------------------------------------------------------------------------------- /nextjs-13/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080 3 | admin_secret: my-secret 4 | metadata_directory: metadata 5 | actions: 6 | kind: synchronous 7 | handler_webhook_baseurl: http://localhost:3000 8 | -------------------------------------------------------------------------------- /nextjs-13/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-13/hasura/metadata/api_limits.yaml: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /nextjs-13/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-13/hasura/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: default 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | use_prepared_statements: false 6 | database_url: 7 | from_env: PG_DATABASE_URL 8 | isolation_level: read-committed 9 | tables: '!include default/tables/tables.yaml' 10 | -------------------------------------------------------------------------------- /nextjs-13/hasura/metadata/databases/default/tables/public_site_admin.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | schema: public 3 | name: site_admin 4 | insert_permissions: 5 | - role: site-admin 6 | permission: 7 | check: {} 8 | columns: '*' 9 | select_permissions: 10 | - role: site-admin 11 | permission: 12 | columns: '*' 13 | filter: {} 14 | update_permissions: 15 | - role: site-admin 16 | permission: 17 | columns: '*' 18 | filter: {} 19 | check: null 20 | delete_permissions: 21 | - role: site-admin 22 | permission: 23 | filter: {} 24 | -------------------------------------------------------------------------------- /nextjs-13/hasura/metadata/databases/default/tables/tables.yaml: -------------------------------------------------------------------------------- 1 | - '!include public_address.yaml' 2 | - '!include public_order.yaml' 3 | - '!include public_order_product.yaml' 4 | - '!include public_order_status.yaml' 5 | - '!include public_product.yaml' 6 | - '!include public_product_category_enum.yaml' 7 | - '!include public_product_review.yaml' 8 | - '!include public_site_admin.yaml' 9 | - '!include public_user.yaml' 10 | -------------------------------------------------------------------------------- /nextjs-13/hasura/metadata/graphql_schema_introspection.yaml: -------------------------------------------------------------------------------- 1 | disabled_for_roles: [] 2 | -------------------------------------------------------------------------------- /nextjs-13/hasura/metadata/inherited_roles.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-13/hasura/metadata/network.yaml: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /nextjs-13/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-13/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-13/hasura/metadata/rest_endpoints.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-13/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /nextjs-13/hasura/seeds/default/04_default_user_login_seeds.sql: -------------------------------------------------------------------------------- 1 | -- "password" bcrypted = $2y$10$4fLjiqiJ.Rh0F/qYfIfCeOy7a9nLJN49YzUEJbYnj2ZsiwVhGsOxK 2 | INSERT INTO public.user 3 | (name, email, password) 4 | VALUES 5 | ('Person', 'user@site.com', '$2y$10$4fLjiqiJ.Rh0F/qYfIfCeOy7a9nLJN49YzUEJbYnj2ZsiwVhGsOxK'); 6 | 7 | INSERT INTO public.site_admin 8 | (name, email, password) 9 | VALUES 10 | ('Admin', 'admin@site.com', '$2y$10$4fLjiqiJ.Rh0F/qYfIfCeOy7a9nLJN49YzUEJbYnj2ZsiwVhGsOxK'); 11 | -------------------------------------------------------------------------------- /nextjs-13/lib/gql/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./gql" 2 | export * from "./fragment-masking" -------------------------------------------------------------------------------- /nextjs-13/lib/service/client.ts: -------------------------------------------------------------------------------- 1 | import { GraphQLClient } from "graphql-request"; 2 | 3 | export const gqlClient = new GraphQLClient(process.env.NEXT_PUBLIC_HASURA_GRAPHQL_URL!, { fetch }); 4 | -------------------------------------------------------------------------------- /nextjs-13/lib/service/queries.graphql: -------------------------------------------------------------------------------- 1 | query GetProducts { 2 | product(limit: 10) { 3 | id 4 | name 5 | } 6 | } 7 | 8 | query GetProduct($id: Int!) { 9 | product_by_pk(id: $id) { 10 | id 11 | description 12 | name 13 | price 14 | image_urls(path: "$[0]") 15 | } 16 | } 17 | 18 | mutation PlaceOrder($products: order_product_arr_rel_insert_input!) { 19 | insert_order_one( 20 | object: { 21 | products: $products 22 | billing_address_id: 222 23 | user_id: 225 24 | shipping_address_id: 222 25 | } 26 | ) { 27 | id 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /nextjs-13/next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | experimental: { 4 | appDir: true, 5 | runtime: "experimental-edge", 6 | }, 7 | images: { 8 | remotePatterns: [ 9 | { 10 | protocol: "http", 11 | hostname: "img6a.flixcart.com", 12 | }, 13 | { 14 | protocol: "http", 15 | hostname: "img5a.flixcart.com", 16 | }, 17 | ], 18 | }, 19 | }; 20 | 21 | module.exports = nextConfig; 22 | -------------------------------------------------------------------------------- /nextjs-13/pages/api/hello.ts: -------------------------------------------------------------------------------- 1 | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction 2 | import type { NextApiRequest, NextApiResponse } from 'next' 3 | 4 | type Data = { 5 | name: string 6 | } 7 | 8 | export default function handler( 9 | req: NextApiRequest, 10 | res: NextApiResponse 11 | ) { 12 | res.status(200).json({ name: 'John Doe' }) 13 | } 14 | -------------------------------------------------------------------------------- /nextjs-13/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/nextjs-13/public/favicon.ico -------------------------------------------------------------------------------- /nextjs-13/queries.graphql: -------------------------------------------------------------------------------- 1 | query GetProducts { 2 | product(limit: 10) { 3 | id 4 | name 5 | } 6 | } 7 | 8 | query GetProduct($id: Int!) { 9 | product_by_pk(id: $id) { 10 | id 11 | description 12 | name 13 | price 14 | image_urls(path: "$[0]") 15 | } 16 | } 17 | 18 | mutation PlaceOrder($products: order_product_arr_rel_insert_input!) { 19 | insert_order_one( 20 | object: { 21 | products: $products 22 | billing_address_id: 222 23 | user_id: 225 24 | shipping_address_id: 222 25 | } 26 | ) { 27 | id 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /nextjs-13/service/client.ts: -------------------------------------------------------------------------------- 1 | import { GraphQLClient } from "graphql-request"; 2 | 3 | export const gqlClient = new GraphQLClient(process.env.NEXT_PUBLIC_HASURA_GRAPHQL_URL!, { fetch }); 4 | -------------------------------------------------------------------------------- /nextjs-13/service/queries.graphql: -------------------------------------------------------------------------------- 1 | query GetProducts { 2 | product(limit: 10) { 3 | id 4 | name 5 | } 6 | } 7 | 8 | query GetProduct($id: Int!) { 9 | product_by_pk(id: $id) { 10 | id 11 | description 12 | name 13 | price 14 | image_urls(path: "$[0]") 15 | } 16 | } 17 | 18 | mutation PlaceOrder($products: order_product_arr_rel_insert_input!) { 19 | insert_order_one( 20 | object: { 21 | products: $products 22 | billing_address_id: 222 23 | user_id: 225 24 | shipping_address_id: 222 25 | } 26 | ) { 27 | id 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/app/next.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | target: "serverless" 3 | } -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/app/now.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "builds": [ 4 | { "src": "next.config.js", "use": "@now/next" } 5 | ] 6 | } -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/app/pages/_app.js: -------------------------------------------------------------------------------- 1 | import App, { Container } from 'next/app' 2 | import React from 'react' 3 | import withApolloClient from '../lib/with-apollo-client' 4 | import { ApolloProvider } from 'react-apollo' 5 | 6 | class MyApp extends App { 7 | render () { 8 | const { Component, pageProps, apolloClient } = this.props 9 | return ( 10 | 11 | 12 | 13 | 14 | 15 | ) 16 | } 17 | } 18 | 19 | export default withApolloClient(MyApp) 20 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/app/pages/articles.js: -------------------------------------------------------------------------------- 1 | import Router from 'next/router' 2 | import fetch from 'isomorphic-unfetch' 3 | import nextCookie from 'next-cookies' 4 | import Layout from '../components/layout' 5 | import ArticleList from '../components/ArticleList' 6 | import { withAuthSync } from '../utils/auth' 7 | 8 | const Articles = props => { 9 | return ( 10 | 11 | 12 | 13 | ) 14 | } 15 | 16 | export default withAuthSync(Articles) 17 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080/ 3 | api_paths: 4 | v1_query: v1/query 5 | v2_query: v2/query 6 | v1_metadata: v1/metadata 7 | graphql: v1/graphql 8 | config: v1alpha1/config 9 | pg_dump: v1alpha1/pg_dump 10 | version: v1/version 11 | metadata_directory: metadata 12 | migrations_directory: migrations 13 | seeds_directory: seeds 14 | actions: 15 | kind: synchronous 16 | handler_webhook_baseurl: http://localhost:3000 17 | codegen: 18 | framework: "" 19 | output_dir: "" 20 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/nextjs-8-serverless/with-apollo-jwt/hasura/metadata/actions.graphql -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/hasura/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: default 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | database_url: 6 | from_env: SAMPLE_APPS_DATABASE_URL 7 | isolation_level: read-committed 8 | pool_settings: 9 | connection_lifetime: 600 10 | idle_timeout: 180 11 | max_connections: 50 12 | retries: 1 13 | use_prepared_statements: false 14 | tables: "!include default/tables/tables.yaml" 15 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/hasura/metadata/databases/default/tables/public_article.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: article 3 | schema: public 4 | object_relationships: 5 | - name: user 6 | using: 7 | foreign_key_constraint_on: user_id 8 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/hasura/metadata/databases/default/tables/public_role.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: role 3 | schema: public 4 | array_relationships: 5 | - name: user_roles 6 | using: 7 | foreign_key_constraint_on: 8 | column: role_id 9 | table: 10 | name: user_role 11 | schema: public 12 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/hasura/metadata/databases/default/tables/public_user.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: user 3 | schema: public 4 | array_relationships: 5 | - name: articles 6 | using: 7 | foreign_key_constraint_on: 8 | column: user_id 9 | table: 10 | name: article 11 | schema: public 12 | - name: user_roles 13 | using: 14 | foreign_key_constraint_on: 15 | column: user_id 16 | table: 17 | name: user_role 18 | schema: public 19 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/hasura/metadata/databases/default/tables/public_user_role.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: user_role 3 | schema: public 4 | object_relationships: 5 | - name: role 6 | using: 7 | foreign_key_constraint_on: role_id 8 | - name: user 9 | using: 10 | foreign_key_constraint_on: user_id 11 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/hasura/metadata/databases/default/tables/tables.yaml: -------------------------------------------------------------------------------- 1 | - "!include public_article.yaml" 2 | - "!include public_role.yaml" 3 | - "!include public_user.yaml" 4 | - "!include public_user_role.yaml" 5 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/hasura/metadata/rest_endpoints.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo-jwt/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo/components/ErrorMessage.js: -------------------------------------------------------------------------------- 1 | export default ({ message }) => ( 2 | 13 | ) 14 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo/next.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | target: "serverless" 3 | } -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo/now.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "builds": [ 4 | { "src": "next.config.js", "use": "@now/next" } 5 | ] 6 | } -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo/pages/_app.js: -------------------------------------------------------------------------------- 1 | import App, { Container } from 'next/app' 2 | import React from 'react' 3 | import withApolloClient from '../lib/with-apollo-client' 4 | import { ApolloProvider } from 'react-apollo' 5 | 6 | class MyApp extends App { 7 | render () { 8 | const { Component, pageProps, apolloClient } = this.props 9 | return ( 10 | 11 | 12 | 13 | 14 | 15 | ) 16 | } 17 | } 18 | 19 | export default withApolloClient(MyApp) 20 | -------------------------------------------------------------------------------- /nextjs-8-serverless/with-apollo/pages/index.js: -------------------------------------------------------------------------------- 1 | import App from '../components/App' 2 | import Header from '../components/Header' 3 | import AuthorList from '../components/AuthorList' 4 | 5 | export default () => ( 6 | 7 |
8 | 9 | 10 | ) 11 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/.env.local.example: -------------------------------------------------------------------------------- 1 | SECRET_TOKEN=HELLO -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080 3 | metadata_directory: metadata 4 | actions: 5 | kind: synchronous 6 | handler_webhook_baseurl: http://localhost:3000 7 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/nextjs-incremental-static-regeneration/hasura/metadata/actions.graphql -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/hasura/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: default 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | database_url: 6 | from_env: PG_DATABASE_URL 7 | isolation_level: read-committed 8 | use_prepared_statements: false 9 | tables: "!include default/tables/tables.yaml" 10 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/hasura/metadata/databases/default/tables/public_post.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: post 3 | schema: public 4 | event_triggers: 5 | - definition: 6 | delete: 7 | columns: "*" 8 | enable_manual: true 9 | insert: 10 | columns: "*" 11 | update: 12 | columns: "*" 13 | headers: 14 | - name: SECRET 15 | value_from_env: SECRET_TOKEN 16 | name: update_blog 17 | retry_conf: 18 | interval_sec: 10 19 | num_retries: 0 20 | timeout_sec: 60 21 | webhook: http://host.docker.internal:3000/api/revalidate 22 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/hasura/metadata/databases/default/tables/tables.yaml: -------------------------------------------------------------------------------- 1 | - "!include public_post.yaml" 2 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/hasura/metadata/rest_endpoints.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/hasura/migrations/default/1647304090289_init/up.sql: -------------------------------------------------------------------------------- 1 | SET check_function_bodies = false; 2 | CREATE TABLE public.post ( 3 | id uuid DEFAULT gen_random_uuid() NOT NULL, 4 | title text NOT NULL, 5 | content text NOT NULL 6 | ); 7 | ALTER TABLE ONLY public.post 8 | ADD CONSTRAINT blog_pkey PRIMARY KEY (id); 9 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | reactStrictMode: true, 4 | }; 5 | 6 | module.exports = nextConfig; 7 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/pages/_app.tsx: -------------------------------------------------------------------------------- 1 | import '../styles/globals.css' 2 | import type { AppProps } from 'next/app' 3 | 4 | function MyApp({ Component, pageProps }: AppProps) { 5 | return 6 | } 7 | 8 | export default MyApp 9 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/nextjs-incremental-static-regeneration/public/favicon.ico -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/styles/globals.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | padding: 0; 4 | margin: 0; 5 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, 6 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; 7 | } 8 | 9 | a { 10 | color: inherit; 11 | text-decoration: none; 12 | } 13 | 14 | * { 15 | box-sizing: border-box; 16 | } 17 | -------------------------------------------------------------------------------- /nextjs-incremental-static-regeneration/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "noEmit": true, 10 | "esModuleInterop": true, 11 | "module": "esnext", 12 | "moduleResolution": "node", 13 | "resolveJsonModule": true, 14 | "isolatedModules": true, 15 | "jsx": "preserve", 16 | "incremental": true 17 | }, 18 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], 19 | "exclude": ["node_modules"] 20 | } 21 | -------------------------------------------------------------------------------- /nextjs-postgres-graphql/.env.example: -------------------------------------------------------------------------------- 1 | NEXT_PUBLIC_HASURA_APP_URL='YOUR_HASURA_APP_URL' 2 | -------------------------------------------------------------------------------- /nextjs-postgres-graphql/.gitignore: -------------------------------------------------------------------------------- 1 | package-lock.json 2 | node_modules 3 | .next 4 | .env -------------------------------------------------------------------------------- /nextjs-postgres-graphql/assets/Permissions-Table-Data-Hasura.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/nextjs-postgres-graphql/assets/Permissions-Table-Data-Hasura.png -------------------------------------------------------------------------------- /nextjs-postgres-graphql/assets/add-variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/nextjs-postgres-graphql/assets/add-variable.png -------------------------------------------------------------------------------- /nextjs-postgres-graphql/assets/demo-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/nextjs-postgres-graphql/assets/demo-app.png -------------------------------------------------------------------------------- /nextjs-postgres-graphql/assets/hasura-variables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/nextjs-postgres-graphql/assets/hasura-variables.png -------------------------------------------------------------------------------- /nextjs-postgres-graphql/assets/nextjs-postgres-graphql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/nextjs-postgres-graphql/assets/nextjs-postgres-graphql.png -------------------------------------------------------------------------------- /nextjs-postgres-graphql/pages/AuthorList.js: -------------------------------------------------------------------------------- 1 | const AuthorList = ({ authors }) => ( 2 |
3 | {authors && 4 | authors.map((a, i) => ( 5 |
6 |

{a.name}

7 |
8 | ))} 9 |
10 | ); 11 | 12 | export default AuthorList; 13 | -------------------------------------------------------------------------------- /nuxtjs-postgres-graphql/apollo/clientConfig.js: -------------------------------------------------------------------------------- 1 | import { InMemoryCache } from "apollo-cache-inmemory"; 2 | 3 | export default function (context) { 4 | return { 5 | httpLinkOptions: { 6 | uri: "http://localhost:8080/v1/graphql", 7 | credentials: "same-origin", 8 | }, 9 | cache: new InMemoryCache(), 10 | wsEndpoint: "ws://localhost:8080/v1/graphql", 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /nuxtjs-postgres-graphql/apollo/queries/fetchArticle.gql: -------------------------------------------------------------------------------- 1 | query article($id: Int) { 2 | article(where: { author_id: { _eq: $id } }) { 3 | id 4 | title 5 | content 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /nuxtjs-postgres-graphql/apollo/queries/fetchAuthor.gql: -------------------------------------------------------------------------------- 1 | query { 2 | author { 3 | id 4 | name 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /nuxtjs-postgres-graphql/assets/README.md: -------------------------------------------------------------------------------- 1 | # ASSETS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked). 8 | -------------------------------------------------------------------------------- /nuxtjs-postgres-graphql/components/README.md: -------------------------------------------------------------------------------- 1 | # COMPONENTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | The components directory contains your Vue.js Components. 6 | 7 | _Nuxt.js doesn't supercharge these components._ 8 | -------------------------------------------------------------------------------- /nuxtjs-postgres-graphql/layouts/README.md: -------------------------------------------------------------------------------- 1 | # LAYOUTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Application Layouts. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts). 8 | -------------------------------------------------------------------------------- /nuxtjs-postgres-graphql/middleware/README.md: -------------------------------------------------------------------------------- 1 | # MIDDLEWARE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your application middleware. 6 | Middleware let you define custom functions that can be run before rendering either a page or a group of pages. 7 | 8 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware). 9 | -------------------------------------------------------------------------------- /nuxtjs-postgres-graphql/pages/README.md: -------------------------------------------------------------------------------- 1 | # PAGES 2 | 3 | This directory contains your Application Views and Routes. 4 | The framework reads all the `*.vue` files inside this directory and creates the router of your application. 5 | 6 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing). 7 | -------------------------------------------------------------------------------- /nuxtjs-postgres-graphql/plugins/README.md: -------------------------------------------------------------------------------- 1 | # PLUGINS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains Javascript plugins that you want to run before mounting the root Vue.js application. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/plugins). 8 | -------------------------------------------------------------------------------- /nuxtjs-postgres-graphql/plugins/apollo-error-handler.js: -------------------------------------------------------------------------------- 1 | export default (error, nuxtContext) => { 2 | console.log("Global error handler"); 3 | console.error(error); 4 | }; 5 | -------------------------------------------------------------------------------- /nuxtjs-postgres-graphql/static/README.md: -------------------------------------------------------------------------------- 1 | # STATIC 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your static files. 6 | Each file inside this directory is mapped to `/`. 7 | 8 | Example: `/static/robots.txt` is mapped as `/robots.txt`. 9 | 10 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static). 11 | -------------------------------------------------------------------------------- /nuxtjs-postgres-graphql/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/nuxtjs-postgres-graphql/static/favicon.ico -------------------------------------------------------------------------------- /nuxtjs-postgres-graphql/store/README.md: -------------------------------------------------------------------------------- 1 | # STORE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Vuex Store files. 6 | Vuex Store option is implemented in the Nuxt.js framework. 7 | 8 | Creating a file in this directory automatically activates the option in the framework. 9 | 10 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store). 11 | -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/.eslintignore: -------------------------------------------------------------------------------- 1 | /dist 2 | /src-bex/www 3 | /src-capacitor 4 | /src-cordova 5 | /.quasar 6 | /node_modules 7 | .eslintrc.js 8 | babel.config.js 9 | -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/.postcssrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // https://github.com/michael-ciniawsky/postcss-load-config 3 | 4 | module.exports = { 5 | plugins: [ 6 | // to edit target browsers: use "browserslist" field in package.json 7 | require('autoprefixer') 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/apollo.config.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | /* eslint-env node */ 3 | // See https://www.apollographql.com/docs/devtools/apollo-config/ 4 | module.exports = { 5 | client: { 6 | service: { 7 | name: 'my-service', 8 | url: 'http://localhost:3000/graphql', 9 | }, 10 | // Files processed by the extension 11 | includes: ['src/**/*.vue', 'src/**/*.js', 'src/**/*.ts'], 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/babel.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | 3 | module.exports = api => { 4 | return { 5 | presets: [ 6 | [ 7 | '@quasar/babel-preset-app', 8 | api.caller(caller => caller && caller.target === 'node') 9 | ? { targets: { node: 'current' } } 10 | : {} 11 | ] 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/quasar-framework-vue-graphql/public/favicon.ico -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/public/icons/favicon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/quasar-framework-vue-graphql/public/icons/favicon-128x128.png -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/public/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/quasar-framework-vue-graphql/public/icons/favicon-16x16.png -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/public/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/quasar-framework-vue-graphql/public/icons/favicon-32x32.png -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/public/icons/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/quasar-framework-vue-graphql/public/icons/favicon-96x96.png -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/quasar.extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "@quasar/apollo": { 3 | "typescript": false 4 | } 5 | } -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/src/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 12 | -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/src/boot/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/quasar-framework-vue-graphql/src/boot/.gitkeep -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/src/css/app.scss: -------------------------------------------------------------------------------- 1 | // app global css in SCSS form 2 | -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/src/pages/IndexPage.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 18 | -------------------------------------------------------------------------------- /quasar-framework-vue-graphql/src/router/routes.js: -------------------------------------------------------------------------------- 1 | const routes = [ 2 | { 3 | path: "/", 4 | component: () => import("layouts/MainLayout.vue"), 5 | children: [ 6 | { 7 | path: "/author/:authorId", 8 | component: () => import("pages/Articles.vue"), 9 | }, 10 | { path: "", component: () => import("pages/IndexPage.vue") }, 11 | ], 12 | }, 13 | 14 | // Always leave this as last one, 15 | // but you can also remove it 16 | { 17 | path: "/:catchAll(.*)*", 18 | component: () => import("pages/ErrorNotFound.vue"), 19 | }, 20 | ]; 21 | 22 | export default routes; 23 | -------------------------------------------------------------------------------- /react-apollo-todo/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /react-apollo-todo/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es6": true 5 | }, 6 | "extends": ["eslint:recommended", "plugin:react/recommended"], 7 | "parserOptions": { 8 | "ecmaFeatures": { 9 | "jsx": true 10 | }, 11 | "ecmaVersion": 2018, 12 | "sourceType": "module" 13 | }, 14 | "plugins": ["react", "prettier"], 15 | "rules": { 16 | "indent": "off", 17 | "linebreak-style": ["error", "unix"], 18 | "quotes": ["error", "double"], 19 | "semi": ["error", "always"], 20 | "prettier/prettier": "error", 21 | "no-console": "off" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /react-apollo-todo/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | package-lock.json 3 | 4 | -------------------------------------------------------------------------------- /react-apollo-todo/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | This app uses environment variables. 2 | 3 | ``` 4 | REACT_APP_GRAPHQL_URL=https://hasura-todo-test.herokuapp.com/v1/graphql 5 | 6 | REACT_APP_REALTIME_GRAPHQL_URL=wss://hasura-todo-test.herokuapp.com/v1/graphql 7 | 8 | REACT_APP_CALLBACK_URL=http://localhost:3000/callback 9 | 10 | REACT_APP_AUTH0_DOMAIN=todo-hasura-test.auth0.com 11 | 12 | REACT_APP_AUTH0_CLIENT_ID=lgKxyHzCDUWCALdAOkjg3QI2D6eglGes 13 | ``` 14 | 15 | Create a `.env` file and apply these environment variables to work with your React app. Replace it with your Auth0 values appropriately. 16 | -------------------------------------------------------------------------------- /react-apollo-todo/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:carbon as builder 2 | ENV NODE_ENV=PRODUCTION 3 | WORKDIR /app 4 | COPY package.json ./ 5 | RUN npm install --production 6 | COPY . . 7 | RUN npm run build 8 | 9 | FROM node:8-alpine 10 | RUN npm -g install serve 11 | 12 | WORKDIR /app 13 | COPY --from=builder /app/build . 14 | CMD ["serve", "-s", "-p", "8080"] -------------------------------------------------------------------------------- /react-apollo-todo/Procfile: -------------------------------------------------------------------------------- 1 | web: npm start 2 | -------------------------------------------------------------------------------- /react-apollo-todo/README.md: -------------------------------------------------------------------------------- 1 | ## Live demo 2 | 3 | [![Edit react-apollo-todo](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/hasura/sample-apps/tree/main/react-apollo-todo?fontsize=14) 4 | 5 | - [React App](https://react-apollo-todo.demo.hasura.app/) 6 | - [Hasura Console](https://react-apollo-todo.hasura.app/console) 7 | 8 | ## Tech stack 9 | 10 | - Frontend 11 | 12 | - React v0.16.3 13 | - Apollo Client 2.1 14 | 15 | - Backend 16 | - Hasura GraphQL Engine 17 | 18 | ## Run the React app 19 | 20 | Run `npm start` to start the todo app. 21 | -------------------------------------------------------------------------------- /react-apollo-todo/cypress.env.json: -------------------------------------------------------------------------------- 1 | { 2 | "AUTH0_DOMAIN": "todo-hasura-test.auth0.com", 3 | "AUTH0_CLIENT_ID": "lgKxyHzCDUWCALdAOkjg3QI2D6eglGes", 4 | "AUTH0_USERNAME": "praveen@hasura.io", 5 | "AUTH0_PASSWORD": "praveen123@" 6 | } -------------------------------------------------------------------------------- /react-apollo-todo/cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseUrl": "http://localhost:3000", 3 | "env": { 4 | "BASE_URL": "http://localhost:3000", 5 | "TEST_MODE": "parallel" 6 | }, 7 | "ignoreTestFiles": ["*spec.js", "validators.js"], 8 | "viewportWidth": 1280, 9 | "viewportHeight": 720, 10 | "chromeWebSecurity": false, 11 | "video": false 12 | } 13 | -------------------------------------------------------------------------------- /react-apollo-todo/cypress/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io", 4 | "body": "Fixtures are a great way to mock data for responses to routes" 5 | } 6 | -------------------------------------------------------------------------------- /react-apollo-todo/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080/ 3 | api_paths: 4 | v1_query: v1/query 5 | v2_query: v2/query 6 | v1_metadata: v1/metadata 7 | graphql: v1/graphql 8 | config: v1alpha1/config 9 | pg_dump: v1alpha1/pg_dump 10 | version: v1/version 11 | metadata_directory: metadata 12 | migrations_directory: migrations 13 | seeds_directory: seeds 14 | actions: 15 | kind: synchronous 16 | handler_webhook_baseurl: http://localhost:3000 17 | codegen: 18 | framework: "" 19 | output_dir: "" 20 | -------------------------------------------------------------------------------- /react-apollo-todo/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /react-apollo-todo/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /react-apollo-todo/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /react-apollo-todo/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /react-apollo-todo/hasura/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: default 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | database_url: 6 | from_env: SAMPLE_APPS_DATABASE_URL 7 | pool_settings: 8 | idle_timeout: 180 9 | max_connections: 50 10 | retries: 1 11 | tables: 12 | - "!include default/tables/public_online_users.yaml" 13 | - "!include default/tables/public_todos.yaml" 14 | - "!include default/tables/public_users.yaml" 15 | functions: [] 16 | -------------------------------------------------------------------------------- /react-apollo-todo/hasura/metadata/databases/default/tables/public_online_users.yaml: -------------------------------------------------------------------------------- 1 | select_permissions: 2 | - permission: 3 | columns: 4 | - name 5 | - last_seen 6 | filter: {} 7 | role: user 8 | table: 9 | name: online_users 10 | schema: public 11 | -------------------------------------------------------------------------------- /react-apollo-todo/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /react-apollo-todo/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /react-apollo-todo/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /react-apollo-todo/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/react-apollo-todo/public/favicon.ico -------------------------------------------------------------------------------- /react-apollo-todo/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/react-apollo-todo/public/favicon.png -------------------------------------------------------------------------------- /react-apollo-todo/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /react-apollo-todo/src/components/Auth/auth0-variables.js: -------------------------------------------------------------------------------- 1 | import { authDomain, authClientId, callbackUrl } from "../../utils/constants"; 2 | 3 | export const AUTH_CONFIG = { 4 | domain: authDomain, 5 | clientId: authClientId, 6 | callbackUrl: callbackUrl 7 | }; 8 | -------------------------------------------------------------------------------- /react-apollo-todo/src/images/React-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/react-apollo-todo/src/images/React-logo.png -------------------------------------------------------------------------------- /react-apollo-todo/src/images/apollo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/react-apollo-todo/src/images/apollo.png -------------------------------------------------------------------------------- /react-apollo-todo/src/images/auth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/react-apollo-todo/src/images/auth.png -------------------------------------------------------------------------------- /react-apollo-todo/src/images/checked.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /react-apollo-todo/src/images/graphql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/react-apollo-todo/src/images/graphql.png -------------------------------------------------------------------------------- /react-apollo-todo/src/images/right-img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/react-apollo-todo/src/images/right-img.png -------------------------------------------------------------------------------- /react-apollo-todo/src/images/right-img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/react-apollo-todo/src/images/right-img1.png -------------------------------------------------------------------------------- /react-apollo-todo/src/index.js: -------------------------------------------------------------------------------- 1 | import ReactDOM from "react-dom"; 2 | import { makeMainRoutes } from "./routes"; 3 | 4 | const routes = makeMainRoutes(); 5 | ReactDOM.render(routes, document.getElementById("root")); 6 | -------------------------------------------------------------------------------- /react-apollo-todo/src/utils/history.js: -------------------------------------------------------------------------------- 1 | import createHistory from "history/createBrowserHistory"; 2 | 3 | export default createHistory(); 4 | -------------------------------------------------------------------------------- /react-apollo-todo/src/utils/utils.js: -------------------------------------------------------------------------------- 1 | const getHeaders = () => { 2 | const token = localStorage.getItem("auth0:id_token"); 3 | const headers = { 4 | authorization: token ? `Bearer ${token}` : "" 5 | }; 6 | return headers; 7 | }; 8 | 9 | export { getHeaders }; 10 | -------------------------------------------------------------------------------- /react-relay/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["relay"] 3 | } 4 | -------------------------------------------------------------------------------- /react-relay/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /react-relay/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/react-relay/public/favicon.ico -------------------------------------------------------------------------------- /react-relay/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/react-relay/public/logo192.png -------------------------------------------------------------------------------- /react-relay/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/react-relay/public/logo512.png -------------------------------------------------------------------------------- /react-relay/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /react-relay/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /react-relay/relay.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // Configuration options accepted by the `relay-compiler` command-line tool and `babel-plugin-relay`. 3 | src: "./src", 4 | schema: "./schema.graphql", 5 | exclude: ["**/node_modules/**", "**/__mocks__/**", "**/__generated__/**"], 6 | }; 7 | -------------------------------------------------------------------------------- /react-relay/src/components/shared/Badge.js: -------------------------------------------------------------------------------- 1 | import styled from "@emotion/styled"; 2 | 3 | export const Badge = styled.span` 4 | display: inline-block; 5 | padding: 0.5rem 1rem; 6 | font-size: 1.6rem; 7 | font-weight: 600; 8 | line-height: 1; 9 | text-align: center; 10 | white-space: nowrap; 11 | vertical-align: middle; 12 | border-radius: 0.25rem; 13 | color: #fff; 14 | background-color: #17a2b8; 15 | margin: 0 1rem; 16 | `; 17 | -------------------------------------------------------------------------------- /react-relay/src/components/shared/InputForm.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "@emotion/styled"; 3 | import { Input, Button } from "./Form"; 4 | 5 | const Container = styled.div` 6 | display: flex; 7 | align-items: center; 8 | > button { 9 | margin-left: 1rem; 10 | } 11 | `; 12 | 13 | const InputForm = ({ inputVal, onChange, onSubmit, buttonText }) => { 14 | return ( 15 | 16 | 17 | 18 | 19 | ); 20 | }; 21 | 22 | export default InputForm; 23 | -------------------------------------------------------------------------------- /react-relay/src/components/shared/Logo.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styled from "@emotion/styled"; 3 | 4 | const LogoText = styled.h1` 5 | font-family: "Open Sans", "Helvetica Neue", sans-serif; 6 | font-size: 10rem; 7 | color: grey; 8 | margin: 0; 9 | text-align: center; 10 | `; 11 | 12 | const Logo = () => { 13 | return Demo; 14 | }; 15 | 16 | export default Logo; 17 | -------------------------------------------------------------------------------- /react-relay/src/fetchGraphQL.js: -------------------------------------------------------------------------------- 1 | async function fetchGraphQL(text, variables) { 2 | const response = await fetch( 3 | "https://[MY_HASURA_ENDPOINT_ROOT]/v1beta1/relay", 4 | { 5 | method: "POST", 6 | headers: { 7 | "Content-Type": "application/json", 8 | }, 9 | body: JSON.stringify({ 10 | query: text, 11 | variables, 12 | }), 13 | } 14 | ); 15 | 16 | return await response.json(); 17 | } 18 | 19 | export default fetchGraphQL; 20 | -------------------------------------------------------------------------------- /react-relay/src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import "./index.css"; 4 | import App from "./App"; 5 | import * as serviceWorker from "./serviceWorker"; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById("root") 12 | ); 13 | 14 | // If you want your app to work offline and load faster, you can change 15 | // unregister() to register() below. Note this comes with some pitfalls. 16 | // Learn more about service workers: https://bit.ly/CRA-PWA 17 | serviceWorker.unregister(); 18 | -------------------------------------------------------------------------------- /react-static-graphql/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-static/babel-preset.js"] 3 | } 4 | -------------------------------------------------------------------------------- /react-static-graphql/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: 'react-tools', 3 | } 4 | -------------------------------------------------------------------------------- /react-static-graphql/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .next 3 | .cache 4 | dist 5 | .tempdist 6 | .DS_Store 7 | yarn-error.log 8 | .history 9 | tmp 10 | -------------------------------------------------------------------------------- /react-static-graphql/assets/author_fk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/react-static-graphql/assets/author_fk.png -------------------------------------------------------------------------------- /react-static-graphql/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | -------------------------------------------------------------------------------- /react-static-graphql/src/apollo.js: -------------------------------------------------------------------------------- 1 | import { ApolloClient } from 'apollo-client' 2 | import { HttpLink } from 'apollo-link-http' 3 | import { InMemoryCache } from 'apollo-cache-inmemory' 4 | import fetch from 'node-fetch' 5 | 6 | const client = new ApolloClient({ 7 | link: new HttpLink({ 8 | uri: 'http://localhost:8080/v1/graphql', // replace this with your own Hasura GraphQL Endpoint 9 | fetch 10 | }), 11 | cache: new InMemoryCache(), 12 | }) 13 | 14 | export default client -------------------------------------------------------------------------------- /react-static-graphql/src/app.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 3 | 'Lucida Grande', sans-serif; 4 | font-weight: 300; 5 | font-size: 16px; 6 | margin: 0; 7 | padding: 0; 8 | } 9 | 10 | a { 11 | text-decoration: none; 12 | color: #108db8; 13 | font-weight: bold; 14 | } 15 | 16 | img { 17 | max-width: 100%; 18 | } 19 | 20 | nav { 21 | width: 100%; 22 | background: #108db8; 23 | } 24 | 25 | nav a { 26 | color: white; 27 | padding: 1rem; 28 | display: inline-block; 29 | } 30 | 31 | .content { 32 | padding: 1rem; 33 | } 34 | -------------------------------------------------------------------------------- /react-static-graphql/src/containers/Post.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { withRouteData } from 'react-static' 3 | import { Link } from '@reach/router' 4 | 5 | export default withRouteData(({ articles }) => { 6 | const articlesList = articles.map((article, index) => { 7 | return ( 8 |
9 |

{article.title}

10 |

{article.content}

11 |
12 | )} 13 | ) 14 | return ( 15 |
16 | {'<'} Back 17 |
18 | {articlesList.length ? articlesList : 'There are no posts by this author'} 19 |
20 | )} 21 | ) 22 | -------------------------------------------------------------------------------- /react-static-graphql/src/graphql/queries.js: -------------------------------------------------------------------------------- 1 | import gql from "graphql-tag"; 2 | 3 | const GET_AUTHOR = gql` 4 | query { 5 | author { 6 | id 7 | name 8 | } 9 | } 10 | `; 11 | 12 | const GET_ARTICLE = gql` 13 | query($author: Int!) { 14 | article(where: {author_id: {_eq: $author}}) { 15 | id 16 | title 17 | content 18 | created_at 19 | } 20 | } 21 | `; 22 | 23 | export { GET_ARTICLE, GET_AUTHOR }; -------------------------------------------------------------------------------- /react-static-graphql/src/pages/404.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export default () => ( 4 |
5 |

404 - Oh no's! We couldn't find that page :(

6 |
7 | ) 8 | -------------------------------------------------------------------------------- /react-static-graphql/src/pages/about.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export default () => ( 4 |
5 |

React Static is a progressive static site generator for React.

6 |
7 | ) 8 | -------------------------------------------------------------------------------- /react-static-graphql/src/pages/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { withSiteData } from 'react-static' 3 | 4 | export default withSiteData(() => ( 5 |
6 |

Welcome to React-Static

7 |

This demo integrates Hasura GraphQL Engine and allows you to generate static sites with your Postgres database using GraphQL

8 |
9 | )) 10 | -------------------------------------------------------------------------------- /react-weather-analytics-app/README.md: -------------------------------------------------------------------------------- 1 | ## Tech stack 2 | 3 | - Frontend 4 | 5 | - React v16.8.3 6 | - Apollo Client 2.6.10 7 | 8 | - Backend 9 | - Hasura GraphQL Engine 10 | 11 | ## Run the React app 12 | 13 | Follow the instructions in this [blog](https://hasura.io/blog/get-graphql-api-on-snowflake-with-hasura-sample-app/) to set up your Snowflake as a prerequisite. 14 | Post that, run `npm install` and `npm start` to start the analytics app. 15 | 16 | We have showcased a bar chart in this example; you can easily add the other types with minimal changes. 17 | You can read more here, https://github.com/hasura/graphql2chartjs 18 | -------------------------------------------------------------------------------- /react-weather-analytics-app/app/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | -------------------------------------------------------------------------------- /react-weather-analytics-app/app/README.md: -------------------------------------------------------------------------------- 1 | To run this example: 2 | 3 | ``` 4 | npm install 5 | npm start 6 | ``` 7 | -------------------------------------------------------------------------------- /react-weather-analytics-app/app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/react-weather-analytics-app/app/public/favicon.ico -------------------------------------------------------------------------------- /react-weather-analytics-app/app/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /react-weather-analytics-app/app/src/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './App.css'; 3 | import NavBar from './Navbar'; 4 | 5 | import { 6 | BasicBarChart, 7 | StyledBarChart, 8 | MultiDatasetBarChart, 9 | MixedLineBarChart, 10 | LiveChart, 11 | RealtimeTimeseriesChart 12 | } from './charts'; 13 | 14 | const App = () => ( 15 |
16 | 17 |
18 | 19 |
20 |
21 | ); 22 | 23 | export default App; 24 | -------------------------------------------------------------------------------- /react-weather-analytics-app/app/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /react-weather-analytics-app/app/src/charts/index.js: -------------------------------------------------------------------------------- 1 | export { BasicBarChart } from './BasicBarChart'; 2 | export { StyledBarChart } from './StyledBarChart'; 3 | export { MultiDatasetBarChart } from './MultiDatasetBarChart'; 4 | export { MixedLineBarChart } from './MixedLineBarChart'; 5 | export { LiveChart } from './LiveChart'; 6 | export { RealtimeTimeseriesChart } from './RealtimeTimeseriesChart'; 7 | -------------------------------------------------------------------------------- /react-weather-analytics-app/app/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 5 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 6 | sans-serif; 7 | -webkit-font-smoothing: antialiased; 8 | -moz-osx-font-smoothing: grayscale; 9 | } 10 | 11 | code { 12 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 13 | monospace; 14 | } 15 | -------------------------------------------------------------------------------- /react-weather-analytics-app/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080 3 | metadata_directory: metadata 4 | actions: 5 | kind: synchronous 6 | handler_webhook_baseurl: http://localhost:3000 7 | -------------------------------------------------------------------------------- /realtime-chat-vue/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not ie <= 8 4 | -------------------------------------------------------------------------------- /realtime-chat-vue/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | extends: ["plugin:vue/essential"], 7 | rules: { 8 | "no-console": process.env.NODE_ENV === "production" ? "error" : "off", 9 | "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off" 10 | }, 11 | parserOptions: { 12 | parser: "babel-eslint" 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /realtime-chat-vue/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | -------------------------------------------------------------------------------- /realtime-chat-vue/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ["@vue/app"] 3 | }; 4 | -------------------------------------------------------------------------------- /realtime-chat-vue/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /realtime-chat-vue/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat-vue/public/favicon.ico -------------------------------------------------------------------------------- /realtime-chat-vue/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /realtime-chat-vue/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat-vue/src/assets/logo.png -------------------------------------------------------------------------------- /realtime-chat-vue/src/components/Banner.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 18 | 19 | -------------------------------------------------------------------------------- /realtime-chat-vue/src/graphql/AddUserMutation.gql: -------------------------------------------------------------------------------- 1 | mutation ($username: String!) { 2 | insert_user ( 3 | objects: [{ 4 | username: $username 5 | }] 6 | ) { 7 | returning { 8 | id 9 | username 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /realtime-chat-vue/src/graphql/emitOnlineEvent.gql: -------------------------------------------------------------------------------- 1 | mutation ($userId:Int!){ 2 | update_user ( 3 | _set: { 4 | last_seen: "now()" 5 | } 6 | where: { 7 | id: { 8 | _eq: $userId 9 | } 10 | } 11 | ) { 12 | affected_rows 13 | } 14 | } -------------------------------------------------------------------------------- /realtime-chat-vue/src/graphql/emitTypingEvent.gql: -------------------------------------------------------------------------------- 1 | mutation ($userId: Int) { 2 | update_user ( 3 | _set: { 4 | last_typed: "now()" 5 | } 6 | where: { 7 | id: { 8 | _eq: $userId 9 | } 10 | } 11 | ) { 12 | affected_rows 13 | } 14 | } -------------------------------------------------------------------------------- /realtime-chat-vue/src/graphql/fetchMessages.gql: -------------------------------------------------------------------------------- 1 | query ($last_received_id: Int, $last_received_ts: timestamptz){ 2 | message ( 3 | order_by: {timestamp:asc} 4 | where: { 5 | _and: { 6 | id: { 7 | _neq: $last_received_id 8 | }, 9 | timestamp: { 10 | _gte: $last_received_ts 11 | } 12 | } 13 | } 14 | ) { 15 | id 16 | text 17 | username 18 | timestamp 19 | } 20 | } -------------------------------------------------------------------------------- /realtime-chat-vue/src/graphql/fetchOnlineUsersSubscription.gql: -------------------------------------------------------------------------------- 1 | subscription { 2 | user_online ( 3 | order_by: {username:asc} 4 | ) { 5 | id 6 | username 7 | } 8 | } -------------------------------------------------------------------------------- /realtime-chat-vue/src/graphql/getUserTyping.gql: -------------------------------------------------------------------------------- 1 | subscription ($selfId: Int ) { 2 | user_typing ( 3 | where: { 4 | id: { 5 | _neq: $selfId 6 | } 7 | }, 8 | limit: 1 9 | order_by: {last_typed:desc} 10 | ){ 11 | last_typed 12 | username 13 | } 14 | } -------------------------------------------------------------------------------- /realtime-chat-vue/src/graphql/insertMessage.gql: -------------------------------------------------------------------------------- 1 | mutation insert_message ($message: message_insert_input! ){ 2 | insert_message ( 3 | objects: [$message] 4 | ) { 5 | returning { 6 | id 7 | timestamp 8 | text 9 | username 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /realtime-chat-vue/src/graphql/subscribeToNewMessages.gql: -------------------------------------------------------------------------------- 1 | subscription { 2 | message ( order_by: {id:desc} limit: 1) { 3 | id 4 | username 5 | text 6 | timestamp 7 | } 8 | } -------------------------------------------------------------------------------- /realtime-chat-vue/src/images/Vue-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat-vue/src/images/Vue-logo.png -------------------------------------------------------------------------------- /realtime-chat-vue/src/images/apollo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat-vue/src/images/apollo.png -------------------------------------------------------------------------------- /realtime-chat-vue/src/images/auth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat-vue/src/images/auth.png -------------------------------------------------------------------------------- /realtime-chat-vue/src/images/chat-app-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat-vue/src/images/chat-app-bg.jpg -------------------------------------------------------------------------------- /realtime-chat-vue/src/images/chat-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat-vue/src/images/chat-app.png -------------------------------------------------------------------------------- /realtime-chat-vue/src/images/graphql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat-vue/src/images/graphql.png -------------------------------------------------------------------------------- /realtime-chat-vue/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import App from "./App.vue"; 3 | import router from "./router"; 4 | import store from "./store"; 5 | import style from "./App.css"; 6 | import { createProvider } from "./vue-apollo"; 7 | Vue.config.productionTip = false; 8 | 9 | new Vue({ 10 | router, 11 | style, 12 | store, 13 | apolloProvider: createProvider(), 14 | render: h => h(App) 15 | }).$mount("#app"); 16 | -------------------------------------------------------------------------------- /realtime-chat-vue/src/store.js: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import Vuex from "vuex"; 3 | 4 | Vue.use(Vuex); 5 | 6 | export default new Vuex.Store({ 7 | state: {}, 8 | mutations: {}, 9 | actions: {} 10 | }); 11 | -------------------------------------------------------------------------------- /realtime-chat/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /realtime-chat/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:16 as builder 2 | ENV NODE_ENV=PRODUCTION 3 | WORKDIR /app 4 | COPY package.json ./ 5 | RUN npm install 6 | COPY . . 7 | RUN npm run build 8 | 9 | FROM node:16-alpine 10 | RUN npm -g install serve 11 | 12 | WORKDIR /app 13 | COPY --from=builder /app/build . 14 | CMD ["serve", "-s", "-p", "3000"] -------------------------------------------------------------------------------- /realtime-chat/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080/ 3 | api_paths: 4 | v1_query: v1/query 5 | v2_query: v2/query 6 | v1_metadata: v1/metadata 7 | graphql: v1/graphql 8 | config: v1alpha1/config 9 | pg_dump: v1alpha1/pg_dump 10 | version: v1/version 11 | metadata_directory: metadata 12 | migrations_directory: migrations 13 | seeds_directory: seeds 14 | actions: 15 | kind: synchronous 16 | handler_webhook_baseurl: http://localhost:3000 17 | codegen: 18 | framework: "" 19 | output_dir: "" 20 | -------------------------------------------------------------------------------- /realtime-chat/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /realtime-chat/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /realtime-chat/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /realtime-chat/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /realtime-chat/hasura/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: default 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | database_url: 6 | from_env: PG_DATABASE_URL 7 | pool_settings: 8 | idle_timeout: 180 9 | max_connections: 50 10 | retries: 1 11 | tables: 12 | - "!include default/tables/public_message.yaml" 13 | - "!include default/tables/public_user.yaml" 14 | - "!include default/tables/public_user_online.yaml" 15 | - "!include default/tables/public_user_typing.yaml" 16 | functions: [] 17 | -------------------------------------------------------------------------------- /realtime-chat/hasura/metadata/databases/default/tables/public_message.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: message 3 | schema: public 4 | -------------------------------------------------------------------------------- /realtime-chat/hasura/metadata/databases/default/tables/public_user.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: user 3 | schema: public 4 | -------------------------------------------------------------------------------- /realtime-chat/hasura/metadata/databases/default/tables/public_user_online.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: user_online 3 | schema: public 4 | -------------------------------------------------------------------------------- /realtime-chat/hasura/metadata/databases/default/tables/public_user_typing.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: user_typing 3 | schema: public 4 | -------------------------------------------------------------------------------- /realtime-chat/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /realtime-chat/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /realtime-chat/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /realtime-chat/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat/public/favicon.ico -------------------------------------------------------------------------------- /realtime-chat/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat/public/favicon.png -------------------------------------------------------------------------------- /realtime-chat/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Realtime Group Chat", 3 | "name": "Realtime Group Chat Powered by Hasura", 4 | "icons": [ 5 | { 6 | "src": "favicon.png", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-png" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /realtime-chat/src/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Main from './components/Main'; 3 | import './App.css' ; 4 | 5 | const App = () => { 6 | return
; 7 | } 8 | 9 | export default App; 10 | -------------------------------------------------------------------------------- /realtime-chat/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /realtime-chat/src/components/Banner.js: -------------------------------------------------------------------------------- 1 | import '../App.css'; 2 | 3 | const Banner = (props) => { 4 | return ( 5 |
6 | You have {props.numOfNewMessages} new message(s) 7 |
8 | ); 9 | }; 10 | 11 | export default Banner; 12 | -------------------------------------------------------------------------------- /realtime-chat/src/hasura_logo_200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat/src/hasura_logo_200.png -------------------------------------------------------------------------------- /realtime-chat/src/images/React-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat/src/images/React-logo.png -------------------------------------------------------------------------------- /realtime-chat/src/images/apollo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat/src/images/apollo.png -------------------------------------------------------------------------------- /realtime-chat/src/images/auth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat/src/images/auth.png -------------------------------------------------------------------------------- /realtime-chat/src/images/chat-app-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat/src/images/chat-app-bg.jpg -------------------------------------------------------------------------------- /realtime-chat/src/images/chat-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat/src/images/chat-app.png -------------------------------------------------------------------------------- /realtime-chat/src/images/graphql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-chat/src/images/graphql.png -------------------------------------------------------------------------------- /realtime-chat/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /realtime-chat/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = (onPerfEntry) => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /realtime-location-tracking/.env: -------------------------------------------------------------------------------- 1 | REACT_APP_GOOGLE_API_KEY=AIzaSyDLbYz4-IjX3xW4PcUg8RksjAKiT96Z1uo 2 | -------------------------------------------------------------------------------- /realtime-location-tracking/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | 23 | # editor 24 | .idea/ 25 | 26 | package-lock.json 27 | -------------------------------------------------------------------------------- /realtime-location-tracking/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:16 as builder 2 | ENV NODE_ENV=PRODUCTION 3 | WORKDIR /app 4 | COPY package.json ./ 5 | RUN npm install --production 6 | COPY . . 7 | RUN npm run build 8 | 9 | FROM node:16-alpine 10 | RUN npm -g install serve 11 | 12 | WORKDIR /app 13 | COPY --from=builder /app/build . 14 | CMD ["serve", "-p", "8080"] -------------------------------------------------------------------------------- /realtime-location-tracking/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080 3 | metadata_directory: metadata 4 | actions: 5 | kind: synchronous 6 | handler_webhook_baseurl: http://localhost:3000 7 | -------------------------------------------------------------------------------- /realtime-location-tracking/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /realtime-location-tracking/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /realtime-location-tracking/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /realtime-location-tracking/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /realtime-location-tracking/hasura/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: default 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | database_url: 6 | from_env: PG_DATABASE_URL 7 | pool_settings: 8 | idle_timeout: 180 9 | max_connections: 50 10 | retries: 1 11 | tables: 12 | - "!include default/tables/public_vehicle.yaml" 13 | - "!include default/tables/public_vehicle_location.yaml" 14 | functions: [] 15 | -------------------------------------------------------------------------------- /realtime-location-tracking/hasura/metadata/databases/default/tables/public_vehicle.yaml: -------------------------------------------------------------------------------- 1 | array_relationships: 2 | - name: locations 3 | using: 4 | foreign_key_constraint_on: 5 | column: vehicle_id 6 | table: 7 | name: vehicle_location 8 | schema: public 9 | table: 10 | name: vehicle 11 | schema: public 12 | -------------------------------------------------------------------------------- /realtime-location-tracking/hasura/metadata/databases/default/tables/public_vehicle_location.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: vehicle_location 3 | schema: public 4 | -------------------------------------------------------------------------------- /realtime-location-tracking/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /realtime-location-tracking/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /realtime-location-tracking/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /realtime-location-tracking/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-location-tracking/public/favicon.ico -------------------------------------------------------------------------------- /realtime-location-tracking/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-location-tracking/public/favicon.png -------------------------------------------------------------------------------- /realtime-location-tracking/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /realtime-location-tracking/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /realtime-location-tracking/src/assets/carbon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-location-tracking/src/assets/carbon.png -------------------------------------------------------------------------------- /realtime-location-tracking/src/assets/hasura.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-location-tracking/src/assets/hasura.png -------------------------------------------------------------------------------- /realtime-location-tracking/src/hooks/usePrevious.js: -------------------------------------------------------------------------------- 1 | // Example from https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state 2 | 3 | import { useEffect, useRef } from 'react'; 4 | 5 | export function usePrevious(value) { 6 | const reference = useRef(); 7 | 8 | useEffect(() => { 9 | reference.current = value; 10 | }, [value]); 11 | 12 | return reference.current; 13 | } -------------------------------------------------------------------------------- /realtime-location-tracking/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /realtime-location-tracking/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import '../node_modules/bootstrap/dist/css/bootstrap.min.css'; 5 | import Vehicle from './Vehicle/Vehicle'; 6 | 7 | // Use the client just as before 8 | // import { BrowserRouter as Router, Route } from 'react-router-dom'; 9 | 10 | ReactDOM.render( 11 | , 12 | document.getElementById('root')); 13 | -------------------------------------------------------------------------------- /realtime-poll/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /realtime-poll/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | 23 | package-lock.json 24 | -------------------------------------------------------------------------------- /realtime-poll/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:carbon as builder 2 | ENV NODE_ENV=PRODUCTION 3 | WORKDIR /app 4 | COPY package.json ./ 5 | RUN npm install --production 6 | COPY . . 7 | RUN npm run build 8 | 9 | FROM node:8-alpine 10 | RUN npm -g install serve 11 | 12 | WORKDIR /app 13 | COPY --from=builder /app/build . 14 | CMD ["serve", "-p", "8080"] -------------------------------------------------------------------------------- /realtime-poll/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080/ 3 | api_paths: 4 | v1_query: v1/query 5 | v2_query: v2/query 6 | v1_metadata: v1/metadata 7 | graphql: v1/graphql 8 | config: v1alpha1/config 9 | pg_dump: v1alpha1/pg_dump 10 | version: v1/version 11 | metadata_directory: metadata 12 | migrations_directory: migrations 13 | seeds_directory: seeds 14 | actions: 15 | kind: synchronous 16 | handler_webhook_baseurl: http://localhost:3000 17 | codegen: 18 | framework: "" 19 | output_dir: "" 20 | -------------------------------------------------------------------------------- /realtime-poll/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /realtime-poll/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /realtime-poll/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /realtime-poll/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /realtime-poll/hasura/metadata/databases/default/tables/public_online_users.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: online_users 3 | schema: public 4 | -------------------------------------------------------------------------------- /realtime-poll/hasura/metadata/databases/default/tables/public_option.yaml: -------------------------------------------------------------------------------- 1 | object_relationships: 2 | - name: poll 3 | using: 4 | foreign_key_constraint_on: poll_id 5 | table: 6 | name: option 7 | schema: public 8 | -------------------------------------------------------------------------------- /realtime-poll/hasura/metadata/databases/default/tables/public_poll.yaml: -------------------------------------------------------------------------------- 1 | array_relationships: 2 | - name: options 3 | using: 4 | foreign_key_constraint_on: 5 | column: poll_id 6 | table: 7 | name: option 8 | schema: public 9 | table: 10 | name: poll 11 | schema: public 12 | -------------------------------------------------------------------------------- /realtime-poll/hasura/metadata/databases/default/tables/public_poll_results.yaml: -------------------------------------------------------------------------------- 1 | object_relationships: 2 | - name: option 3 | using: 4 | manual_configuration: 5 | column_mapping: 6 | option_id: id 7 | remote_table: 8 | name: option 9 | schema: public 10 | - name: poll 11 | using: 12 | manual_configuration: 13 | column_mapping: 14 | poll_id: id 15 | remote_table: 16 | name: poll 17 | schema: public 18 | table: 19 | name: poll_results 20 | schema: public 21 | -------------------------------------------------------------------------------- /realtime-poll/hasura/metadata/databases/default/tables/public_user.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: user 3 | schema: public 4 | -------------------------------------------------------------------------------- /realtime-poll/hasura/metadata/databases/default/tables/public_vote.yaml: -------------------------------------------------------------------------------- 1 | object_relationships: 2 | - name: created_by_user 3 | using: 4 | foreign_key_constraint_on: created_by_user_id 5 | - name: option 6 | using: 7 | foreign_key_constraint_on: option_id 8 | table: 9 | name: vote 10 | schema: public 11 | -------------------------------------------------------------------------------- /realtime-poll/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /realtime-poll/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /realtime-poll/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /realtime-poll/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-poll/public/favicon.ico -------------------------------------------------------------------------------- /realtime-poll/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-poll/public/favicon.png -------------------------------------------------------------------------------- /realtime-poll/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Hasura Realtime Poll", 3 | "name": "Realtime Poll App Powered by Hasura GraphQL Engine", 4 | "icons": [ 5 | { 6 | "src": "favicon.png", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /realtime-poll/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /realtime-poll/src/img/hasura_logo_200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/realtime-poll/src/img/hasura_logo_200.png -------------------------------------------------------------------------------- /realtime-poll/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /realtime-poll/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | 6 | ReactDOM.render(, document.getElementById('root')); 7 | -------------------------------------------------------------------------------- /serverless-etl/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | 3 | COPY *.png *.html *.css *.js /usr/share/nginx/html/ -------------------------------------------------------------------------------- /serverless-etl/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/serverless-etl/arch.png -------------------------------------------------------------------------------- /serverless-etl/cloudfunction/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env.yaml -------------------------------------------------------------------------------- /serverless-etl/cloudfunction/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "message_event_handler", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "algoliasearch": "^3.30.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /serverless-etl/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/serverless-etl/favicon.png -------------------------------------------------------------------------------- /serverless-etl/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080/ 3 | api_paths: 4 | v1_query: v1/query 5 | v2_query: v2/query 6 | v1_metadata: v1/metadata 7 | graphql: v1/graphql 8 | config: v1alpha1/config 9 | pg_dump: v1alpha1/pg_dump 10 | version: v1/version 11 | metadata_directory: metadata 12 | migrations_directory: migrations 13 | seeds_directory: seeds 14 | actions: 15 | kind: synchronous 16 | handler_webhook_baseurl: http://localhost:3000 17 | codegen: 18 | framework: "" 19 | output_dir: "" 20 | -------------------------------------------------------------------------------- /serverless-etl/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /serverless-etl/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /serverless-etl/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /serverless-etl/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /serverless-etl/hasura/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: default 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | database_url: 6 | from_env: SAMPLE_APPS_DATABASE_URL 7 | pool_settings: 8 | idle_timeout: 180 9 | max_connections: 50 10 | retries: 1 11 | tables: 12 | - "!include default/tables/public_book.yaml" 13 | functions: [] 14 | -------------------------------------------------------------------------------- /serverless-etl/hasura/metadata/databases/default/tables/public_book.yaml: -------------------------------------------------------------------------------- 1 | event_triggers: 2 | - definition: 3 | insert: 4 | columns: 5 | - title 6 | - author 7 | - id 8 | - created_at 9 | name: book_event 10 | retry_conf: 11 | interval_sec: 10 12 | num_retries: 0 13 | webhook: https://us-central1-hasura-test.cloudfunctions.net/serverless-etl 14 | table: 15 | name: book 16 | schema: public 17 | -------------------------------------------------------------------------------- /serverless-etl/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /serverless-etl/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /serverless-etl/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /serverless-etl/hasura_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/serverless-etl/hasura_logo.png -------------------------------------------------------------------------------- /serverless-etl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "serverless-etl-hasura", 3 | "version": "1.0.0", 4 | "description": "Serverless ETL demo using Hasura GraphQL Engine Event Triggers and Algolia Search", 5 | "main": "index.html", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/hasura/graphql-engine" 12 | }, 13 | "keywords": [], 14 | "author": "Praveen", 15 | "license": "MIT" 16 | } -------------------------------------------------------------------------------- /serverless-push/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | 3 | COPY *.png *.html *.css *.js *.json /usr/share/nginx/html/ -------------------------------------------------------------------------------- /serverless-push/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/serverless-push/arch.png -------------------------------------------------------------------------------- /serverless-push/cloudfunction/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env.yaml -------------------------------------------------------------------------------- /serverless-push/cloudfunction/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "message_event_handler", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "node-fetch": "^2.2.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /serverless-push/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/serverless-push/favicon.png -------------------------------------------------------------------------------- /serverless-push/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080/ 3 | api_paths: 4 | v1_query: v1/query 5 | v2_query: v2/query 6 | v1_metadata: v1/metadata 7 | graphql: v1/graphql 8 | config: v1alpha1/config 9 | pg_dump: v1alpha1/pg_dump 10 | version: v1/version 11 | metadata_directory: metadata 12 | migrations_directory: migrations 13 | seeds_directory: seeds 14 | actions: 15 | kind: synchronous 16 | handler_webhook_baseurl: http://localhost:3000 17 | codegen: 18 | framework: "" 19 | output_dir: "" 20 | -------------------------------------------------------------------------------- /serverless-push/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /serverless-push/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /serverless-push/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /serverless-push/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /serverless-push/hasura/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: default 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | database_url: 6 | from_env: SAMPLE_APPS_DATABASE_URL 7 | pool_settings: 8 | idle_timeout: 180 9 | max_connections: 50 10 | retries: 1 11 | tables: 12 | - "!include default/tables/public_message.yaml" 13 | functions: [] 14 | -------------------------------------------------------------------------------- /serverless-push/hasura/metadata/databases/default/tables/public_message.yaml: -------------------------------------------------------------------------------- 1 | event_triggers: 2 | - definition: 3 | insert: 4 | columns: 5 | - title 6 | - body 7 | - device_token 8 | - id 9 | - timestamp 10 | name: message_event 11 | retry_conf: 12 | interval_sec: 10 13 | num_retries: 0 14 | webhook: https://us-central1-hasura-test.cloudfunctions.net/push-notification 15 | table: 16 | name: message 17 | schema: public 18 | -------------------------------------------------------------------------------- /serverless-push/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /serverless-push/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /serverless-push/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /serverless-push/hasura/migrations/default/1613664119718_init/up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE public.message ( 2 | id uuid DEFAULT public.gen_random_uuid() NOT NULL, 3 | "timestamp" timestamp with time zone DEFAULT now() NOT NULL, 4 | title text NOT NULL, 5 | body text, 6 | device_token text NOT NULL 7 | ); 8 | ALTER TABLE ONLY public.message 9 | ADD CONSTRAINT message_pkey PRIMARY KEY (id); 10 | -------------------------------------------------------------------------------- /serverless-push/hasura_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/serverless-push/hasura_logo.png -------------------------------------------------------------------------------- /serverless-push/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "gcm_sender_id": "103953800507" 3 | } 4 | -------------------------------------------------------------------------------- /serverless-push/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "serverless-push-hasura", 3 | "version": "1.0.0", 4 | "description": "Web notifications using Hasura GraphQL Engine Event Triggers and FCM", 5 | "main": "index.html", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/hasura/graphql-engine" 12 | }, 13 | "keywords": [], 14 | "author": "Praveen", 15 | "license": "MIT" 16 | } -------------------------------------------------------------------------------- /streaming-subscriptions-chat/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | hasura/ 3 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | .env 23 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:16 as builder 2 | ENV NODE_ENV=PRODUCTION 3 | WORKDIR /app 4 | COPY package.json ./ 5 | COPY package-lock.json ./ 6 | RUN npm install 7 | COPY . . 8 | RUN npm run build 9 | 10 | FROM node:16-alpine 11 | RUN npm -g install serve 12 | 13 | WORKDIR /app 14 | COPY --from=builder /app/build . 15 | CMD ["serve", "-s", "-p", "3000"] -------------------------------------------------------------------------------- /streaming-subscriptions-chat/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080/ 3 | api_paths: 4 | v1_query: v1/query 5 | v2_query: v2/query 6 | v1_metadata: v1/metadata 7 | graphql: v1/graphql 8 | config: v1alpha1/config 9 | pg_dump: v1alpha1/pg_dump 10 | version: v1/version 11 | metadata_directory: metadata 12 | migrations_directory: migrations 13 | seeds_directory: seeds 14 | actions: 15 | kind: synchronous 16 | handler_webhook_baseurl: http://localhost:3000 17 | codegen: 18 | framework: "" 19 | output_dir: "" 20 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/hasura/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: default 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | database_url: 6 | from_env: PG_DATABASE_URL 7 | pool_settings: 8 | idle_timeout: 180 9 | max_connections: 50 10 | retries: 1 11 | tables: 12 | - "!include default/tables/public_message.yaml" 13 | - "!include default/tables/public_user.yaml" 14 | - "!include default/tables/public_user_online.yaml" 15 | - "!include default/tables/public_user_typing.yaml" 16 | functions: [] 17 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/hasura/metadata/databases/default/tables/public_message.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: message 3 | schema: public 4 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/hasura/metadata/databases/default/tables/public_user.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: user 3 | schema: public 4 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/hasura/metadata/databases/default/tables/public_user_online.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: user_online 3 | schema: public 4 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/hasura/metadata/databases/default/tables/public_user_typing.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: user_typing 3 | schema: public 4 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/streaming-subscriptions-chat/public/favicon.ico -------------------------------------------------------------------------------- /streaming-subscriptions-chat/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/streaming-subscriptions-chat/public/favicon.png -------------------------------------------------------------------------------- /streaming-subscriptions-chat/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Realtime Group Chat", 3 | "name": "Realtime Group Chat Powered by Hasura", 4 | "icons": [ 5 | { 6 | "src": "favicon.png", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-png" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/src/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import Main from './components/Main'; 4 | import './App.css'; 5 | 6 | const App = () => { 7 | return
; 8 | }; 9 | 10 | export default App; 11 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/src/components/Banner.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { StyledBanner } from '../styles/StyledChatApp'; 4 | import '../App.css'; 5 | 6 | const Banner = (props) => { 7 | return ( 8 | 9 | You have {props.numOfNewMessages} new message(s) 10 | 11 | ); 12 | }; 13 | 14 | export default Banner; 15 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/src/hasura_logo_200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/streaming-subscriptions-chat/src/hasura_logo_200.png -------------------------------------------------------------------------------- /streaming-subscriptions-chat/src/images/React-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/streaming-subscriptions-chat/src/images/React-logo.png -------------------------------------------------------------------------------- /streaming-subscriptions-chat/src/images/auth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/streaming-subscriptions-chat/src/images/auth.png -------------------------------------------------------------------------------- /streaming-subscriptions-chat/src/images/chat-app-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/streaming-subscriptions-chat/src/images/chat-app-bg.jpg -------------------------------------------------------------------------------- /streaming-subscriptions-chat/src/images/chat-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/streaming-subscriptions-chat/src/images/chat-app.png -------------------------------------------------------------------------------- /streaming-subscriptions-chat/src/images/graphql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/streaming-subscriptions-chat/src/images/graphql.png -------------------------------------------------------------------------------- /streaming-subscriptions-chat/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /streaming-subscriptions-chat/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = (onPerfEntry) => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /svelte-apollo/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | public/bundle.* 4 | -------------------------------------------------------------------------------- /svelte-apollo/now.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "builds": [ 4 | { "src": "package.json", "use": "@now/static-build", "config": { "distDir": "public" } } 5 | ] 6 | } -------------------------------------------------------------------------------- /svelte-apollo/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/svelte-apollo/public/favicon.png -------------------------------------------------------------------------------- /svelte-apollo/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Svelte app 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /svelte-apollo/src/main.js: -------------------------------------------------------------------------------- 1 | import App from './App.svelte'; 2 | 3 | const app = new App({ 4 | target: document.body, 5 | }); 6 | 7 | export default app; -------------------------------------------------------------------------------- /tic-tac-toe-react/client/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env 17 | .env.local 18 | .env.development.local 19 | .env.test.local 20 | .env.production.local 21 | 22 | npm-debug.log* 23 | yarn-debug.log* 24 | yarn-error.log* 25 | -------------------------------------------------------------------------------- /tic-tac-toe-react/client/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:carbon as builder 2 | 3 | ENV NODE_ENV=PRODUCTION 4 | 5 | WORKDIR /app 6 | 7 | COPY package.json ./ 8 | 9 | RUN npm install 10 | 11 | COPY . . 12 | 13 | RUN npm run build 14 | 15 | FROM node:8-alpine 16 | 17 | RUN npm -g install serve 18 | 19 | WORKDIR /app 20 | 21 | COPY --from=builder /app/build . 22 | 23 | EXPOSE 8000 24 | 25 | CMD ["serve", "-s", "-p", "8000"] 26 | -------------------------------------------------------------------------------- /tic-tac-toe-react/client/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/tic-tac-toe-react/client/public/favicon.png -------------------------------------------------------------------------------- /tic-tac-toe-react/client/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /tic-tac-toe-react/client/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /tic-tac-toe-react/client/src/components/Utils.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Spinner } from 'react-bootstrap'; 3 | 4 | export const LoadingIndicator = () => { 5 | return ( 6 |
7 | 8 |
9 | ) 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /tic-tac-toe-react/client/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 5 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 6 | sans-serif; 7 | -webkit-font-smoothing: antialiased; 8 | -moz-osx-font-smoothing: grayscale; 9 | color: #565656; 10 | } 11 | 12 | code { 13 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 14 | monospace; 15 | } 16 | 17 | h2 { 18 | color: #565656; 19 | } 20 | 21 | a { 22 | text-decoration: all; 23 | } -------------------------------------------------------------------------------- /tic-tac-toe-react/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080/ 3 | api_paths: 4 | v1_query: v1/query 5 | v2_query: v2/query 6 | v1_metadata: v1/metadata 7 | graphql: v1/graphql 8 | config: v1alpha1/config 9 | pg_dump: v1alpha1/pg_dump 10 | version: v1/version 11 | metadata_directory: metadata 12 | migrations_directory: migrations 13 | seeds_directory: seeds 14 | actions: 15 | kind: synchronous 16 | handler_webhook_baseurl: http://localhost:3000 17 | codegen: 18 | framework: "" 19 | output_dir: "" 20 | -------------------------------------------------------------------------------- /tic-tac-toe-react/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tic-tac-toe-react/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /tic-tac-toe-react/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /tic-tac-toe-react/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /tic-tac-toe-react/hasura/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: default 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | database_url: 6 | from_env: SAMPLE_APPS_DATABASE_URL 7 | pool_settings: 8 | idle_timeout: 180 9 | max_connections: 50 10 | retries: 1 11 | tables: 12 | - "!include default/tables/public_board.yaml" 13 | - "!include default/tables/public_move.yaml" 14 | - "!include default/tables/public_user.yaml" 15 | functions: [] 16 | -------------------------------------------------------------------------------- /tic-tac-toe-react/hasura/metadata/databases/default/tables/public_board.yaml: -------------------------------------------------------------------------------- 1 | array_relationships: 2 | - name: moves 3 | using: 4 | foreign_key_constraint_on: 5 | column: board_id 6 | table: 7 | name: move 8 | schema: public 9 | object_relationships: 10 | - name: user1 11 | using: 12 | foreign_key_constraint_on: user_1_id 13 | - name: user2 14 | using: 15 | foreign_key_constraint_on: user_2_id 16 | table: 17 | name: board 18 | schema: public 19 | -------------------------------------------------------------------------------- /tic-tac-toe-react/hasura/metadata/databases/default/tables/public_move.yaml: -------------------------------------------------------------------------------- 1 | object_relationships: 2 | - name: user 3 | using: 4 | foreign_key_constraint_on: user_id 5 | table: 6 | name: move 7 | schema: public 8 | -------------------------------------------------------------------------------- /tic-tac-toe-react/hasura/metadata/databases/default/tables/public_user.yaml: -------------------------------------------------------------------------------- 1 | table: 2 | name: user 3 | schema: public 4 | -------------------------------------------------------------------------------- /tic-tac-toe-react/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /tic-tac-toe-react/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | - name: tic-tac-toe 2 | definition: 3 | url_from_env: TIC_TAC_REMOTE_SCHEMA_URL 4 | timeout_seconds: 60 5 | forward_client_headers: true 6 | -------------------------------------------------------------------------------- /tic-tac-toe-react/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /tic-tac-toe-react/remote-schema/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /tic-tac-toe-react/remote-schema/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /tic-tac-toe-react/remote-schema/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:alpine 2 | 3 | WORKDIR /app 4 | 5 | COPY package*.json ./ 6 | 7 | RUN npm install 8 | 9 | COPY ./* /app/ 10 | 11 | CMD ["npm", "start"] 12 | -------------------------------------------------------------------------------- /tic-tac-toe-react/remote-schema/README.md: -------------------------------------------------------------------------------- 1 | This is a remote schema that makes the `tic-tac-toe` move as a transaction. 2 | -------------------------------------------------------------------------------- /tic-tac-toe-react/remote-schema/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "remote-schema-example", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "dependencies": { 7 | "apollo-server": "^2.4.8", 8 | "graphql": "^14.2.1", 9 | "graphql-tools": "^4.0.4", 10 | "knex": "^0.16.5", 11 | "node-fetch": "^2.3.0", 12 | "pg": "^7.10.0" 13 | }, 14 | "scripts": { 15 | "start": "node -r esm index.js" 16 | }, 17 | "devDependencies": { 18 | "esm": "^3.2.22" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /todo-auth0-jwt/.dockerignore: -------------------------------------------------------------------------------- 1 | package-lock.json 2 | node_modules 3 | .gitignore 4 | exec.sh 5 | exec.ps1 6 | README.md 7 | -------------------------------------------------------------------------------- /todo-auth0-jwt/.gitignore: -------------------------------------------------------------------------------- 1 | ws 2 | -------------------------------------------------------------------------------- /todo-auth0-jwt/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080/ 3 | api_paths: 4 | v1_query: v1/query 5 | v2_query: v2/query 6 | v1_metadata: v1/metadata 7 | graphql: v1/graphql 8 | config: v1alpha1/config 9 | pg_dump: v1alpha1/pg_dump 10 | version: v1/version 11 | metadata_directory: metadata 12 | migrations_directory: migrations 13 | seeds_directory: seeds 14 | actions: 15 | kind: synchronous 16 | handler_webhook_baseurl: http://localhost:3000 17 | codegen: 18 | framework: "" 19 | output_dir: "" 20 | -------------------------------------------------------------------------------- /todo-auth0-jwt/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /todo-auth0-jwt/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /todo-auth0-jwt/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /todo-auth0-jwt/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /todo-auth0-jwt/hasura/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: default 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | database_url: 6 | from_env: SAMPLE_APPS_DATABASE_URL 7 | pool_settings: 8 | idle_timeout: 180 9 | max_connections: 50 10 | retries: 1 11 | tables: 12 | - "!include default/tables/public_todo.yaml" 13 | functions: [] 14 | -------------------------------------------------------------------------------- /todo-auth0-jwt/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /todo-auth0-jwt/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /todo-auth0-jwt/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /todo-auth0-jwt/hasura/migrations/default/1613665146384_init/up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE public.todo ( 2 | id integer NOT NULL, 3 | task text NOT NULL, 4 | completed boolean NOT NULL, 5 | user_id text NOT NULL 6 | ); 7 | CREATE SEQUENCE public.todo_id_seq 8 | AS integer 9 | START WITH 1 10 | INCREMENT BY 1 11 | NO MINVALUE 12 | NO MAXVALUE 13 | CACHE 1; 14 | ALTER SEQUENCE public.todo_id_seq OWNED BY public.todo.id; 15 | ALTER TABLE ONLY public.todo ALTER COLUMN id SET DEFAULT nextval('public.todo_id_seq'::regclass); 16 | ALTER TABLE ONLY public.todo 17 | ADD CONSTRAINT todo_pkey PRIMARY KEY (id); 18 | -------------------------------------------------------------------------------- /todo-auth0-jwt/todo-app/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | node_modules 5 | 6 | # testing 7 | coverage 8 | 9 | # production 10 | build 11 | 12 | # misc 13 | .DS_Store 14 | .env 15 | npm-debug.log 16 | -------------------------------------------------------------------------------- /todo-auth0-jwt/todo-app/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:8.7-alpine 2 | 3 | WORKDIR /home/app 4 | 5 | RUN npm install -g create-react-app 6 | ADD package.json /home/app 7 | RUN npm install 8 | ADD . /home/app 9 | 10 | CMD ["npm", "start"] 11 | 12 | EXPOSE 3000 13 | -------------------------------------------------------------------------------- /todo-auth0-jwt/todo-app/exec.ps1: -------------------------------------------------------------------------------- 1 | docker build -t auth0-react-01-login . 2 | docker run -p 3000:3000 -it auth0-react-01-login 3 | -------------------------------------------------------------------------------- /todo-auth0-jwt/todo-app/exec.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | docker build -t auth0-react-01-login . 3 | docker run -p 3000:3000 -it auth0-react-01-login 4 | -------------------------------------------------------------------------------- /todo-auth0-jwt/todo-app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/todo-auth0-jwt/todo-app/public/favicon.ico -------------------------------------------------------------------------------- /todo-auth0-jwt/todo-app/src/App.css: -------------------------------------------------------------------------------- 1 | .btn-margin { 2 | margin: 7px 3px; 3 | } 4 | 5 | .center { 6 | display: flex; 7 | align-items: center; 8 | justify-content: center; 9 | } 10 | 11 | .container { 12 | padding-top: 50px; 13 | } 14 | -------------------------------------------------------------------------------- /todo-auth0-jwt/todo-app/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | }); 9 | -------------------------------------------------------------------------------- /todo-auth0-jwt/todo-app/src/Auth/auth0-variables.js: -------------------------------------------------------------------------------- 1 | import { 2 | authDomain, 3 | authClientId 4 | } from '../constants'; 5 | 6 | export const AUTH_CONFIG = { 7 | domain: authDomain, 8 | clientId: authClientId, 9 | callbackUrl: 'http://localhost:3000/callback' 10 | }; 11 | -------------------------------------------------------------------------------- /todo-auth0-jwt/todo-app/src/Todo/TodoComponent.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './Todo.css'; 3 | import TodoInput from './TodoInput'; 4 | import TodoList from './TodoList'; 5 | 6 | export default class TodoComponent extends React.Component { 7 | 8 | render() { 9 | const userId = localStorage.getItem('auth0:id_token:sub'); 10 | return ( 11 |
12 |

Todos

13 | 14 | 15 |
16 | ) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /todo-auth0-jwt/todo-app/src/constants.js: -------------------------------------------------------------------------------- 1 | export const GRAPHQL_URL = 'https://hasura-todo-auth0-jwt.hasura.app/v1/graphql'; 2 | export const authClientId = "xxxxxxxxxxxxxxxxxxxxx"; 3 | export const authDomain = ".auth0.com"; 4 | -------------------------------------------------------------------------------- /todo-auth0-jwt/todo-app/src/history.js: -------------------------------------------------------------------------------- 1 | import createHistory from 'history/createBrowserHistory' 2 | 3 | export default createHistory() 4 | -------------------------------------------------------------------------------- /todo-auth0-jwt/todo-app/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /todo-auth0-jwt/todo-app/src/index.js: -------------------------------------------------------------------------------- 1 | import ReactDOM from 'react-dom'; 2 | import './index.css'; 3 | import 'bootstrap/dist/css/bootstrap.css'; 4 | import { makeMainRoutes } from './routes'; 5 | 6 | const routes = makeMainRoutes(); 7 | ReactDOM.render( 8 | routes, 9 | document.getElementById('root') 10 | ); 11 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/app/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not ie <= 8 4 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/app/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .git 3 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/app/.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | 3 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/app/auth_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "domain": "", 3 | "clientId": "" 4 | } -------------------------------------------------------------------------------- /vuejs-auth0-graphql/app/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ["@vue/app"] 3 | }; 4 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/app/exec.ps1: -------------------------------------------------------------------------------- 1 | docker build --rm -t auth0-vue-01-login . 2 | docker run -p 3000:3000 --pid=host auth0-vue-01-login -------------------------------------------------------------------------------- /vuejs-auth0-graphql/app/exec.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | docker build --rm -t auth0-vue-01-login . 4 | docker run -p 3000:3000 --pid=host auth0-vue-01-login -------------------------------------------------------------------------------- /vuejs-auth0-graphql/app/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuejs-auth0-graphql/app/public/favicon.ico -------------------------------------------------------------------------------- /vuejs-auth0-graphql/app/public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuejs-auth0-graphql/app/public/logo.png -------------------------------------------------------------------------------- /vuejs-auth0-graphql/app/server.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | const express = require("express"); 3 | const { join } = require("path"); 4 | const morgan = require("morgan"); 5 | const app = express(); 6 | 7 | app.use(morgan("dev")); 8 | app.use(express.static(join(__dirname, "dist"))); 9 | 10 | app.use((_, res) => { 11 | res.sendFile(join(__dirname, "dist", "index.html")); 12 | }); 13 | 14 | app.listen(3000, () => console.log("Listening on port 3000")); 15 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/app/src/plugins/auth.js: -------------------------------------------------------------------------------- 1 | import authService from "../auth/authService"; 2 | 3 | export default { 4 | install(Vue) { 5 | Vue.prototype.$auth = authService; 6 | 7 | Vue.mixin({ 8 | created() { 9 | if (this.handleLoginEvent) { 10 | authService.addListener("loginEvent", this.handleLoginEvent); 11 | } 12 | }, 13 | 14 | destroyed() { 15 | if (this.handleLoginEvent) { 16 | authService.removeListener("loginEvent", this.handleLoginEvent); 17 | } 18 | } 19 | }); 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/app/vue.config.js: -------------------------------------------------------------------------------- 1 | const webpack = require("webpack"); 2 | 3 | module.exports = { 4 | devServer: { 5 | port: 3000 6 | }, 7 | configureWebpack: { 8 | plugins: [ 9 | new webpack.ProvidePlugin({ 10 | $: "jquery", 11 | jquery: "jquery", 12 | "window.jQuery": "jquery", 13 | jQuery: "jquery" 14 | }) 15 | ] 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080/ 3 | api_paths: 4 | v1_query: v1/query 5 | v2_query: v2/query 6 | v1_metadata: v1/metadata 7 | graphql: v1/graphql 8 | config: v1alpha1/config 9 | pg_dump: v1alpha1/pg_dump 10 | version: v1/version 11 | metadata_directory: metadata 12 | migrations_directory: migrations 13 | seeds_directory: seeds 14 | actions: 15 | kind: synchronous 16 | handler_webhook_baseurl: http://localhost:3000 17 | codegen: 18 | framework: "" 19 | output_dir: "" 20 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/hasura/metadata/databases/databases.yaml: -------------------------------------------------------------------------------- 1 | - name: default 2 | kind: postgres 3 | configuration: 4 | connection_info: 5 | database_url: 6 | from_env: SAMPLE_APPS_DATABASE_URL 7 | pool_settings: 8 | idle_timeout: 180 9 | max_connections: 50 10 | retries: 1 11 | tables: 12 | - "!include default/tables/public_article.yaml" 13 | - "!include default/tables/public_users.yaml" 14 | functions: [] 15 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/hasura/metadata/databases/default/tables/public_users.yaml: -------------------------------------------------------------------------------- 1 | select_permissions: 2 | - permission: 3 | columns: 4 | - auth0_id 5 | - name 6 | - created_at 7 | filter: 8 | auth0_id: 9 | _eq: X-Hasura-User-Id 10 | role: user 11 | table: 12 | name: users 13 | schema: public 14 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /vuejs-auth0-graphql/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not ie <= 10 -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | '@vue/standard' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/.postcssrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ], 5 | plugins: [ 6 | ["transform-imports", { 7 | "vuetify": { 8 | "transform": "vuetify/es5/components/${member}", 9 | "preventFullImport": true 10 | } 11 | }] 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuetify-vuex-todo-graphql/public/favicon.ico -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/public/img/icons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuetify-vuex-todo-graphql/public/img/icons/android-chrome-192x192.png -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/public/img/icons/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuetify-vuex-todo-graphql/public/img/icons/android-chrome-512x512.png -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/public/img/icons/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuetify-vuex-todo-graphql/public/img/icons/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/public/img/icons/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuetify-vuex-todo-graphql/public/img/icons/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/public/img/icons/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuetify-vuex-todo-graphql/public/img/icons/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/public/img/icons/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuetify-vuex-todo-graphql/public/img/icons/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/public/img/icons/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuetify-vuex-todo-graphql/public/img/icons/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/public/img/icons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuetify-vuex-todo-graphql/public/img/icons/apple-touch-icon.png -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/public/img/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuetify-vuex-todo-graphql/public/img/icons/favicon-16x16.png -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/public/img/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuetify-vuex-todo-graphql/public/img/icons/favicon-32x32.png -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/public/img/icons/msapplication-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuetify-vuex-todo-graphql/public/img/icons/msapplication-icon-144x144.png -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/public/img/icons/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuetify-vuex-todo-graphql/public/img/icons/mstile-150x150.png -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vuetify-vuex-todo-graphql", 3 | "short_name": "vuetify-todo", 4 | "icons": [ 5 | { 6 | "src": "/img/icons/android-chrome-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "/img/icons/android-chrome-512x512.png", 12 | "sizes": "512x512", 13 | "type": "image/png" 14 | } 15 | ], 16 | "start_url": "/index.html", 17 | "display": "standalone", 18 | "background_color": "#000000", 19 | "theme_color": "#4DBA87" 20 | } 21 | -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/src/App.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 19 | -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/vuetify-vuex-todo-graphql/src/assets/logo.png -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import store from './store' 5 | import apolloProvider from './apollo' 6 | import './registerServiceWorker' 7 | import './vuetify' 8 | 9 | Vue.config.productionTip = false 10 | 11 | new Vue({ 12 | router, 13 | store, 14 | apolloProvider, 15 | render: h => h(App) 16 | }).$mount('#app') 17 | -------------------------------------------------------------------------------- /vuetify-vuex-todo-graphql/src/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import Home from './views/Home.vue' 4 | 5 | Vue.use(Router) 6 | 7 | const router = new Router({ 8 | scrollBehavior: () => ({ y: 0 }), 9 | routes: [ 10 | { 11 | path: '/:filter', 12 | name: 'home', 13 | component: Home, 14 | props: true 15 | } 16 | ] 17 | }) 18 | 19 | router.beforeEach((to, from, next) => { 20 | if (['all', 'active', 'completed'].some(record => record === to.params.filter)) { 21 | next() 22 | } else { 23 | next('/all') 24 | } 25 | }) 26 | 27 | export default router 28 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/auth-server/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/auth-server/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/auth-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:8.9.1 2 | 3 | RUN mkdir -p /opt/app 4 | 5 | RUN chown node:node /opt/app 6 | 7 | WORKDIR /opt/app 8 | 9 | COPY --chown=node:node package.json . 10 | 11 | USER node 12 | 13 | RUN npm install 14 | 15 | COPY --chown=node:node . . 16 | 17 | CMD npm start 18 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/auth-server/Procfile: -------------------------------------------------------------------------------- 1 | web: npm start 2 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/auth-server/db/migrations/20180917160913_users.js: -------------------------------------------------------------------------------- 1 | 2 | exports.up = function(knex, Promise) { 3 | return knex.schema.createTable('users', (table) => { 4 | table.increments(); 5 | table.string('username').unique().notNullable(); 6 | table.string('password').notNullable(); 7 | table.timestamp('created_at').notNullable().defaultTo(knex.raw('now()')); 8 | }); 9 | }; 10 | 11 | exports.down = function(knex, Promise) { 12 | return knex.schema.dropTable('users'); 13 | }; 14 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/auth-server/knexfile.js: -------------------------------------------------------------------------------- 1 | // Update with your config settings. 2 | 3 | const databaseName = "postgres"; 4 | const pg = require('pg'); 5 | 6 | const connection_url = process.env.DATABASE_URL || `postgres://postgres:@localhost:5432/${databaseName}`; 7 | 8 | module.exports = { 9 | client: 'pg', 10 | connection: connection_url, 11 | migrations: { 12 | directory: __dirname + '/db/migrations' 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/hasura/config.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | endpoint: http://localhost:8080/ 3 | api_paths: 4 | v1_query: v1/query 5 | v2_query: v2/query 6 | v1_metadata: v1/metadata 7 | graphql: v1/graphql 8 | config: v1alpha1/config 9 | pg_dump: v1alpha1/pg_dump 10 | version: v1/version 11 | metadata_directory: metadata 12 | migrations_directory: migrations 13 | seeds_directory: seeds 14 | actions: 15 | kind: synchronous 16 | handler_webhook_baseurl: http://localhost:3000 17 | codegen: 18 | framework: "" 19 | output_dir: "" 20 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/hasura/metadata/actions.graphql: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/hasura/metadata/actions.yaml: -------------------------------------------------------------------------------- 1 | actions: [] 2 | custom_types: 3 | enums: [] 4 | input_objects: [] 5 | objects: [] 6 | scalars: [] 7 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/hasura/metadata/allow_list.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/hasura/metadata/cron_triggers.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/hasura/metadata/query_collections.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/hasura/metadata/remote_schemas.yaml: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/hasura/metadata/version.yaml: -------------------------------------------------------------------------------- 1 | version: 3 2 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | .env 4 | build 5 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:carbon 2 | 3 | # Create app directory 4 | WORKDIR /app 5 | 6 | # Install app dependencies 7 | RUN npm -g install serve 8 | # A wildcard is used to ensure both package.json AND package-lock.json are copied 9 | COPY package*.json ./ 10 | 11 | RUN npm install 12 | 13 | # Bundle app source 14 | COPY . /app 15 | #Build react/vue/angular bundle static files 16 | #RUN npm run generate 17 | RUN npm run build 18 | 19 | EXPOSE 8080 20 | # serve build folder on port 8080 21 | CMD ["serve", "-s", "build", "-p", "8080"] 22 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/codegen-interpreter.ts: -------------------------------------------------------------------------------- 1 | require('ts-node').register({ 2 | transpileOnly: true, 3 | compilerOptions: { 4 | module: 'commonjs' 5 | } 6 | }) 7 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/now.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"whatsapp-clone", 3 | "version": 1, 4 | "env": { 5 | "REACT_APP_SERVER_URL": "https://whatsapp-clone-hasura.herokuapp.com/v1/graphql", 6 | "REACT_APP_AUTH_URL": "https://warm-hamlet-82072.herokuapp.com" 7 | }, 8 | "public": true, 9 | "alias": ["whatsapp-clone-hasura.now.sh"] 10 | } 11 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/public/assets/chat-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/whatsapp-clone-typescript-react/react-app/public/assets/chat-background.jpg -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/public/assets/default-group-pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/whatsapp-clone-typescript-react/react-app/public/assets/default-group-pic.jpg -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/public/assets/default-profile-pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/whatsapp-clone-typescript-react/react-app/public/assets/default-profile-pic.jpg -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/public/assets/whatsapp-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/whatsapp-clone-typescript-react/react-app/public/assets/whatsapp-icon.png -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hasura/sample-apps/02ca14387f05914135e18352e6c3bac401b68f32/whatsapp-clone-typescript-react/react-app/public/favicon.png -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "WhatsApp Clone", 3 | "name": "WhatsApp Clone", 4 | "icons": [ 5 | { 6 | "src": "favicon.png", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base", 4 | ":automergeMajor" 5 | ], 6 | "baseBranches": [ 7 | "master-step1", 8 | "master-step2", 9 | "master-step3", 10 | "master-step4" 11 | ], 12 | "prHourlyLimit": 60, 13 | "recreateClosed": true 14 | } 15 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/App.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/components/SettingsScreen/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | import { Suspense } from 'react' 3 | import { RouteComponentProps } from 'react-router-dom' 4 | import Navbar from '../Navbar' 5 | import SettingsForm from './SettingsForm' 6 | import SettingsNavbar from './SettingsNavbar' 7 | 8 | export default ({ history }: RouteComponentProps) => ( 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | ) 18 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/graphql/.gitignore: -------------------------------------------------------------------------------- 1 | introspection.json 2 | types.ts 3 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/graphql/fragments/chat.fragment.ts: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag' 2 | import message from './message.fragment' 3 | 4 | export default gql ` 5 | fragment chat on chat { 6 | id 7 | name 8 | picture 9 | owner_id 10 | created_at 11 | messages(order_by:[{created_at: asc}]) { 12 | ...message 13 | } 14 | } 15 | ${message} 16 | ` 17 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/graphql/fragments/index.ts: -------------------------------------------------------------------------------- 1 | export { default as chat } from './chat.fragment' 2 | export { default as message } from './message.fragment' 3 | export { default as messageUser } from './messageUser.fragment' 4 | export { default as user } from './user.fragment' 5 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/graphql/fragments/message.fragment.ts: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag' 2 | 3 | export default gql` 4 | fragment message on message { 5 | id 6 | chat_id 7 | sender { 8 | id 9 | name 10 | } 11 | content 12 | created_at 13 | } 14 | ` 15 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/graphql/fragments/messageUser.fragment.ts: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag' 2 | 3 | export default gql` 4 | fragment messageUser on message_user { 5 | id 6 | chat_id 7 | sender { 8 | id 9 | name 10 | } 11 | content 12 | created_at 13 | } 14 | ` 15 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/graphql/fragments/user.fragment.ts: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag' 2 | 3 | export default gql` 4 | fragment user on users { 5 | id 6 | username 7 | name 8 | picture 9 | } 10 | ` 11 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/graphql/queries/chats.query.ts: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag' 2 | import * as fragments from '../fragments' 3 | 4 | export default gql ` 5 | query Chats { 6 | chat { 7 | ...chat 8 | messages { 9 | ...message 10 | } 11 | } 12 | } 13 | ${fragments.chat} 14 | ${fragments.message} 15 | ` 16 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/graphql/queries/index.ts: -------------------------------------------------------------------------------- 1 | export { default as chats } from './chats.query' 2 | export { default as users } from './users.query' 3 | export { default as me } from './me.query' 4 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/graphql/queries/me.query.ts: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag' 2 | import * as fragments from '../fragments' 3 | 4 | export default gql ` 5 | query Me { 6 | users { 7 | ...user 8 | } 9 | } 10 | ${fragments.user} 11 | ` 12 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/graphql/queries/users.query.ts: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag' 2 | import * as fragments from '../fragments' 3 | 4 | export default gql ` 5 | query Users { 6 | users { 7 | ...user 8 | } 9 | } 10 | ${fragments.user} 11 | ` 12 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/graphql/subscriptions/chatUpdated.subscription.ts: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag' 2 | import * as fragments from '../fragments' 3 | 4 | export default gql ` 5 | subscription ChatsListQuerySubUpdate($userId: Int!) { 6 | chat(order_by:[{messages_aggregate:{max:{created_at:desc}}}]) { 7 | ...chat 8 | users(where:{user_id:{_neq:$userId}}) { 9 | user { 10 | ...user 11 | } 12 | } 13 | } 14 | } 15 | ${fragments.chat} 16 | ${fragments.user} 17 | ` 18 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/graphql/subscriptions/index.ts: -------------------------------------------------------------------------------- 1 | export { default as chatUpdated } from './chatUpdated.subscription' 2 | export { default as messageAdded } from './messageAdded.subscription' 3 | export { default as userUpdated } from './userUpdated.subscription' 4 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/graphql/subscriptions/messageAdded.subscription.ts: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag' 2 | import * as fragments from '../fragments' 3 | 4 | export default gql ` 5 | subscription MessageAdded { 6 | message_user { 7 | ...messageUser 8 | } 9 | } 10 | ${fragments.messageUser} 11 | ` 12 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/graphql/subscriptions/userUpdated.subscription.ts: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag' 2 | import * as fragments from '../fragments' 3 | 4 | export default gql ` 5 | subscription UserUpdated { 6 | users(order_by:[{id:desc}]) { 7 | ...user 8 | } 9 | } 10 | ${fragments.user} 11 | ` 12 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/index.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary-bg: #2c6157; 3 | --secondary-bg: #6fd056; 4 | --primary-text: white; 5 | --secondary-text: white; 6 | } 7 | 8 | html { 9 | height: 100%; 10 | } 11 | 12 | body { 13 | height: 100%; 14 | margin: 0; 15 | padding: 0; 16 | font-family: Roboto, "Helvetica Neue", sans-serif; 17 | } 18 | 19 | #root { 20 | height: 100%; 21 | } 22 | 23 | .Screen { 24 | position: relative; 25 | height: 100%; 26 | } 27 | -------------------------------------------------------------------------------- /whatsapp-clone-typescript-react/react-app/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | --------------------------------------------------------------------------------