This is a fully responible clone of Airbnb website, I try to do the basic layout by Nextjs with tailwinds, I used mapbox and mapgl to do the map feature. you can try it your self.
it may popout the web is not safe but it is normal, dont worry.
Mobile first, People have spent more and more time on the internet from mobile ends. The website will show different layout depend on the width of the browser.
The Map feature help user to visualize the distribution of the rooms. The map need to pass a initial longitude and latitude, I first use a function to calculate a center point of those rooms, so that we can display a overview. I use getStaticProps, but not the getserverside props since there are no realtime data that need to pass back to the server, I used getstaticprops to do the dynamic page. The server will render pages of different rooms first, When the user selected the rooms that they want, It will route the user to the selected page in very low latency.I think there are some improment, like adding
- a state management lib somehing like redux is a good idea
- Third party payment system like strip
- User login like Auth0