Frontend
Tech
The frontend is built using Next JS (Typescript), RainbowKit, Tailwind CSS & deployed on Vercel
File Structure (src/)
pages
index.tsx: log in (connect wallet) pagedashboard.tsx: all the identities you are owner of appears here (data is pulled from subgraph)create.tsx: page to create new identity_app.tsx: contains rainbow config,nav.tsxand other global stuffidentity/[address].tsx: profile page of a identity
components
Nav.tsx: navbar rendered in all pagesModal.tsx: used in a couple of places to render modals (modification of headlessui's modal)FeedbackWidget.tsx: feedback.fish widget to collect user Feedback
identity
contains all the components for the identity page.
SendETH.tsx,SendERC20.tsx&SendNFT.tsx(self explanatory)Owner.tsx&Owners.tsx: used to render owners of theidentityERC20.tsx&ERC20s.tsx: used to render accepted tokens on theidentitypageNFT.tsx&NFTs.tsx: used to render NFTs sent to theidentityPickToken.tsx: a slick component to pick ERC20s fromQuickActions.tsx: renders owner actions on theidentitypage
styles
globals.css: basically has styles that are complex to do in tailwind
utils
- has contract abis to interact with them
copyToClipboard.ts: copies text to clipboard (used in identity page)avatarFromAddress.ts: generates avatar from address (used in dashboard and identity pages)
lib
constants.js- has chain, explorer and contract addresstokens.js- token list used in
PickToken.tsxcomponent - it's soured from tokenlists.org and
adapted with a simple python script to filter only the optimism mainnet tokens, add
idfield & removeextensionsfield.
- token list used in
Setting up locally
Clone the repo
Go to frontend directory
Install dependencies
Run dev server
That's it. Open localhost:3000 to see the app.
Deploying
After making your changes, open a pull request on the repo. Vercel will automatically deploy and create a preview for it, once everything looks good i'll merge it.
Was this page helpful?
Edit this file on GitHub