"We cannot solve our problems with the same thinking we used when we created them." - Albert Einstein
Share on Twitter
I am thrilled to share our story of switching to a new website design with the Indie Hackers community. After almost two years in the market (Front-End development), our team decided to take a step aside, rethink the processes, and introduce a new branded homepage with some hidden gems. We aimed to create a more user-friendly and visually engaging customer experience. The new design features a modern look, updated content, and streamlined navigation.
In most cases, when a new prospect comes to us, we spend a significant amount of time on onboarding activities. Of course, we share our previous projects, testimonials, references, etc. These activities are time-consuming and not always relevant to the outcome.
After some brainstorming, we realized that it would be better if most of this information our prospects discovered on their own and decided without any actions from our side. It’s not only a good idea for time spent but also for our future clients. No one pushes them to decide, and they will feel free of choice and understand we are an excellent fit for each other.
With those items in mind, we started working on the design and user flow in parallel. Here are our goals:
Our team likes challenges, and I must say that we are extremely good at them. We dealt with many interesting and head-scratching tasks while working on our new homepage. The list of challenges is pretty long, so I decided to share with you our top five challenges:
Before writing any line of code and making any decisions, we usually do an elementary but essential activity - research + white paper and pencil.
First, we started thinking about a cloud provider for CI/CD processes and code sharing among the team. The most obvious choice in our case was to use GitHub with its infrastructure, including GitHub Pages, GitHub Projects, and GitHub Actions. The main benefit of using these services is that they are on one platform, and you don’t need to break the bank.
Speaking of the tech stack, we chose Next.js, React.js, and TypeScript. While we had hands-on experience with React.js and TypeScript, we were new to Next.js. However, we decided to give it a shot and see if it lived up to its reputation as described in ads and articles. Another reason for choosing Next.js was that some planned functionality required server-side code, so having JavaScript on both the server and client sides seemed beneficial. We used Material UI, built on top of Google Material design concepts, to create the UI and reusable components. It offers a rich set of components with enterprise-level performance and high extensibility, including responsive behaviour, accessibility, and light/dark themes.
After a week of development, we realized that GitHub Pages didn't support some of the functionality provided by Next.js, precisely API routes and Edge runtime. To overcome this limitation, we decided to switch to the Vercel platform. However, we encountered a few blockers: the Pro plan was required if the repository was under an organizational account, and we wanted to avoid potential vendor lock-in. As a result, we searched for alternatives and discovered Cloudflare Pages, which fulfilled all our needs. It turned out that Cloudflare Pages only supported the Edge API environment, so we had to write the server code accordingly, considering this limitation.
The next challenge was achieving the desired "Social share behaviour." When someone shares a link to our website, we want to display a title, a short description, and an image.
Twitter's behaviour when someone shares the link
LinkedIn's behaviour when someone shares the link
Let’s discuss the contact form and the possibility of sending messages from the landing page. For the first version of our landing page, we added a pretty simple solution:
<a href="mailto:[email protected]">
get started
</a>
When a user clicks on that link, the default email client opens, and the user can write an email. However, we received feedback that many visitors to our website don't have a default email client or don't have one at all.
To improve this functionality, we decided to build it from scratch instead of using a third-party provider for the initial version. We developed our solution using nodemailer. We successfully implemented it, but we encountered several issues:
As a result, we decided to explore third-party providers for this task. We came across a solution called Resend through a post on Twitter. The integration process was straightforward. The only difference was that we opted to use Resend's API instead of the npm package because Cloudflare Pages don't support using npm packages in their Functions. Here is a simplified version:
// ...
const json = await req.json();
const data = await fetch(`${process.env.RESEND_API_SEND_EMAIL}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json; charset=utf-8',
Authorization: `Bearer ${process.env.RESEND_API_KEY}`,
},
body: JSON.stringify({
from: process.env.RESEND_FROM,
to: process.env.RESEND_TO,
subject: '🔥 New request on varbintech.com via contact form',
html: json.html,
}),
});
// ...
The last functionality we tackled was the subscription feature. Honestly, it was the most challenging one. It wasn't just about writing the logic and using APIs, it involved passing compliance checks and chatting with representatives. After thorough research, we found two third-party providers suitable for our needs:
You may have heard about these providers before. However, it took us two to three weeks of waiting, chatting, and exchanging emails before we finally received approvals from the Lemon Squeezy team.
I use dark mode, which makes your landing page briefly flash white when I load it. Best to serve CSS with
(prefers-color-scheme: dark)
rather than do the light-dark switch client-side.Hey @stevetaylor, I am writing to inform you that we fixed that flash for dark mode.
Instead of being presented with the content in light mode initially, I’m now presented with a blank white screen initially. You’ve now hidden the entire page until JavaScript has loaded, at which point you switch to dark mode. With respect, I wouldn’t call this a fix.
It’s a very nice landing page overall with one annoyance that feels jarring. Hope you can find a proper fix soon. You’ve piqued my curiosity regarding MUI’s handing of dark mode and SSR, so I might take a look at it myself soon.
Yes, I agree it should be called a workaround, not a fix. We continue searching for the right approach to avoid all hacky ways.
Hey @stevetaylor! Thanks a lot for a catch eye. Yes, you are right. Unfortunately, it's one of the constraints we faced while using MUI. We have a separate task in our backlog but with low priority.
MUI is a poor choice for websites. It's designed for highly interactive web apps.
Well, it could be. But I believe we will find an elegant way to fix this.
Curious to know a little more about your headless CMS? I manually write blogs in my codebase in VSCode, and I have to manually make my own JSON-LD: it sucks, it feels too painful, but I haven't had time to setup some super-advanced CMS integration.
Curious to hear how you did this.
Hey @DMiradakis, thanks a lot for showing interest in that topic. We usually use Strapi. The setup process is well documented and can be found by following this link. The only thing that you need to consider is hosting for the production environment. Another critical moment is a database - Postgres, MySQL, MariaDB, and SQLite. Strapi v4 does not support MongoDB. I found several providers with a free tier. Unfortunately, I didn't touch them, so I don't want to mention them until having hands-on experience.
This comment was deleted a year ago.
Hi @SaltyWaffle! Thanks a lot for your comment. I saw Cloudflare Team has started working on workers specifically made for emails. I have taken a look at the documentation. It looks pretty interesting and promising. The only thing is the Known limitations. As for us, it would be a problem not to able to use the same email address to send a response to the prospect. Other than that, it's a great tool, and I believe we will use it for our internal needs and products.