Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
January 28, 2021 07:41 pm GMT

Running a Small E-Commerce-like Website for Free

As an undergraduate student in one of the universities in Indonesia, we are mostly obligated to participate in a community empowerment program, where we are supposed to help the locals by applying our knowledge. Usually, we have to physically be in the community area to take part in this program, but because of the covid pandemic, the program was held online.

There were several problems that can be solved, so we divided the tasks among multiple people. My team got a task to help the locals to promote their products and villas online. This problem is fascinating to be solved because they had tried to publish their products and villas on mainstream e-commerce platforms, but its not easy to comply with all the rules. So there are only a few products that can be promoted on those platforms. After several discussions with the locals and my team, we decided to launch and manage our own website to promote everything about this place.

Then, we planned everything that we want to display on the website. We want to promote four types of items on the website: local crafts (sculpture, batik, wood crafts, etc.), villas, regional destinations, and vacation packages. We also experimented on the landing pages design so that it can be attractive and appealing to potential tourists. Additionally, we added a route guide on how to get to the place by any kind of public transports (bus, angkot, motorcycle, commuter rail, etc.). The guide includes the schedule for each public transportation and the fares.

Initially, we planned to host all the data that needs to be displayed on the website in a relational database (PostgreSQL) and manage the contents through a simple CMS like WordPress or a more modern CMS like Strapi. Since we have to rent a server to host those CMS, we decided to research on the alternatives that can be used for free and without the need to rent a server. After thorough exploration, we found out about git-based CMS, a CMS that utilizes a git server to store all the content information. There are several services that offer a git-based CMS system, but we chose Forestry because we think it has good UI/UX, and its more mature than the alternatives. Forestry stores all of the content in a Github repo, so we can have a fully working CMS for free.

After that, we have to decide what technology we will use for the frontend. Its really exciting for me to do a small project like this because I can try and validate new cutting-edge technology. Some months before, I discovered a cool talk about web reactivity by Rich Harris, the creator of the Svelte framework (Rethinking Reactivity). Well, its more of a language than a framework, Rich Harris clarifies more on that here. What makes it different than the other UI framework like React or Vue is that Svelte shifts the work of the runtime in the browser into a compile step that happens when you build your app. So, Svelte apps can come with drastically smaller bundle sizes than the others because there is no overhead for the framework runtime.

Since we want the website to be easily discoverable by SEO, there are two technologies to choose from: server-side rendered (SSR) website or statically generated website. Then, I stumble upon a relatively new paradigm called Jamstack. Jamstack is a web architecture consisting of a Javascript framework, Static Site Generator, Headless CMS, and Content Delivery Network (CDN). The term was first popularized by Matt Biilmann, the CEO of Netlify. So, we landed on Sapper, a framework based on Svelte; its kind of like Next.js to React or Nuxt.js to Vue. Sapper supports two types of build; server-side rendered and statically generated. So, these are the websites tech stack:

  1. Sapper (Static Site Generator)
  2. Forestry (Headless CMS)
  3. Vercel (CDN)

We think this is really awesome because we can run a small e-commerce kind of website for free. Every time the admin updates the content through the CMS, Forestry will update the file that stored the specific content, located in the Github repo. Then, Vercel will detect the commit and rebuild the website by respecting all the new updates. This way, the website will be fast to load because its statically generated, and potential customers can quickly discover the website through the search engine. We think SEO is critical for marketing, so we care deeply about this and optimize it extensively until it reaches the score of 100 at web.dev/measure.

I think Sapper is fantastic because its based on Svelte and its more mature than the alternatives. But there is a catch, its still in early development, so its not stable yet and not recommended for a big serious project. The one key feature thats missing is incremental static regeneration, which is available on the Next.js framework. I think its essential for a website with a significant number of pages. If there is no incremental static regeneration, you have to rebuild the whole website every time you want to update some content on the website. Imagine, if you have 100k page on your website, it will take forever just to update one page.

The next thing that needs to be figured out is image storage. There must be at least one image to showcase a product, so this is important for an e-commerce-like website. Then, we discover Cloudinary, which is also promoted by Forestry. Its incredible because the free plan is very generous. The website barely used 33% of the limit. You can also alter the images size on the fly by putting the appropriate setting on the images URL.

I also use Tailwind, a utility-first CSS framework, for the styling part of the website. I already used it before on a previous project, and Im delighted with the workflow because its convenient to use, and its really easy to keep the design consistent. Its created by Adam Wathan and Steve Schoger. They are the author of the Refactoring UI book, which I think is a must-read for every front-end developers because its really concise and beautifully written. If you cant buy the book, you can read a sneak peek of it on this medium article.

The website: bufferzonetanjunglesung.com


Original Link: https://dev.to/ngavinsir/running-a-small-e-commerce-like-website-for-free-1cbc

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To