{"id":2323,"date":"2022-01-26T10:20:25","date_gmt":"2022-01-26T10:20:25","guid":{"rendered":"https:\/\/lvboard.infostore.in.ua\/?p=2323"},"modified":"2022-01-26T10:20:25","modified_gmt":"2022-01-26T10:20:25","slug":"how-i-built-rozbnb-with-next-js-tailwind-css-styled-components-stripe-and-auth0","status":"publish","type":"post","link":"https:\/\/lvboard.infostore.in.ua\/?p=2323","title":{"rendered":"How I built Rozbnb with Next.js , Tailwind CSS, Styled Components , Stripe and Auth0"},"content":{"rendered":"\n<p><strong>I was exploring <a target=\"_blank\" href=\"https:\/\/auth0.com\/\" rel=\"noreferrer noopener\">Auth0<\/a> for my website&#8217;s Authentication so I came across this amazing Hackathon which was hosted by <a target=\"_blank\" href=\"https:\/\/auth0.com\/\" rel=\"noreferrer noopener\">Auth0<\/a> and <a href=\"https:\/\/hashnode.com\/@Hashnode\" target=\"_blank\" rel=\"noreferrer noopener\">@Hashnode<\/a>. So I thought why not to give a try ??? And then the biggest question mark in my mind was what to make !<\/strong><\/p>\n\n\n\n<!--more-->\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/cdn.hashnode.com\/res\/hashnode\/image\/upload\/v1630136891613\/bA7TRdUgQ.gif?auto=format,compress&amp;gif-q=60&amp;format=webm\" alt=\"ThinkingTapGIF.gif\"\/><\/figure>\n\n\n\n<h3 id=\"how-did-i-got-the-idea-of-travel-booking-app\"><strong>How did I got the idea of Travel booking App???<\/strong><\/h3>\n\n\n\n<p><strong>A few weeks ago a great youtuber called Sonny Sangha hosted a 5day challenge of cloning Airbnb , so after strategizing I planned to make that clone into a better website with authentication , animation , better UI and so on.<\/strong><\/p>\n\n\n\n<h2 id=\"awesome-tech-i-am-using\"><strong>Awesome Tech I am using ?:<\/strong><\/h2>\n\n\n\n<p>Frontend Framework? : <a target=\"_blank\" href=\"https:\/\/nextjs.org\/\" rel=\"noreferrer noopener\">Next.js<\/a><br>Styling? : <a target=\"_blank\" href=\"https:\/\/tailwindcss.com\/\" rel=\"noreferrer noopener\">Tailwind css<\/a> and <a target=\"_blank\" href=\"https:\/\/styled-components.com\/\" rel=\"noreferrer noopener\">Styled Components<\/a><br>Authentication? : <a target=\"_blank\" href=\"https:\/\/auth0.com\/\" rel=\"noreferrer noopener\">Auth0<\/a><br>Map integration?\ufe0f : <a target=\"_blank\" href=\"https:\/\/www.mapbox.com\/\" rel=\"noreferrer noopener\">Mapbox<\/a><\/p>\n\n\n\n<h2 id=\"lets-take-a-quick-stroll-around-my-app\"><strong>Lets take a quick stroll around my app ?:<\/strong><\/h2>\n\n\n\n<p><strong>Check out the website :<\/strong> <a target=\"_blank\" href=\"https:\/\/www.rozendeedi.me\/\" rel=\"noreferrer noopener\">here<\/a><\/p>\n\n\n\n<p>At start your eye catches an amazing landing page which includes animation using framer motion and react-reveal<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/res.cloudinary.com\/dp0qzldgh\/image\/upload\/v1630136750\/ezgif.com-gif-maker_4_jnsmeb.gif\" alt=\"image.gif\"\/><\/figure>\n\n\n\n<h2 id=\"authentication\"><strong>Authentication ?<\/strong><\/h2>\n\n\n\n<p>To login to the website you will have to click on the avatar on the top right corner and it will redirect you to a Sign In page with a button which says &#8220;SignIn with Auth0&#8221;. This page is handled by Next-Auth. After clicking the button, you will be redirected to one of the coolest authentication providers known as <a target=\"_blank\" href=\"https:\/\/auth0.com\/\" rel=\"noreferrer noopener\">Auth0 <\/a>? . You can login the app with email\/password as well as with Google authentication.<\/p>\n\n\n\n<h3 id=\"why-should-you-use-auth0-in-your-app\"><strong>Why should you use Auth0 in your app ? ?<\/strong><\/h3>\n\n\n\n<p>I&#8217;m sure you won&#8217;t regret !! give it a try , you will get a perfect solution (?hope so),The Auth0 will make your virtual implementation easy.<\/p>\n\n\n\n<p>Auth0? provides the most extensive functionality which ensure the user authentication and authorization, with detailed analytics and a variety of available providers.<\/p>\n\n\n\n<p>I noticed that there is a need to add social authentication to apps while I was practicing .Apparently I was looking for a solution and I came across Auth0. Its security, universality, and ease of use made me choose this for my Authentication .<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/res.cloudinary.com\/dp0qzldgh\/image\/upload\/v1630162866\/ezgif.com-gif-maker_4_a0bipd.gif\" alt=\"login.gif\"\/><\/figure>\n\n\n\n<h2 id=\"search-and-date-picker\"><strong>Search and Date Picker ?<\/strong><\/h2>\n\n\n\n<p>To search, type in the input field and while you type <strong>the date picker dialog will pop up<\/strong>. The date-picker is handled by <a target=\"_blank\" href=\"https:\/\/www.npmjs.com\/package\/react-date-range\" rel=\"noreferrer noopener\">react-date-range<\/a> and it is easy to implement . To add this feature you will have to &#8211;<\/p>\n\n\n\n<p>Install by executing<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install --save react-date-range\n<\/code><\/pre>\n\n\n\n<p>This plugin expects <code>react<\/code> and <code>date-fns<\/code> as peerDependencies, It means that you need to install them in your project folder.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install --save react date-fns\n<\/code><\/pre>\n\n\n\n<p><strong>You need to import styles first.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import 'react-date-range\/dist\/styles.css'; \/\/ main style file\nimport 'react-date-range\/dist\/theme\/default.css'; \/\/ theme css file\n<\/code><\/pre>\n\n\n\n<h3 id=\"daterangepicker-daterange\"><code>DateRangePicker \/ DateRange<\/code><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>import { DateRangePicker } from 'react-date-range';\n\nclass MyComponent extends Component {\n  handleSelect(ranges){\n    console.log(ranges);\n    \/\/ {\n    \/\/   selection: {\n    \/\/     startDate: &#91;native Date Object],\n    \/\/     endDate: &#91;native Date Object],\n    \/\/   }\n    \/\/ }\n  }\n  render(){\n    const selectionRange = {\n      startDate: new Date(),\n      endDate: new Date(),\n      key: 'selection',\n    }\n    return (\n      &lt;DateRangePicker\n        ranges={&#91;selectionRange]}\n        onChange={this.handleSelect}\n      \/&gt;\n    )\n  }\n}\n<\/code><\/pre>\n\n\n\n<h1 id=\"result-page\"><strong>Result Page ?\ufe0f<\/strong><\/h1>\n\n\n\n<p>After clicking the search button you will be redirected to the result page. The first thing which you will be seeing in the result page is a Dark themed map with a series of hotels. The map is handled by <a target=\"_blank\" href=\"https:\/\/www.mapbox.com\/\" rel=\"noreferrer noopener\">MapBox<\/a> and <a target=\"_blank\" href=\"https:\/\/www.npmjs.com\/package\/react-mapbox-gl\" rel=\"noreferrer noopener\">react-mapbox-gl<\/a> which is a <strong>proxy components (proxy between React and Mapbox API) <\/strong>. MapBox is a alternate for google map which doesn&#8217;t ask for any kind of details and we can style the map for our necessity. And the series of hotels is fetched from a fake json api which is possible with <a target=\"_blank\" href=\"https:\/\/jsonkeeper.com\/\" rel=\"noreferrer noopener\">Jsonkeeper<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/res.cloudinary.com\/dp0qzldgh\/image\/upload\/v1630135800\/ezgif.com-gif-maker_4_v2dfih.gif\" alt=\"ezgif.com-gif-maker-2d192a87df01e9848.gif\"\/><\/figure>\n\n\n\n<h1 id=\"payment-page\"><strong>Payment Page?<\/strong><\/h1>\n\n\n\n<p>In result page, you will be able to see a <code>buy now<\/code> button on the info card and when you click on it , you will be redirect to the payment page . This page is handled by <strong>one of the secured payment gateway providers ?<\/strong> known as <a target=\"_blank\" href=\"https:\/\/stripe.com\/\" rel=\"noreferrer noopener\">Stripe<\/a>. <strong>It is one of most popular payment gateway providers which is used by biggest companies like zoom, amazon, slack and so on.<\/strong> And you can <strong>customize your checkout page with simple hex colors<\/strong> . When you are redirected to the Stripe checkout page , you will be seeing the hotel&#8217;s picture with the price which is followed with a form where you will enter your personal details. After filling your details, when you will click <code>Pay<\/code> button you will be directed to the the success page?.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/res.cloudinary.com\/dp0qzldgh\/image\/upload\/v1630136023\/ezgif.com-gif-maker_5_jbwymw.gif\" alt=\"payment.gif\"\/><\/figure>\n\n\n\n<h1 id=\"conclusion\"><strong>Conclusion?<\/strong><\/h1>\n\n\n\n<p>I hope you find my article interesting and enjoyed my website. I will keep working on it and improving it. Finally thanking <a href=\"https:\/\/hashnode.com\/@Hashnode\" target=\"_blank\" rel=\"noreferrer noopener\">@Hashnode<\/a> and <a target=\"_blank\" href=\"https:\/\/auth0.com\/\" rel=\"noreferrer noopener\">Auth0<\/a> for hosting this amazing hackathon which pushed me to write my first blog &lt;3 .<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was exploring Auth0 for my website&#8217;s Authentication so I came across this amazing Hackathon which was hosted by Auth0 and @Hashnode. So I thought why not to give a try ??? And then the biggest question mark in my mind was what to make !<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[30],"tags":[161],"_links":{"self":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/2323"}],"collection":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2323"}],"version-history":[{"count":1,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/2323\/revisions"}],"predecessor-version":[{"id":2324,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/2323\/revisions\/2324"}],"wp:attachment":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}