├── README.md ├── backend ├── .env.example ├── .gitignore ├── .yarn │ ├── install-state.gz │ └── releases │ │ └── yarn-3.2.0.cjs ├── .yarnrc.yml ├── Procfile ├── README.md ├── bundle.js ├── cartoon.mp4 ├── index.js ├── package.json ├── rollup.config.js └── uploads │ └── cartoon9.mp4 └── frontend ├── .firebaserc ├── .gitignore ├── README.md ├── firebase.json ├── index.html ├── package-lock.json ├── package.json ├── public ├── favicon.ico ├── logo.png ├── manifest.json └── robots.txt ├── src ├── App.jsx ├── abi │ └── LensHub.json ├── assets │ ├── Bookmark.jsx │ ├── Camera.jsx │ ├── CaretDown.jsx │ ├── Check.jsx │ ├── Comment.jsx │ ├── Community.jsx │ ├── Compass.jsx │ ├── Error.jsx │ ├── Explore.jsx │ ├── Eye.jsx │ ├── EyeSlash.jsx │ ├── Filmstrip.jsx │ ├── FullScreen.jsx │ ├── Globe.jsx │ ├── Headphones.jsx │ ├── Heart.jsx │ ├── Home.jsx │ ├── Logout.jsx │ ├── Pause.jsx │ ├── Play.jsx │ ├── Profile.jsx │ ├── Retweet.jsx │ ├── Spinner.jsx │ ├── Subscriptions.jsx │ ├── Thumbnail.jsx │ ├── VolumeSpeaker.jsx │ ├── Webcam.jsx │ ├── X.jsx │ ├── avatar.png │ ├── bg.png │ ├── iris.svg │ ├── logo-open.png │ ├── logo.svg │ ├── opensea.svg │ ├── rainbow.png │ └── settings.svg ├── components │ ├── Apollo.jsx │ ├── Button.jsx │ ├── Card.jsx │ ├── Checkbox.jsx │ ├── Collect.jsx │ ├── Comment.jsx │ ├── Compose.jsx │ ├── Feed.jsx │ ├── Follow.jsx │ ├── Icon.jsx │ ├── Image.jsx │ ├── Like.jsx │ ├── Livepeer.jsx │ ├── Livestream.jsx │ ├── Login.jsx │ ├── Mirror.jsx │ ├── Modal.jsx │ ├── Nav.jsx │ ├── Post.jsx │ ├── Profile.jsx │ ├── Toast.jsx │ ├── Unfollow.jsx │ ├── Video.jsx │ ├── VisibilitySelector.jsx │ ├── Wallet.jsx │ └── WalletButton.jsx ├── index.jsx ├── pages │ ├── LandingPage.jsx │ ├── NewProfile.jsx │ ├── NotFound.jsx │ ├── Outlet.jsx │ ├── Post.jsx │ └── User.jsx ├── react-app-env.d.ts ├── theme │ ├── GlobalStyle.jsx │ └── ThemeProvider.jsx └── utils │ ├── constants.jsx │ ├── gradients.jsx │ ├── index.jsx │ ├── infuraClient.jsx │ ├── litIntegration.jsx │ ├── pollUntilIndexed.jsx │ ├── queries.jsx │ └── wallet.jsx ├── tsconfig.json └── vite.config.js /README.md: -------------------------------------------------------------------------------- 1 | # iris 2 | 3 | lens protocol social media implementation 4 | 5 | ## Getting Started 6 | 7 | You will need Metamask installed on Google Chrome, connected to Polygon Mumbai network 8 | 9 | `npm install` to install all dependencies 10 | 11 | ## Frontend 12 | 13 | `cd frontend` 14 | 15 | `npm install` install deps 16 | 17 | `npm start` run react app at http://localhost:3000/ 18 | 19 | ### Gasless 20 | 21 | On localhost you must run app on port 4783 to enable gasless tx with Lens API 22 | 23 | `/frontend/.env` add `PORT=4783` 24 | 25 | ### Changing Chain 26 | 27 | Default chain on localhost is `mumbai`. If you want to change it change `/frontend/.env` to `VITE_CHAIN="polygon"` 28 | 29 | 30 | Remember all `.env` changes require an `npm start` restart. 31 | 32 | ## Deploying 33 | 34 | Testnet 35 | - change `.env` to `VITE_CHAIN="mumbai"` 36 | - `npm run build` 37 | - `firebase deploy --only hosting:testnet` 38 | 39 | Prod 40 | - change `.env` to `VITE_CHAIN="polygon"` or remove `VITE_CHAIN` 41 | - `npm run build` 42 | - `firebase deploy --only hosting:prod` -------------------------------------------------------------------------------- /backend/.env.example: -------------------------------------------------------------------------------- 1 | LIVEPEER_API_KEY = "" -------------------------------------------------------------------------------- /backend/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /backend/.yarn/install-state.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irisxyz/iris/b852582acf9135e8c557afcd72e464bbef5cdbee/backend/.yarn/install-state.gz -------------------------------------------------------------------------------- /backend/.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | 3 | yarnPath: .yarn/releases/yarn-3.2.0.cjs 4 | -------------------------------------------------------------------------------- /backend/Procfile: -------------------------------------------------------------------------------- 1 | web: node index.js 2 | -------------------------------------------------------------------------------- /backend/README.md: -------------------------------------------------------------------------------- 1 | 1. Just yarn install 2 | 2. And then run `node ./index.js` 3 | 3. Create heroku account, install CLI 4 | 4. `heroku create -a irisxyz-abc` 5 | 5. `heroku git:remote -a irisxyz-abc` 6 | 6. Heroku deploy: `git subtree push --prefix backend heroku main` -------------------------------------------------------------------------------- /backend/bundle.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | //import dotenv from 'dotenv'; 4 | const express = require("express"); 5 | const multer = require("multer"); 6 | const cors = require("cors"); 7 | const fs = require("fs"); 8 | const { VideoNFT } = require("@livepeer/video-nft/dist/index.cjs.js"); 9 | require("dotenv").config(); 10 | const PORT = 3001; 11 | 12 | new VideoNFT({ 13 | auth: { apiKey: process.env.LIVEPEER_API_KEY }, 14 | endpoint: "https://livepeer.com", 15 | }); 16 | 17 | const storage = multer.diskStorage({ 18 | destination: (req, file, cb) => { 19 | cb(null, "uploads"); 20 | }, 21 | filename: (req, file, cb) => { 22 | const { originalname } = file; 23 | cb(null, originalname); 24 | }, 25 | }); 26 | 27 | const app = express(); 28 | app.use(cors()); 29 | 30 | const upload = multer({ storage }); 31 | 32 | function printProgress(progress) { 33 | console.log(` - progress: ${100 * progress}%`); 34 | } 35 | 36 | async function maybeTranscode(sdk, asset) { 37 | const { possible, desiredProfile } = sdk.checkNftNormalize(asset); 38 | if (!possible || !desiredProfile) { 39 | if (!possible) { 40 | console.error( 41 | `Warning: Asset is larger than OpenSea file limit and can't be transcoded down since it's too large. ` + 42 | `It will still be stored in IPFS and referenced in the NFT metadata, so a proper application is still able to play it back. ` + 43 | `For more information check http://bit.ly/opensea-file-limit` 44 | ); 45 | } 46 | return asset; 47 | } 48 | 49 | console.log( 50 | `File is too big for OpenSea 100MB limit (learn more at http://bit.ly/opensea-file-limit).` 51 | ); 52 | 53 | console.log( 54 | `Transcoding asset to ${desiredProfile.name} at ${Math.round( 55 | desiredProfile.bitrate / 1024 56 | )} kbps bitrate` 57 | ); 58 | return await sdk.nftNormalize(asset, printProgress); 59 | } 60 | 61 | app.post("/upload", upload.array("fileName"), async (req, res) => { 62 | console.log("Testing"); 63 | console.log(req.files); 64 | const sdk = new VideoNFT({ 65 | auth: { apiKey: process.env.LIVEPEER_API_KEY }, 66 | endpoint: "https://livepeer.com", 67 | }); 68 | 69 | let file = null; 70 | let asset; 71 | try { 72 | file = fs.createReadStream(req.files[0].path); 73 | console.log(file); 74 | console.log("Uploading file..."); 75 | asset = await sdk.createAsset(req.files[0].path, file, printProgress); 76 | } finally { 77 | file?.close(); 78 | } 79 | 80 | asset = await maybeTranscode(sdk, asset); 81 | 82 | console.log("Starting export..."); 83 | let ipfs = await sdk.exportToIPFS( 84 | asset.id ?? "", 85 | JSON.parse( 86 | JSON.stringify({ 87 | name: req.files[0].filename, 88 | description: `Livepeer video from asset ${JSON.stringify( 89 | req.files[0].filename 90 | )}`, 91 | image: `ipfs://bafkreidmlgpjoxgvefhid2xjyqjnpmjjmq47yyrcm6ifvoovclty7sm4wm`, 92 | properties: {}, 93 | }) 94 | ), 95 | printProgress 96 | ); 97 | console.log(`Export successful! Result: \n${JSON.stringify(ipfs, null, 2)}`); 98 | 99 | console.log( 100 | `Mint your NFT at:\n` + 101 | `https://livepeer.com/mint-nft?tokenUri=${ipfs?.nftMetadataUrl}` 102 | ); 103 | return res.send({ status: "OK", data: ipfs?.nftMetadataUrl }); 104 | }); 105 | 106 | app.listen(PORT, () => { 107 | console.log(`gm! localhost:${PORT}`); 108 | }); 109 | -------------------------------------------------------------------------------- /backend/cartoon.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irisxyz/iris/b852582acf9135e8c557afcd72e464bbef5cdbee/backend/cartoon.mp4 -------------------------------------------------------------------------------- /backend/index.js: -------------------------------------------------------------------------------- 1 | //import dotenv from 'dotenv'; 2 | const express = require("express"); 3 | const multer = require("multer"); 4 | const cors = require("cors"); 5 | const fs = require("fs"); 6 | const bodyParser = require('body-parser') 7 | const { VideoNFT } = require("@livepeer/video-nft/dist/index.cjs.js"); 8 | require("dotenv").config(); 9 | const PORT = 3001; 10 | 11 | const jsonParser = bodyParser.json() 12 | const axios = require("axios"); 13 | const request = require("request"); 14 | 15 | 16 | const sdk = new VideoNFT({ 17 | auth: { apiKey: process.env.LIVEPEER_API_KEY }, 18 | endpoint: "https://livepeer.com", 19 | }); 20 | 21 | const storage = multer.diskStorage({ 22 | destination: (req, file, cb) => { 23 | cb(null, "uploads"); 24 | }, 25 | filename: (req, file, cb) => { 26 | const { originalname } = file; 27 | cb(null, originalname); 28 | }, 29 | }); 30 | 31 | const app = express(); 32 | app.use(cors()); 33 | 34 | const upload = multer({ storage }); 35 | 36 | function printProgress(progress) { 37 | console.log(` - progress: ${100 * progress}%`); 38 | } 39 | 40 | async function maybeTranscode(sdk, asset) { 41 | const { possible, desiredProfile } = sdk.checkNftNormalize(asset); 42 | if (!possible || !desiredProfile) { 43 | if (!possible) { 44 | console.error( 45 | `Warning: Asset is larger than OpenSea file limit and can't be transcoded down since it's too large. ` + 46 | `It will still be stored in IPFS and referenced in the NFT metadata, so a proper application is still able to play it back. ` + 47 | `For more information check http://bit.ly/opensea-file-limit` 48 | ); 49 | } 50 | return asset; 51 | } 52 | 53 | console.log( 54 | `File is too big for OpenSea 100MB limit (learn more at http://bit.ly/opensea-file-limit).` 55 | ); 56 | 57 | console.log( 58 | `Transcoding asset to ${desiredProfile.name} at ${Math.round( 59 | desiredProfile.bitrate / 1024 60 | )} kbps bitrate` 61 | ); 62 | return await sdk.nftNormalize(asset, printProgress); 63 | } 64 | 65 | app.post('/new-stream', jsonParser, (req, res) => { 66 | 67 | console.log(req.body.wallet) 68 | console.log(req.body.handle) 69 | 70 | 71 | var options = { 72 | 'method': 'POST', 73 | 'url': 'https://livepeer.com/api/stream', 74 | 'headers': { 75 | 'content-type': 'application/json', 76 | 'authorization': `Bearer ${process.env.LIVEPEER_API_KEY}` 77 | }, 78 | body: JSON.stringify({ 79 | "name": `${req.body.wallet},${req.body.handle}`, 80 | "profiles": [ 81 | { 82 | "name": "720p", 83 | "bitrate": 2000000, 84 | "fps": 30, 85 | "width": 1280, 86 | "height": 720 87 | }, 88 | { 89 | "name": "480p", 90 | "bitrate": 1000000, 91 | "fps": 30, 92 | "width": 854, 93 | "height": 480 94 | }, 95 | { 96 | "name": "360p", 97 | "bitrate": 500000, 98 | "fps": 30, 99 | "width": 640, 100 | "height": 360 101 | } 102 | ] 103 | }) 104 | 105 | }; 106 | 107 | request(options, function (error, response, body) { 108 | res.send(body) 109 | }); 110 | 111 | }); 112 | 113 | app.post("/upload", upload.array("fileName"), async (req, res) => { 114 | console.log("Testing"); 115 | console.log(req.files); 116 | const sdk = new VideoNFT({ 117 | auth: { apiKey: process.env.LIVEPEER_API_KEY }, 118 | endpoint: "https://livepeer.com", 119 | }); 120 | 121 | let file = null; 122 | let asset; 123 | try { 124 | file = fs.createReadStream(req.files[0].path); 125 | console.log(file); 126 | console.log("Uploading file..."); 127 | asset = await sdk.createAsset(req.files[0].path, file, printProgress); 128 | } finally { 129 | file?.close(); 130 | } 131 | 132 | asset = await maybeTranscode(sdk, asset); 133 | 134 | console.log("Starting export..."); 135 | let ipfs = await sdk.exportToIPFS( 136 | asset.id ?? "", 137 | JSON.parse( 138 | JSON.stringify({ 139 | name: req.files[0].filename, 140 | description: `Livepeer video from asset ${JSON.stringify( 141 | req.files[0].filename 142 | )}`, 143 | image: `ipfs://bafkreidmlgpjoxgvefhid2xjyqjnpmjjmq47yyrcm6ifvoovclty7sm4wm`, 144 | properties: {}, 145 | }) 146 | ), 147 | printProgress 148 | ); 149 | console.log(`Export successful! Result: \n${JSON.stringify(ipfs, null, 2)}`); 150 | 151 | console.log( 152 | `Mint your NFT at:\n` + 153 | `https://livepeer.com/mint-nft?tokenUri=${ipfs?.nftMetadataUrl}` 154 | ); 155 | return res.send({ status: "OK", data: ipfs?.nftMetadataUrl, ...ipfs }); 156 | }); 157 | 158 | app.listen(process.env.PORT || 3001, () => { 159 | console.log(`gm! localhost:${PORT}`); 160 | }); 161 | -------------------------------------------------------------------------------- /backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "video-nft-server", 3 | "version": "1.0.0", 4 | "engines": { 5 | "node": "16.x" 6 | }, 7 | "license": "MIT", 8 | "main": "index.js", 9 | "scripts": { 10 | "start": "node index.js" 11 | }, 12 | "dependencies": { 13 | "@livepeer/video-nft": "^0.2.0", 14 | "axios": "^0.26.1", 15 | "body-parser": "^1.19.2", 16 | "cors": "^2.8.5", 17 | "dotenv": "^16.0.0", 18 | "express": "^4.17.3", 19 | "multer": "^1.4.4", 20 | "request": "^2.88.2" 21 | }, 22 | "devDependencies": { 23 | "@types/express": "^4.17.13", 24 | "@types/node": "^17.0.23", 25 | "prettier": "2.6.1", 26 | "rollup": "^2.70.1", 27 | "ts-node": "^10.7.0", 28 | "typescript": "^4.6.3" 29 | }, 30 | "packageManager": "yarn@3.2.0" 31 | } 32 | -------------------------------------------------------------------------------- /backend/rollup.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | input: "index.js", 3 | output: { 4 | file: "bundle.js", 5 | format: "cjs", 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /backend/uploads/cartoon9.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irisxyz/iris/b852582acf9135e8c557afcd72e464bbef5cdbee/backend/uploads/cartoon9.mp4 -------------------------------------------------------------------------------- /frontend/.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "irisxyz" 4 | }, 5 | "targets": { 6 | "irisxyz": { 7 | "hosting": { 8 | "prod": [ 9 | "irisxyz" 10 | ], 11 | "testnet": [ 12 | "iris-testnet" 13 | ] 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /frontend/.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 | 25 | .env 26 | 27 | /.firebase -------------------------------------------------------------------------------- /frontend/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `npm start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser. 13 | 14 | The page will reload when you make changes.\ 15 | You may also see any lint errors in the console. 16 | 17 | ### `npm test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `npm run build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `npm run eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can't go back!** 35 | 36 | If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. 39 | 40 | You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `npm run build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /frontend/firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosting": [ 3 | { 4 | "target": "prod", 5 | "public": "build", 6 | "ignore": [ 7 | "firebase.json", 8 | "**/.*", 9 | "**/node_modules/**" 10 | ], 11 | "rewrites": [ 12 | { 13 | "source": "**", 14 | "destination": "/index.html" 15 | } 16 | ] 17 | }, 18 | { 19 | "target": "testnet", 20 | "public": "build", 21 | "ignore": [ 22 | "firebase.json", 23 | "**/.*", 24 | "**/node_modules/**" 25 | ], 26 | "rewrites": [ 27 | { 28 | "source": "**", 29 | "destination": "/index.html" 30 | } 31 | ] 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /frontend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | iris 19 | 22 | 30 | 31 | 32 | 33 |
34 | 35 | 36 | 37 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@apollo/client": "^3.5.10", 7 | "@esbuild-plugins/node-globals-polyfill": "^0.1.1", 8 | "@livepeer/react": "^1.5.2", 9 | "@rainbow-me/rainbowkit": "^0.8.0", 10 | "@vitejs/plugin-react": "^2.2.0", 11 | "@vitejs/plugin-react-refresh": "^1.3.6", 12 | "cross-fetch": "^3.1.5", 13 | "dotenv": "^16.0.3", 14 | "ethers": "^5.7.2", 15 | "graphql": "^16.3.0", 16 | "hls.js": "^1.1.5", 17 | "ipfs-http-client": "^56.0.1", 18 | "moment": "^2.29.3", 19 | "omit-deep": "^0.3.0", 20 | "react": "^17.0.2", 21 | "react-dom": "^17.0.2", 22 | "react-router-dom": "^6.2.2", 23 | "react-string-replace": "^1.1.0", 24 | "styled-components": "^5.3.3", 25 | "uuid": "^8.3.2", 26 | "vite": "^3.2.4", 27 | "vite-plugin-svgr": "^2.2.2", 28 | "wagmi": "^0.8.5" 29 | }, 30 | "scripts": { 31 | "start": "vite", 32 | "build": "vite build", 33 | "serve": "vite preview" 34 | }, 35 | "eslintConfig": { 36 | "extends": [ 37 | "react-app", 38 | "react-app/jest" 39 | ] 40 | }, 41 | "browserslist": { 42 | "production": [ 43 | ">0.2%", 44 | "not dead", 45 | "not op_mini all" 46 | ], 47 | "development": [ 48 | "last 1 chrome version", 49 | "last 1 firefox version", 50 | "last 1 safari version" 51 | ] 52 | }, 53 | "devDependencies": { 54 | "react-error-overlay": "6.0.9" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irisxyz/iris/b852582acf9135e8c557afcd72e464bbef5cdbee/frontend/public/favicon.ico -------------------------------------------------------------------------------- /frontend/public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/irisxyz/iris/b852582acf9135e8c557afcd72e464bbef5cdbee/frontend/public/logo.png -------------------------------------------------------------------------------- /frontend/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": "logo.png", 12 | "type": "image/png", 13 | "sizes": "128x128" 14 | } 15 | ], 16 | "start_url": ".", 17 | "display": "standalone", 18 | "theme_color": "#000000", 19 | "background_color": "#ffffff" 20 | } 21 | -------------------------------------------------------------------------------- /frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /frontend/src/App.jsx: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from "react"; 2 | import { Routes, Route } from "react-router-dom"; 3 | import styled from "styled-components"; 4 | 5 | import ApolloProvider from "./components/Apollo"; 6 | import LivepeerProvider from "./components/Livepeer"; 7 | import GlobalStyle from "./theme/GlobalStyle"; 8 | import ThemeProvider from "./theme/ThemeProvider"; 9 | import NotFound from "./pages/NotFound"; 10 | import Outlet from "./pages/Outlet"; 11 | import User from "./pages/User"; 12 | import Post from "./pages/Post"; 13 | import NewProfile from "./pages/NewProfile"; 14 | import Profile from "./components/Profile"; 15 | import Nav from "./components/Nav"; 16 | import Wallet from "./components/Wallet"; 17 | import Compose from "./components/Compose"; 18 | import Login from "./components/Login"; 19 | import Feed from "./components/Feed"; 20 | import Card from "./components/Card"; 21 | // import Livelinks from "./components/Livelinks"; 22 | import logo from "./assets/iris.svg"; 23 | // import LandingPage from './pages/LandingPage' 24 | import { CHAIN } from "./utils/constants"; 25 | import { WalletContextProvider } from "./utils/wallet"; 26 | import '@rainbow-me/rainbowkit/styles.css'; 27 | 28 | import { 29 | getDefaultWallets, 30 | RainbowKitProvider, 31 | darkTheme 32 | } from '@rainbow-me/rainbowkit'; 33 | import { 34 | chain, 35 | configureChains, 36 | createClient, 37 | WagmiConfig, 38 | } from 'wagmi'; 39 | import { alchemyProvider } from 'wagmi/providers/alchemy'; 40 | import { publicProvider } from 'wagmi/providers/public'; 41 | 42 | 43 | const Container = styled.div` 44 | max-width: 1000px; 45 | padding: 0 1em 1em 1em; 46 | min-height: 90vh; 47 | box-sizing: border-box; 48 | margin: auto; 49 | @media (max-width: 768px) { 50 | padding: 0 0.5em 0.5em 0.5em; 51 | margin-bottom: 3em; 52 | } 53 | `; 54 | 55 | const LogoContainer = styled.div` 56 | display: flex; 57 | padding: 0.6em; 58 | gap: 8px; 59 | `; 60 | 61 | const Navbar = styled.nav` 62 | box-sizing: border-box; 63 | height: 50px; 64 | display: flex; 65 | justify-content: space-between; 66 | align-items: center; 67 | margin: 0.7em 0; 68 | `; 69 | 70 | const Columns = styled.div` 71 | display: flex; 72 | gap: 2em; 73 | `; 74 | 75 | const Sidebar = styled.div` 76 | width: 300px; 77 | height: 100% 78 | float: left; 79 | @media (max-width: 768px) { 80 | display: none; 81 | } 82 | `; 83 | 84 | const Content = styled.main` 85 | width: 100%; 86 | @media (min-width: 768px) { 87 | width: 700px; 88 | } 89 | `; 90 | 91 | const MobileNav = styled(Nav)` 92 | @media (min-width: 768px) { 93 | display: none; 94 | } 95 | ` 96 | 97 | const Announcement = styled(Card)` 98 | margin-top: 1em; 99 | margin-bottom: 0.5em; 100 | background: #FFCBBB; 101 | border: #FF9776 1px solid; 102 | h4 { 103 | margin: 0; 104 | padding-bottom: .25em; 105 | color: #F66030; 106 | font-weight: 500; 107 | 108 | } 109 | ` 110 | 111 | function App() { 112 | const [profile, setProfile] = useState({}); 113 | 114 | // useEffect(() => { 115 | // const initLit = async () => { 116 | // const client = new LitJsSdk.LitNodeClient({ 117 | // alertWhenUnauthorized: false, 118 | // debug: false, 119 | // }); 120 | // await client.connect(); 121 | // window.litNodeClient = client; 122 | // }; 123 | // initLit(); 124 | // }, []); 125 | 126 | const { chains, provider } = configureChains( 127 | import.meta.env.VITE_CHAIN === 'mumbai' ? [chain.polygonMumbai] : [chain.polygon], 128 | [ 129 | alchemyProvider({ apiKey: import.meta.env.ALCHEMY_ID }), 130 | publicProvider() 131 | ] 132 | ); 133 | 134 | const { connectors } = getDefaultWallets({ 135 | appName: 'Iris', 136 | chains 137 | }); 138 | 139 | const wagmiClient = createClient({ 140 | autoConnect: true, 141 | connectors, 142 | provider 143 | }) 144 | 145 | return ( 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | iris logo 158 |

iris

159 |
160 | 164 |
165 | 166 | 167 | 168 | 169 | 170 |