{"id":13472820,"url":"https://github.com/abhi40308/instagram-clone","last_synced_at":"2025-03-21T15:31:17.306Z","repository":{"id":119884777,"uuid":"203318714","full_name":"abhi40308/instagram-clone","owner":"abhi40308","description":"Instagram clone using apollo, react and graphQl (hasura-graphQl engine)","archived":false,"fork":false,"pushed_at":"2023-03-01T06:45:23.000Z","size":4600,"stargazers_count":45,"open_issues_count":13,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T02:36:18.407Z","etag":null,"topics":["apollo","apollo-cache","auth0-jwt","graphql","hasura","hasura-graphql-engine","instagram","instagram-clone","react","realtime-updates"],"latest_commit_sha":null,"homepage":"https://priceless-goldstine-20854c.netlify.app/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abhi40308.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-08-20T07:00:42.000Z","updated_at":"2024-03-19T00:23:27.000Z","dependencies_parsed_at":"2023-04-24T15:01:46.440Z","dependency_job_id":null,"html_url":"https://github.com/abhi40308/instagram-clone","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhi40308%2Finstagram-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhi40308%2Finstagram-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhi40308%2Finstagram-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhi40308%2Finstagram-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhi40308","download_url":"https://codeload.github.com/abhi40308/instagram-clone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244822634,"owners_count":20516143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apollo","apollo-cache","auth0-jwt","graphql","hasura","hasura-graphql-engine","instagram","instagram-clone","react","realtime-updates"],"created_at":"2024-07-31T16:00:58.265Z","updated_at":"2025-03-21T15:31:16.839Z","avatar_url":"https://github.com/abhi40308.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Instagram Clone using React, Apollo-React-Client and Hasura GraphQl Engine\n\nNote: This project was build as a part of a tutorial blog post, check out the tutorial [here](https://hasura.io/blog/instagram-clone-react-graphql-hasura-part1/).\n\nSee live demo [here](https://priceless-goldstine-20854c.netlify.com/)(may be slow to load due to free hosting). This application demonstrates consuming GraphQl Api provided by [Hasura GraphQL Engine](https://hasura.io) using a react app. Uses react-apollo GraphQL client to make requests to the api. Users can create account using [Auth0 JWT authentication](https://auth0.com/) which is then verified by Hasura. React-router is used to provide SPA experience.\n\nAuthenticated users can:\n* Create new posts\n* Like posts\n* Follow user profiles\n* Realtime updates when other users upvote a post, create a new post or follow user profile (updating apollo cache).\n\n## Installation\n\nInstalling and running on local system require:\n* [Setting up Hasura Server](https://docs.hasura.io/1.0/graphql/manual/getting-started/heroku-simple.html) (deployed on Heroku), and creating required tables\n* [Setting up Auth0](https://auth0.com/docs/quickstart/spa/react/01-login#configure-auth0)\n* See [this](https://docs.hasura.io/1.0/graphql/manual/guides/integrations/auth0-jwt.html) guide for Auth0 JWT Integration with Hasura\n* Clone or download this repo, install the required packages and run `npm start`\n\n## npm packages:\n\nYou will need the following npm packages:\n* [react-router-dom](https://www.npmjs.com/package/react-router-dom)\n* [react-bootstrap](https://www.npmjs.com/package/react-bootstrap)\n* [apollo-boost](https://www.npmjs.com/package/apollo-boost)\n* [@apollo/react-hooks](https://www.npmjs.com/package/@apollo/react-hooks)\n* [apollo-link-context](https://www.npmjs.com/package/apollo-link-context)\n* [@apollo/react-hoc](https://www.npmjs.com/package/@apollo/react-hoc)\n* [graphql](https://www.npmjs.com/package/graphql)\n* [@auth0/auth0-spa-js](https://www.npmjs.com/package/@auth0/auth0-spa-js)\n\n\n## Creating tables \n\nFollowing tables required to be created:\n```\ntype Post {\nid - integer, primary key\ncaption - text\nurl - text\ncreated_at - timestamp with time zone\nuser_id - text\n}\n \ntype User {\nname - text\nlast_seen - timestamp with time zone\navatar - text\nemail - text\nid - text, primary key\n}\n\ntype Like {\nid - integer, primary key\nuser_id - text\npost_id - integer\n}\n\ntype Follow {\nid - integer, primary key\nfollower_id - text\nfollowing_id - text\n}\n```\n`Post.user_id` and `User.id` have object relationship in table `Post` and array relationship in table `User`. `Like.post_id` and `Post.id` have array relationship in table `Post`. Row and Column permissions should be given accordingly.\n\n## User Authentication\n\nSee [Setting up Auth0 with react](https://auth0.com/docs/quickstart/spa/react/01-login#configure-auth0) and [this](https://docs.hasura.io/1.0/graphql/manual/guides/integrations/auth0-jwt.html) guide for Auth0 JWT Integration with Hasura. Here we are using Auth0 Universal Login.\n\n## Realtime updates\n\nUsing apollo cache and react state, we can give realtime updates for likes, new posts and follows. Apollo `refetchQueries` function updates apollo cache with refetched data.\n\n## Preview\nApp: \n![App](https://blog.hasura.io/content/images/2019/08/Final_app.png)  \n\nUser Profile:\n![User Profile](https://blog.hasura.io/content/images/2019/08/Now_app3.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhi40308%2Finstagram-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhi40308%2Finstagram-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhi40308%2Finstagram-clone/lists"}