How should you search, filter, and paginate data with Next.js? This demo has 50,000 books in a Postgres database.
โข Page Load: When the page loads, we see the React Suspense fallback. This loading skeleton is displayed until the first page of books is retrieved from the database.
โข Searching: The search input has a 200ms debounce. After 200ms of inactivity, the form submits, updating the URL state with `?q={search}`. The Server Component reads `searchParams` and queries the database. On form submission, a React transition starts, allowing us to read the pending status with `useFormStatus` to display an inline loading state.
โข State Preservation: Navigating to an individual book page retains the search input state. Reloading the page or sharing the link preserves the search results.
โข Client-side Filtering: Filtering authors in the left sidebar is done client-side. Authors are fetched by a Server Component and passed as props to the sidebar. Changing the input value updates React state and re-renders the sidebar.
โข Optimistic Updates: The sidebarโs selected authors are optimistically updated with `useOptimistic`. Checkbox selections update instantly without waiting for the URL to change.
โข State Preservation: Navigating to an individual book page retains the sidebar filter input and selected author state across navigations, giving it an app-like feel.
โข Pagination: Navigating between pages updates the URL state, triggering the Server Component to query the database for the specific page of books. We also fetch the total book count to show the total number of pages.
This demo isn't perfect yet (still working on it) but it's been a fun playground for some of these patterns. You can imagine a similar experience for thousands of movies, cars, products, or any other very large dataset.
Demo โ https://t.co/ym72YZdt6I
Code โ https://t.co/BguuQMHgeO
I have ranked #1 on product hunt multiple times!
๐ I even got "Maker of the Year 2022"
And itโs a Game changerโฆ
You get validation, initial traction, and a ton of visibility.
But thereโs a catchโฆ to get all these benefits, you have to rank high.
Here's how you do it ๐งต
โโโโโโโโโโโโโโโโโโโ
๐ช๐ต๐ ๐ฃ๐ฟ๐ผ๐ฑ๐๐ฐ๐ ๐๐๐ป๐?
Product Hunt is a gold mine for getting new customers. (especially Saas)
You can easily generate anywhere from 1000-3000 genuine leads for your business.
For the same of simplicity, let's divide our discussion into 3 segments -
1. Before the launch
2. During the launch
3. After the launch
Letโs dive in ๐
โโโโโโโโโโโโโโโโโโโ
๐๐๐๐ข๐ฅ๐ ๐ง๐๐ ๐๐๐จ๐ก๐๐ ๐
The big day is arriving, you are scared, yet excited. You know you need to kill it, but perfection paralysis is kicking in.
Donโt worry, here is what you need to do:
๐ญ. ๐ฃ๐น๐ฎ๐ป (๐ถ๐ป ๐ฎ๐ฑ๐๐ฎ๐ป๐ฐ๐ฒ): If you start 3 days before the launch, yes it will be stressful.
๐ฎ. ๐ฆ๐๐ฎ๐ฟ๐ ๐ด๐ถ๐๐ถ๐ป๐ด ๐๐ฎ๐น๐๐ฒ: Social media, Slack communities, anywhere really. Get out there, and help people as much as you can.
๐ฏ. ๐๐ป๐ฎ๐น๐๐๐ฒ ๐๐ผ๐๐ฟ ๐ฐ๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ผ๐ฟ๐ ๐ฎ๐ป๐ฑ ๐๐ต๐ฒ ๐ฝ๐น๐ฎ๐๐ณ๐ผ๐ฟ๐บ: If you need to win a game, you should be on top of the rules. Spend time diving deep into other launches that resemble your product. See who upvoted similar products, follow them on Twitter, and interact with them.
๐ฐ. ๐๐๐ถ๐น๐ฑ ๐๐ผ๐๐ฟ ๐ฎ๐๐๐ฒ๐๐. Donโt be the person figuring it out on the go. There should be absolutely 0 guessing on the day of launch.
Hereโs your checklist ๐
โ Title
โ Headline
โ Product Description
โ Thumbnail
โ Images/videos/GIFs
โ Maker comment (the main comment on the product)
โ Social media posts
โโโโโโโโโโโโโโโโโโ
๐๐๐จ๐ก๐๐ ๐๐๐ฌ ๐
๐ญ. ๐ฆ๐ฐ๐ต๐ฒ๐ฑ๐๐น๐ฒ ๐๐ต๐ฒ ๐น๐ฎ๐๐ป๐ฐ๐ต for 12:01 AM. This gives you the best chances of reaching the top.
๐ฎ. ๐ข๐๐๐ฟ๐ฒ๐ฎ๐ฐ๐ต: DM the few relevant people that matter. Don't blast everyone but talk to the persons who upvoted similar products. Ask your friends to upvote. And ask people in the community to check out the product and give you feedback.
๐ฏ. ๐๐ฒ ๐ฎ๐ฐ๐๐ถ๐๐ฒ: Post the content you prepared and share live updates with people to give them a behind-the-scenes look. Use this tool to get your launch analytics live.
No need to panic today, if you have prepared - you should see the results. Just be present and interact as much as you can. Embrace yourself for the post-launch work.
โโโโโโโโโโโโโโโโโโโโ
๐ฃ๐ข๐ฆ๐ง-๐๐๐จ๐ก๐๐ ๐
The real work starts now, you have a ton of new visitors, data, and hopefully revenue.
Thank all the people who supported you and try to build relationships.
If you won a badge (top product) โ add the badge to your website. And feel incredibly proud while doing so.
At this point, you probably have tons of feedback to work on. Understand what people truly mean, update your product.
Look forward and think about what's next.
And thatโs how you launch to rank on Product Hunt!
BONUS:
If you want a super detailed, 5000+ document that goes into detail about the launch, with examples and case studies โ reply โSENDโ to this and I will DM it to you โกโกโก
To call yourself a โfull-stackโ developer in 2024, you must be able to:
- Build frontends
- Build backends
- Provision cloud infrastructure
- Handle UX in Figma
- Maintain efficient CI/CD pipelines
- Create 3D art in Blender
- Manage projects with Scrum
- Attend daily standup meetings without leaving the zone
- Make YouTube videos
- Train transformer models from scratch
- Code live on Twitch for 14 hours straight
- Run a side hustle with at least 10K MRR
- Tweet about cold plunges and fasting
- Beat the stock market with algotrading
- Deploy shit with Kubernetes
- Achieve the Ballmer Peak daily
- Invoke syscalls on Linux
- Optimize for ARM-based CPU architectures
- Publish research papers on quantum algorithms
- Maintain mental health while doing all of the above
Did I miss any?
Excited to introduce https://t.co/IzUlJQAgug to the world.
Check out some of the examples we built, like a pricing component built in 22 chat-like instructions.
https://t.co/RTig1o9Jt1
https://t.co/GDuhY4qQR3 by @nrwl_io is a fantastic tool for beginners who want to understand what a monorepo is and what tools can be used to develop a monorepo architecture with all of the advantages and downsides.