Dev & Tell | javi — nfts-as-gifts
Developer DAO · 7 Jan 2022 · 24:17
Javi, a Developer DAO member, walks through NFTs as Gifts, a project that lets someone pay by credit card to mint an NFT and send it to a friend through a magic link, with no wallet needed by the giver. The talk covers the idea, the mockups, a ninety-second demo and the stack: Next.js on Vercel, Tailwind CSS, Framer Motion, IPFS and Redux. Javi explains why launch was postponed after Polygon network problems, shares a learn-by-extending approach for developers stuck in tutorials, and the group discusses hosting code-alongs.
Topics
From Developer DAO; community: Developer DAO.
Transcript
hello everyone and welcome to dev and tell this is withheart i am stepping in for narb today he is not able to make it if you have not been to devontel before devontel is a 30 minute window for members of the development guild to showcase something they are passionate about or have been working on this could be an awesome project you've been working on demonstrating unit testing best practices automation goodies smart contracts how to structure a project etc etc basically if you've got a passion for something this is your opportunity to share it with the community today we have javi presenting nfts as gifts ready to go hoppy
thank you so much thank you so much uh thank you so much everyone for giving here um happy new year to everyone this is my first time doing something like this i'm so excited thank you for the opportunity i'm i'm unfortunately i'm feeling a little bit a little bit sick i've been sick all week so i'm i'm i know i know that i'm my at my hundred percent so i made a set of slides to help me to help myself going through the points that i want to cover so i i'm going to start by giving special thanks to these three amazing people with heart narp and daiwat you you you are always i'm i see how you're always helping others helping the community inspiring inspiring others because um you've
helped me getting to this point i wouldn't be here because of if it wasn't for you and you've inspired me to do this so to to take the guts to do this so thank you so so much um also about the project itself kind of like a spoiler alert i'm not gonna be talking about the business side because i decided not to launch it i was dreaming about launching it on product hand today and having your feedback and maybe even your votes but there was some polygon problems this week and i decided that is i feel is too risky to start chatting people with credit cards um and relying on the network problem so i'm just gonna stick to the development side uh so my goal here is to just share the
knowledge so all i've been doing why i do it how i do it how i did it and hopefully what i really really want is to be like these three people and help others and inspire others with my example so let's just get to it as a quick introduction i would like to say that this strategy has been working for me i'm just gonna stick to the development side right so as a developer who's learning what three if you ever feel stuck in a tutorial hell i would suggest this strategy just start with for example with a build space project i love build space so that's what is working for me but whatever you want to learn start from there from that tutorial from that course right so then
complete it finish it paying attention to what you're doing i'm saying that because with build space it's pretty easy to just copy and paste the solution and just finish the project and get the nft right but if you pay attention then once you finish the project is actually when the fun really begins so here's my recommendation when you finish the project try changing things try and make it your way then try adding more libraries just try things like if you saw something on twitter that you like some new animation fancy thing just try it just see what happens bring crazy features dreams about the potentials of wet3 web3 find ideas from other people other projects other websites and just see
what happens if you try to add it and that's kind of what i'm doing i'm i'm super happy with it and that's kind of how this idea was born i was as a build space student i love how cool they are like giving you nfts when you finish a product project also if you if you are a con contributor on on their discord they'll award you an nft and i was like wow that is so cool what if i can do something like that to help a friend i have a friend who draw very cute dogs and for example like a couple years ago he used to make drawings for some clients on on instagram like grabbing the the picture of the dog and drawing the dog
and then so i thought like what if i do something like build space so this guy can reach out to all the clients he had two years ago and say like hey merry christmas you thank you for being a client of me two years ago what if i i made this entity of the drawing i made right and like a way for to give this those drawings as entities as gifts to friends or clients and then i thought like oh what if i let anyone create a thesis as a gift like with the same idea than for my friend but for any type of friend or gift right and then i thought wait if you're the one giving the gift i realize this because my friend is not really familiar with metamask or the
web3 space in general but i thought like if you're the one giving the gift you don't really need a meta mask or a wallet address it's like the recipient is the only one who needs to like own the nft so they need a wallet address right so what if i make a credit card way to create an nft and send it as a gift so okay that sounds like a challenge so challenge accepted let's try to do it so the first thing that i did is i went to scully draw and draw some mockups so i know myself and i'm always like complicated in my own life so i decided to be very strict with this i want to make a very minimalistic set of screens and just stick to that and stop adding other things because then i will never
finish my own side projects so this was my initial plan and i tried to be loyal to this the first step would be as simple as possible just oh come yeah just text some intro and then call to action and move on then like a upload states right you select your file your video your image to upload then like a preview screen so simple that anyone could understand it then the pay screen just the pay button just that then a way once you paid a way to like wrap the gift and send it to your friend right so a way to contact your friend and that would be the whole flow for the one that is giving the gift then when the client or when the
recipient when the friend receives the the invitation they will be like hey welcome there's an entity for you and please connect your wallet or somehow like give me the way to give you the enfd right and that would be that would be everything then and i i was able to do this in two weeks so let's let's go from the the mocaps to the execution and for that i made a video like a full tour video in 90 seconds of of how it works so you you will see all these these seven steps from scully draw you will see in action in the final product let's let's watch it it's just 90 seconds
so this is kind of like the landing page i made i i maybe i should just not say a word but yeah anyway i i added this effect if you click on the banner i thought it was like kind of nice or funny then this is the upload process right you you can drag and drop an image or a video this is the preview page i thought it would be nice to add this extra confirmation to say like yeah the content is original just in case this is the payment the paywall screen very straightforward no magic here and then you'll get to the confirmation that you paid correctly right then you get to finish the gift like saying who is it for and what is the title of the nft and then you get a magic link that you
can share via social via email or send it to your friend whatever you want then the friend will visit the link right that is what this is what the friend will see like uh hey hello there's a kid for you and you just have to enter your wallet address or your ens address and when you click it all the magic happens from the back end i will mean nfc for you i will pay the guys for that for you and i will give it to you so the the address that you entered will be the owner of that nft and boom you you see the nft here you can click to watch it on openc sometimes openc takes a while so i'm saying like please be patient right and maybe in a minute you can go back there refresh the page and
boom um maybe you need to extra refresh the metadata right and refresh and it will be there and that's that's the whole thing that i did um now i'm gonna review a step-by-step screen by screen what i did to just describe the stack that i use the libraries that i'm using how i made things i'm i i know there's so many ways to do everything and this is not the best option this is the option that i took and and i really enjoyed it and and i love to share everything that i did if you if you want to interrupt me or ask me any question at any moment just feel free but i'm just gonna yeah go again based on this calidro steps and the final implementation on this mobile
view i'm just gonna describe the things that i used on each one of the steps so for the landing page well for the whole site i'm using xcas hosted on barcell i just love that i'm using tailwind css all over the place and i'm also using it for that that mode um this is the first time that i'm using like light mode dart mode mode with the tailbone css so it will read from your system if you switch to light mode it will be light and that was very enjoyable for me to to do in my opinion for the first time that i do it i really like that what else i'm using framer motion a lot so in this in this effect that i created here to show these kind of animated stickers with facts i'm
framer motion is the library that i'm using the most if you're interested in how i did this i can i can make a tutorial or a blog post or we can have a call call later i can share the code i can set the screen whatever you feel i would love to share it if you like it but it's okay what else i'm also using this used boop library from yoskumo this guy is amazing and i'm using to make sometimes make things shake a little bit like for example if i refresh the page this is gonna like shake whoa a little bit i just i don't know it's just a silly thing but these details makes me happy to implement them and this is in many screens i'm using effects like this
uh what else the second screen this one for uploading things is very basic i'm using react drop zone this react library to be able to drag and drop in this area so then when the file drops i'm i'm uploading it to ipfs i'm saving the url or the id generated from that upload and i'm just also using chakra ui models if you click here to ask for help on any of the steps the next step is when you preview what you uploaded and decide if you want to go ahead and upload a different one and i'm using a library called react parallax tilt to do this effect oh let me just quickly show you if if i like drag this one
and oh this was zooming so yeah if you hover over this fancy effect it's very easy to feel tired of this effect once you see it twice so maybe i will remove it but it was so easy to add it that i think it's worth it it's worth trying it i totally recommend it i'm using redux um not because the app needs redux but it is very easy to use local storage by default with redux so if someone makes a mistake and close the tab or refreshes the tab um the progress will not be lost very easily with redux i just i'm just used to do that i'm also using ui model and toast in this again in this screen and i'm using this
library called rack notation here's what i did when you when you have to confirm that the contouring is original just in case i i don't really know how legality works on the nfts but just in case um i'm forcing you to check this and if you don't check it see what happens when i click here this gets highlighted in a very animated way that i like like this oh i this is with with the rug notation library for react very easy to use and very enjoyable and if you keep trying you will see like other funny messages in use this is using chakra ui toast oh yeah let's just confirm and move on and what is the next screen would be the paywall right the checkout page very
straightforward um i wanted to use apple pay because it's just one button and one click and it's the best thing ever for web to payments right in my opinion or shopify or other like one click things but i realized that you have to pay like the developer fee annual fee to apple if you want to add the apple pay and i was like maybe i will add it on a different day when this becomes a real business so right now it's just using stripe is in test mode because i'm yeah it's too risky for me to start changing money if i'm not fully sure it works on maintenance that's a different story so um what i'm doing here is i'm using stripe elements very easy way to integrate the stripe payments in react and i'm using versailles and nexus this
this thing called api routes as the backend to process the stripe request and the information well the credit card number is not an information i cannot i can process is just a strike thing but to connect to the database and verify the payment i'm using this if you've never used the nexus api roots as a back-end i totally recommended this super easy it's a life-changing stack instead of using node.js or other services i just love it um what else when you confirm your payment in this screen with the confetti stuff this is the moment when i'm finally touching a database i'm using super based and so at this moment i will create a new row on the payments table
saying that this payment just occurred that it wasn't it just happened is an estate of uncompleted because the friend never claimed the nft but at this moment yeah you have a payment so i will store that on the database the next step step is very straightforward just adding this text info that will be in the metadata for the entity like the title or the description and when i generate the this magic link that you that you send your friend to make it look like a youtube url and not just a numerical id i'm using this as ids library very easy to use too the next screens would be when the friend receives the magic link and clicks there they will see get to
this screen that is very straightforward and minimalistic the friend only has to type the ethereum or ens address and then all the magic will happen behind the scenes so maybe this is the most trickiest part when when the friend clicks the button to let's say to claim the nft right i'm using a back end to do all the magic so i know this parameter here from the magic link and i know the address so i'm using aws lambda receiving these two parameters and then i would do all the magic there all the magic um long story short is basically i'm doing first i'm minting the nft because i know the title
and the url of the media file from the database that i'm grabbing starting from the payment id so once i meet the nft i will transfer the ownership to the wallet address of the recipient in this case the friend right to this value right here and then i will update the database to say that the payment was finally completed and and that's it i tried to be as fast as as possible and maybe it was too generic or maybe little little depth but if i think that's that's the main thing the list of libraries i use the list of steps and then and the how they flow inside the app works
and i think that's it i could describe more things that i added or just leave it open for questions we come from the previous town hall that was like 75 minutes long so i don't want to consume more of your energy and just leave it open if you want to ask questions or whatever you you want i would be happy to help you for a bunch of more minutes if you want thank you so so much for for your attention and for being part of this javi thank you so much like that is seriously one of the best uh presentations i think i've ever watched anywhere you could just feel your
excitement and happiness and like love for this thing that you were building in every word that you spoke it was so fun and entertaining and i really appreciate you and appreciate that you were here to host this for us oh thank you thank you so much so much this project has made me uh really happy it was a huge very awesome learning challenge i don't care that i didn't never launch it i don't care if i ever launch it i think i already won by by trying it by building it and by sharing it here with the community i hope if any of you wants to learn any of this things i did maybe and maybe this is not the right time but maybe we can chat during this weekend or any moment you can dm me and i will show
you everything i i have i'm i cannot believe how many people are on this call and i'm so thankful i mean this is so this is very special for me thank you so much really i think this was special for all of us i really mean that like this this was quite a presentation thank you so much does anybody have any questions i only joined part way through but yes very well done heavy uh i i i could feel i could feel the energy as you were rapidly wrapping it all up here uh thank you so much do you have a github repo available for this or are you still
keeping it on your end for for the time being what a great question i definitely want to share the the repo but if i don't do it today is because it's not because i don't trust you is because i don't trust myself i mean uh if i visit my github i i always caught in a loan this was my last year i i work a lot with github and myself but only myself and i'm not experienced with sharing the ripples with other people and i'm just afraid about leaving private keys from random places in the code and i want to be super strict with that i heard of people losing everything by sharing a private key on a repo like by bots on github right so i i will
take a look at it's one of the pages and the files in the code and create a new repo from scratch and be able make sure that is safe to share and yeah of course i will share it and it but i like to go beyond sharing the code because i me i made a screenshot here yeah there's a lot of like if i give you access to the repo and you want to try to run it locally it's a little bit hard because there's a lot of keys or values or ideas that you'll have to add to your secret files in order to make it work um if you don't know what if you don't want to go to the hassle of creating all these parameters to make the app run locally i
can just if you're interested in one specific screen or step in the process i can just make a youtube video one hour long two hour long or share the screen or we can meet somewhere in time and i will show you line by line what i did or even we can make it from scratch like if you say like oh i really love the the effects on the landing page when you click like this well uh best thing instead of looking at my code we can meet tomorrow and we can build it from scratch with code with css and with framer motion and enjoy the process i think that would be much cooler than just looking at my repo but i will definitely share it i think that actually be a fantastic
idea i think that was something with heart and i want and a whole bunch of other people were trying to get uh going in the dev guild actually these code alongs and i'm sure a lot of people would really appreciate that no it doesn't have to be tomorrow it can be like whenever right but if you yeah if you ever get around to hosting something like that i'm sure you'll get quite a crowd wow yeah i'm cold alone i'm i love that idea i mean yeah when i would love to do that every day yes and after this this presentation with you guys right now yeah i i i really want to be more active read more in the discord and be more active helping everyone and integrating to this amazing
community so i if you're up to uh go along any of these days or next week or next month i will be there yes i would give anything to have you be more involved in this community like seriously you just have like you have so much heart and just listening to you talk about things like i would listen to you talk about literally anything oh my goodness thank you so much thank you so much yeah thank you so much for like uh showing this off to all of us because uh yeah like we had said uh just listening to you talk about it has made everyone feel good like
yeah but what more can can can happen right uh so yeah i would absolutely love if if you could like uh schedule one of those sessions to like code this along with other members in the guild i think that would be like a great uh great way to i don't know um start um experimenting with these sessions where people just learn and code with each other i don't really have any name for it yet but we could certainly try it out and yeah uh yeah there's so much to learn from this a project of yours like you said you are so happy to have just built it and even if you don't launch it and that's i
think there's so much to learn from that so thank you thank you for just being here thank you thai one yes so yeah uh what what do you think would be the best next step for me to uh yeah to set up some time some schedule for these quite a long things maybe we can chat on the dev and tell channel or maybe this is a different channel you just if you point me there i will be active and propose a calendar and just yeah let's just do it yeah it can be it can be a lot of fun every time i do a code along with a friend it's so much fun it's such a great way to learn i'm totally in yeah uh let me uh let me just finish the dev and tell real quick do the
the closing uh yeah the closing statement real quick but i yeah we should definitely figure this out um yeah again thank you so much javi for making this presentation this has been a very special moment i had no idea i was walking into something so impactful and i really appreciate you having been here to present this to us today the next dev and tell will be next week one hour previous which is 9 am pacific standard time will be nikita grisham presenting own your words thanks everybody for coming
Related talks
- DApp 101 - Build a DApp from scratch on Ethereum & Matic | Sayli Patil
- Polygon 🛠 Add Play to Earn Mechanics to a Browser Game
- DevNTell | 0xcorgis - Duolingo of web3
- Onboarding the Next Generation of Ethereum Builders with BuidlGuidl
- Dev & Tell | Narb - Glosseta
- AI Powered Proof of Learning with Lore Network
- Web3 Journey: Hierarchical vs. Exploration Learning, Core DeFi Skills - BG's Builder Bootcamp
- DevTools Summit | Solidity Best Practices - 10 Tips - Tasuku Nakamura
- DevNTell - Meta Tour
