Dos and Donts to Keep in Mind for Building an Ecommerce Website

Despite stiff competition from the brick-and-mortar stores, the Ecommerce space is thriving. 

  • Digital Commerce 360 estimates that the consumers worldwide spent nearly $4.29 trillion online in a pandemic-fueled 2020, up from $3.46 trillion in 2019. 
  • By 2023, Ecommerce sales are expected to double to an astounding $6.5 billion.

In the post-pandemic world, people are likely to opt for online shopping for their regular and not-so-regular shopping. If you currently run an online business or plan to launch an Ecommerce venture soon, you have a great chance of success. 

We would however like to point out that attracting and retaining customers largely depends on how your Ecommerce website is built and the user experience. Failing this, your customers are likely to abandon their efforts to purchase your products or services. 

How can you ensure that your Ecommerce website meets (or even exceeds) the expectations of your customers? We have listed 8 ‘Dos and Donts’ that you must keep in mind while developing your Ecommerce website. 

Do These Things When Developing an eCommerce Site 

#1 Failing to Plan = Planning to Fail 

Whether you’re starting an online store, redesigning your website, or preparing to launch a new marketing campaign, solid execution needs careful coordination of numerous activities. Therefore, we recommend that you start with a plan that covers all the contingencies. Your plan should include key objectives as well as a timeline for when you want to reach certain milestones. Aside from that, it should include key metrics for measuring your progress and success. Don’t forget to plan financially to help get your business off the ground and save for future investments.

#2 Ensure Your Website is Responsive

A web search accounts for approximately 39 percent of global Ecommerce traffic — and with more people using their mobile devices than ever before, you’ll likely have a good number of prospective customers who will try to visit your site from their smartphones. If you’re wondering why you need a mobile-friendly website, one good reason is that a non-responsive website will immediately deter anyone who finds your site on their phone or tablet. When you hire a company to create a custom web design for your Ecommerce business, make certain that their work is responsive. Otherwise, you risk alienating mobile customers who are otherwise eager to place an order.

#3 Focus on Shopping Cart Design

Customers will not take the risk of checking out if the shopping cart does not function properly. It is preferable to have a cart that allows the customer to easily add different products and quantities as well as make revisions or deletions. You must provide pricing transparency, especially when discount codes or gift vouchers are used, and allow customers to get a clear idea of the shipping charges they may incur before proceeding to the next step in the process. If a product in a customer’s shopping cart sells out before they can buy it, it’s a good idea to include special notifications. 

#4 Open Source or SaaS – Choose wisely

You’ll have a significant decision to make as you enter the world of Ecommerce, depending on a variety of factors such as your company’s current and future needs, as well as budgetary and other constraints. Should you host your online store on an open-source or SaaS platform?

If you don’t need a highly customized online store and instead want to focus your energy and time on running and scaling your business rather than managing technology, a SaaS platform will suffice. It will save you a lot of time and money while allowing you to focus on your business goals. 

If you want a highly customized shopping experience, open-source is a good option.

Avoid These Habits When Building an Ecommerce Site

#1 Don’t Make Customers Do the Work

You’ll want to make the customer’s journey as clear as possible with any type of custom web design. This is especially true for Ecommerce websites, where any confusion or frustration can cause a customer to abandon their cart. Make certain that your website is simple to use and that there are no inherent complications that would cause anyone to reconsider placing an order. Your custom web design should be created in such a way that achieving any specific result requires only a few clicks. In general, you should not waste the customer’s time.

#2 Don’t Forget Call to Action

A call-to-action is essential, especially when encouraging customers to make an immediate purchase. While you should avoid overcrowding your custom web design with too many buttons, links, or pop-up advertisements, you should also not pass up an opportunity to create an incentive. Weigh your options carefully and ensure that all calls to action serve a specific purpose and can demonstrate real pay-off.

#3 Don’t Think Ecommerce as a One-time Project

Setting up Ecommerce for your business requires a great deal of care and attention to detail to ensure that everything is perfect. You must update your website regularly to reflect the most recent products and their prices. Check that all of the pages and links are functional and that the checkout process is working.

#4 Don’t Try To Do Everything at Once

While it is true that juggling multiple activities is required to achieve online success, keep in mind that you cannot do everything at once. Attempting to accomplish everything right away will work against you, leaving you feeling overwhelmed, overworked, and discouraged. Instead, plan wisely, set realistic goals, and carry out your activities per your pre-established schedule. 

Wrapping Up

An Ecommerce website has the potential to completely transform your business. It can not only increase your sales but also help you establish your company on a global scale – all without the hassle of opening a physical store.
Developing an Ecommerce website indeed necessitates a significant amount of sweat, time, effort, and money. A good Ecommerce site, on the other hand, can not only increase sales but also retain more long-term customers than you could ever expect if you know the right techniques.

Our team at Galaxy prides itself in designing some of the best Ecommerce solutions for businesses globally. Contact Us right away for a free consultation!

7 Best Practices For React Security

React is undoubtedly one of the most popular JS libraries to build applications. It is also one of the most actively developed libraries which means instant bug fixes and security patches. React has many advantages, but may fall susceptible to security threats. Here are a few recommendations that we share based on our vast experience of working with this technology.

(Know more about our proficiency in Front-end Technologies)

Cross-site scripts and URL injections are some of the most common and serious attacks that affect applications in general. These vulnerabilities are targeted to steal sensitive user data and capture user input to steal credentials and card information.

We have made a list of some best practices that will help you enhance the security of React applications. Do have a look!

Protection against XSS

Your application may have some vulnerabilities that hackers can exploit and insert data in your code that your app treats as part of the code. This in turn gives the attacker the access to make requests to the server and even captures user inputs to steal sensitive credentials.

The injection might look like this:

Code!<script>alert(“malicious code”)</script>

Here’s what the same thing looks like with some protection against XSS:

Code!&lt;script&gt;alert(“malicious code”)&lt;/script&gt;

&lt; and &lt; being interpreted as < and >, the browser won’t confuse the data for code.

You can also use:

  • Using the createElement() API.
  • Using JSX auto escape feature.
  • Using dangerouslySetInnerHTML to set HTML directly from React instead of using the error-prone innerHTML.

Adding End-to-End Encryption

Almost every real-time communication application that you’re using comes with End-to-End encryption as standard.

End-to-end encryption means that nobody else other than the parties involved can read the messages. It’s made possible by encryption technology that ensures that the message is encrypted just as it leaves the sender and can only be read once it reaches the intended receiver.

To get E2E in your React application you have to rely on a vendor that provides the tools and kits to ensure secure encryption. Virgil for example is a vendor that provides a platform and JavaScript SDK to create, store, and offer robust E2E secure encryption via public/private key technology.

HTTP Authentication

There are several ways to make authentication secure in your application. Pay special attention to the client-side authentication and authorization because typically they’re ones subject to security flaws.

You can use one of these to ensure your application safety

JSON Web Token (JWT)

  • Move your tokens from localstorage to an HTTP cookie since it’s fairly easy to extract from local storage.
  • Keep, sign, and verify the secret keys in the backend
  • Avoid decoding the token on the client-side and ensure that the payload is small.
  • HTTPS over HTTP under any circumstances

Other methods:

  • OAuth
  • AuthO
  • React Router
  • PassportJs

Rendering HTML

You should always sanitize dynamic values that you assign to dangerouslySetInnerHTML. The recommended sanitizer to use is DOMPurify.

Import purify from “dompurify”;

<div dangerouslySetInnerHTML={{ __html:purify.sanitize(data) }} />

DDoS prevention

Denial of service happens when the app is not secure or it’s unsuccessful in masking the IPs of services. As a result, some services stop because they can’t interact with the server.

One way to deal with these issues is to just limit the number of requests to a given IP from a specific source.

Or you can always- 

  • Add app-level restrictions to the API.
  • Make calls on the server and NOT on the client-side.
  • Add some tests to secure the app layer.

Keep Your Dependencies Updated

There are a lot of third-party dependencies that you use that are patched regularly for security reasons. They can prove to be risky if not updated.

Update your dependencies regularly via security patches and ensure that you leave no backdoor vulnerable for attacks. Try using npm-check-updates to discover dependencies that are out of date. And update if needed to ensure that you’re covered.

Keep An Eye On Library Code

Third-party libraries. Useful? Yes. Risky? A little.

These libraries, modules, or APIs in most cases will help you fast track your development but sometimes they might take your application down with their flaws.

That shouldn’t stop you from using some great third-party offerings. Just a word of caution though, ensure that you are aware of the vulnerabilities, their scale, and workarounds.

And lastly, keep them updated and patch the old ones, just to make your application airtight.

We hope that you find these practices useful and employ some or all to keep your React applications secure and in shape. Do let us know if you’re struggling with some enterprise-wide dependable implementation, we are here to lend a hand. Get in touch with us here.

Top 5 Python Frameworks To Opt For

Building the backend for a web application or service?

It doesn’t matter if it’s simple or complex, there’s a Python framework that can address your needs. Choosing the right one can make tedious implementations like user management, data design, form submissions, and security, less of a headache.

If your project is simple you can opt for something implicit and minimal rather than explicit and complex. Whereas, if you’re working on a big project then you’d need all the firepower a framework can pack. Here are 5 Python backend frameworks that you might want to consider for the backend of your web application.

1. Django

Undoubtedly one of the most known and deployed frameworks, Django has been the go-to choice for enterprises for building web applications for years. With its 3 stable releases, Django has come far in terms of deployment speed. It is now equipped with the new asynchronous ASGI standard for Python web applications.

One of the reasons that Django is so popular is that it comes with batteries-included, meaning all the components that you’d need to develop a generic web application. For instance – user management features like tracking, sessions, passwords, and admin permissions, etc. are common to most web applications. Django provides these features natively.

From a safety POV, Django has some practical defaults to prevent attacks and cross-site scripting issues. While placing a variable in a page template, such as a string with HTML or JavaScript, the contents are not rendered literally unless marked safe.

This Python framework sure is powerful but it comes at the cost of unnecessary complexity; even simpler applications need a lot of configuring to install and run. Django applications are heavy and come with many moving parts. Django is monolithic, meaning apps are chunky and tightly coupled, so everything gets deployed together.

2. CubicWeb

CubicWeb is an object-oriented semantic web app framework. It uses reusable building blocks of code called “cubes”. Cubes are made up of a schema, logic, and views. These components can be utilized as in any other modular framework, each having its function. It lets you build apps by reusing your code and of others.

It’s a powerful Python framework featuring the fundamental building blocks of a modern web application. In CubicWeb, you set up and manage instances with a command-line tool and its built-in templates let you generate HTML output conveniently.

Since CubicWeb doesn’t support the native async functionality some workarounds are required. One of which is to use the cubicweb-worker cube to perform tasks asynchronously. Moreover, it also comes with a lot of dependencies which translates to a daunting list of manual tweaking on the local environment. You can use pip install instead to get them all in one go or you could also use a Docker container to set up shop.

The CubicWeb development has been slow and is not the most promising but it still powers some of the large-scale semantic web and linked open data applications.

3. Web2py

Inspired by the simplicity of Rails, Professor Massimo di Pierro created a simple and easy to set up framework called Web2py. It’s a scalable, open-source full-stack framework for Python which comes with its web-based development environment and features like Role-Based Access Control (RBAC), Database Abstraction Layer (DAL), and support for internationalization.

The data abstraction system in Web2py is a bit different from Django’s ORM, which uses Python classes to define models, whereas Web2py uses constructor functions like define_table to instantiate models.

Just like CubicWeb, Web2py doesn’t explicitly use Python’s Async functionality, but it makes up for it with a scheduler for handling long-running tasks.

4. Weppy

Looking at features like data layers and authentication, Weppy will remind you of Django. But when you look at the code it starts looking like Flask, with minimal instruction to get a basic single route setup ready.

Weppy is a lightweight framework and comes with convenience functions, which makes it great for building RESTful APIs. You just have to use @service on a route to get data that is automatically formatted in the format of your choices like JSON or XML. Though lightweight, it packs some big framework features sans the weight and complexity. Validation mechanisms, form handling, response caching, internationalization, and user validation among others are such features.

The not so complex ‘Just enough’ features come with some trade-offs. Weppy extensions try to make up for these trade-offs but unfortunately the list of official add-ons is not that long.

The upcoming Weppy 2.0 will support async and sockets as low-level first-class entities. Also, all the upcoming versions will require Python 3.7 and above to run.

5. Zope

In contrast to every framework mentioned in the list (except for Django) Zope is meant to be a full-blown, enterprise-grade application server stack. For templating, Zope uses a flexible Zope Page Templates (ZPT) system or a basic DTML markup system. While ZPT can be a powerful way to design templates but the syntax takes some getting used to.

While the complexity can be beneficial for enterprise-grade applications, when it comes to installation Zope can be a bit difficult. So much so that it also offers a specialized setup tool called zc.buildout for installation .

If there are no resource constraints and you can look past the unnecessarily complex setup then Zope might prove to be the best for a large undertaking.

One thing to note is that there is no direct support for Python’s async. However, Zope utilizes the zc.async package to distribute tasks across machines and synchronize them in a ZODB instance.

There are a host of choices to base your backend on. It boils down to how much functionality and freedom to tweak are you looking for? All of these frameworks offer something that makes it a unique offering. You just need to truly understand what your solution needs and your choice will be easy and best suited.

Galaxy Weblinks

With over a decade of experience in creating and delivering robust software design and development services, our developers know the backend technologies like the back of their hands. Galaxy has expertise in all major backend technologies, be it PHP, Java, Node, and Python. You can spell out your requirements and leave the rest to us. For more information, do visit us here.

Micro Frontend | 4 Things to know before switching

The first part of this series uncovered the idea of Micro Frontends that is to break down the frontend monolith into smaller, more manageable pieces. (Read the blog here)

Each team can constantly deliver small incremental upgrades, work in their proprietary codebase, independently release versions, own their features end-to-end, and also integrate with other teams via APIs so that they can manage and compose applications and pages together.

This article will share some important decision points to help you decide whether micro-frontends are right for your project, and if so, how do you proceed?

1. Consider the size of your team

Micro frontends enable teams to develop faster and deploy end-to-end features from the database to the user interface on large web applications. An independent team can own and maintain a component without sharing technology or a release process with other teams. That means when a team uses components from other teams, all they need to know is the custom HTML element and its attributes.

Whereas, companies with multiple teams each using a different frontend framework can build a unified component library. For shared code like cookies, local storage, the DOM, and CSS, teams would agree on a namespace convention without any dependencies.

Sep Nasiri from Upwork who leads its UI Infrastructure Team says, “Migrating to a micro frontend architecture introduced some challenges but the benefits of modernizing Upwork’s frontend along the way made it worthwhile. Modernization will help deliver more consistent user experience, streamline certain services, and future-proof our site for Upwork’s 17 million global registered users.”

In essence, micro frontends will help change technologies for an existing application. The team could deliver value gradually by launching parts of the application without attaining much technology debt whenever there is a change in the existing application.

2. Organizational Structure

Similar to building microservices, the basic idea is to allow the DevOps teams to operate and build their micro frontends without any dependency. Remember, their goal is to ship something of value to the business people faster. To allow them to work quickly regarding integration and platform complexity, there should be a Platform Team to support them. The Platform Team is responsible for the platform and ensuring guidelines so that new micro frontends can integrate easily. Ideally, the DevOps teams can ship, develop and plan a new micro frontend without the Platform Team. Besides, they should be able to monitor operational problems and access logs by themselves. Otherwise, the Platform Team will be overloaded and the approach will not scale.

Here is a simplified diagram of the organizational structure:

What is missing from the structure is Governance. If you’re using this approach on a large scale, you need some supervision to avoid uncontrolled growth and to maximize the reuse of existing micro frontends. If you already have a lot of microservices or a WebService catalog, you can do something very similar in that scenario as well.

3. User Experience

Beyond any doubt, User Experience and User Interface Design are the most decisive parts when building systems with micro frontends. This is because a completely heterogenous UI with different behaviors, fonts, and colors is difficult to accept by users and business people alike. So, choose to implement micro frontends after ensuring these decisive points:

  • Provide the developers with CSS (a theme) they can apply during development so they can see how it will look when integrated.
  • Define all common UI components in pure CSS. Then the teams can use the JavaScript framework of their choice as they just have to use the predefined CSS classes.
  • Make sure you have an expressive UI component library that covers not only the single UI elements but also the most important interaction patterns.

4. Multiple client-side libraries and frameworks

Should a team use Vue, Angular, or React for the frontend of a particular component? There are reasons why one library or framework fits better in a situation over the others, and there are pros and cons for each as well. Irrespective of your choice, keep in mind you are not building the web application just so you can use the frameworks; you are choosing the frameworks so that you can build your web application. Just like any architecture, the users will benefit from faster response times from the fewer number of libraries and frameworks you are loading on the client-side.

Because adding another framework means the user experience might become slower due to the additional load. The teams should mutually agree on using the same JavaScript framework whenever possible.

Let’s imagine, the teams got to agree on the same JavaScript framework. Now the teams need to decide that because of the given independence, whether they’re gaining efficiencies on deployment and development or not.

Build modern web apps using microservices with Galaxy Weblinks

The micro frontends and microservices approaches are great techniques to help divide the workload for multiple teams and to isolate code for each Custom Element. It might not be a good idea to choose the added complexity before you need it! Keeping in mind that micro frontends come with extra overhead, the considerations in this article will hopefully help you before implementing this approach.

About Galaxy Weblinks

We specialize in delivering end-to-end software design & development services and have hands-on experience with backend and frontend technologies. With our hands-on experience with Kubernetes, Docker, you can automate the deployment of scalable, future-proof applications.

Micro Frontends – A Nimble Approach Towards Frontend Development

This is a two-parter series on Micro-Frontend and it’s implementation. And if you’ve already read this one, head on to the part two for 4 Things to keep in mind while working with Micro Frontends.

As the business and product expands, the software architecture leaves us with a monolithic frontend and backend, and the inflexibility that comes with this.

The prevalent practice, microservices architecture, has been used as the foundation on which feature-rich applications can be built. This made many product developers adopt microservices on the backend-side, and start extracting logic one-by-one into separate microservices. The typical setup looks like this:

These microservices get aggregated and consumed by the frontend through an API gateway. Broadly, it appeared that we cannot scale UI on the front-end. The applications, thus, developed are known as Frontend Monolith.

This time, the whole hype is about facilitating a co-existence of different front-end frameworks. And approaching the front-end development process of web apps with the concept and idea of microservices, calling them micro frontends.

To help you figure out whether you need the integration of micro frontends in your development process, let’s take a closer look at micro frontends.

What Micro Frontends can mean for your web apps?

The most popular development approach used for modern web applications is the single-page application (SPA).

The typical SPA application flow follows standard steps:The user visits the web application

-The browser requests the JavaScript and CSS

-The JavaScript application runs and provides the initial content to the browser document

-The user interacts with the application – such as adding a product to the basket or clicking a navigation link

-To show the changes, the application rewrites browser document parts

SPAs are critical to modern development, but they aren’t perfect. SPA comes with many disadvantages.

  • Framework complexity: Many frameworks can provide the SPA experience and allow you to build a solid SPA, but each targets different needs, and knowing which to adopt can be hard.
  • Browser performance: Because the SPA does all the rendering and processing of the user interactions, it can have a knock-on effect depending on the user’s configuration. Not every user will be running the application in a modern browser and at a high-speed connection. It’s important to have low processing time and keep bundle size down as much as possible to have a smooth user experience.

The above-mentioned reasons showcase the common issue, which is scale. Building a huge or complex application requires multiple developers that can help fit all your user’s needs. Working on a SPA with a monolith frontend can lead to many people working on the same code trying to make changes and causing conflicts.

So what’s the solution to all of these problems? Micro frontends!

“Micro Frontend Architecture is about considering a web application as a composition of features owned by independent teams. Each team has a distinct area of business that it specializes in. It is an architecture pattern for building a scalable web application that grows with your development team and allows you to scale user interactions.” – micro-frontends.org

The typical setup looks like this:

pasted-image

Whereas, a real example looks something like this:

bitdev

The above home page is developed by the Bit team and used modern component-driven technologies like React and Bit to build micro front-ends.

In the above image, you will see two sets of components, developed by two teams. One is “evangelist’”, owned by their marketing team. The second is a “base-ui” set of components, handled by their front-end infrastructure team. Components from both sets are combined to quickly create the homepage you look at. As well as other pages like the Support Page or Enterprise Page, and even to compose more applications.

The pros: Complete Technology Isolation: you can have dotnet on one side and node.js on the other side irrespective of what technology is used in both systems.

Complete Deployment Isolation: you can implement each frontend release and batches without affecting the other component.

Fast Load Time: because you don’t need to load all libraries and resources you have in your store to the payment system.

Easy Cache: as the 2 systems are completely isolated so managing the cache is very easy.

Reasons why Micro Frontends are for you?

Here are some good reasons to accept the extra complexity and integration costs while choosing to implement micro frontends. Apart from the above reasons, there could be others as well:

-You are going to build a huge web application that cannot be maintained as a monolith (at least not for a long period).

-You want to add new features to a legacy application that is no longer maintained (or no developers are available any more for integrating new technologies).

-Your company has invested in some commercial systems like a portal, CRM, or a CMS. But when the system is going to be replaced, you want to prevent your internally developed applications from becoming useless. Also, you want to integrate existing applications there.

-Newly hired developers are not that productive throughout the development process – ideally using the technologies they prefer and are used to.

-Your business applications tend to live 5+ years and you want to avoid relying on a single web framework that might get obsolete.

Here is how Galaxy can help you

Your business is often left unable to deliver modern online experiences when release cycles take months instead of weeks. Development hold-ups slow your ability to make application updates, keeping you from innovating and iterating. And outdated or clunky UX keeps you from retaining your customers and winning over them.

Galaxy’s experts will help you implement an end-to-end vision by creating a modern development stack for building enterprise applications using required frontend and microservice technologies for your business. We will enable your team to rapidly build, design, and launch applications from microservices.

Learn about Galaxy’s suite of Frontend, Microservices and DevOps capabilities to help your enterprise build better and faster apps, sites, and portals.

About Galaxy Weblinks

We specialize in delivering end-to-end software design & development services and have hands-on experience with backend and frontend technologies. Our engineers, frontend developers, and UX/UI experts help improve security, reliability, and features to make sure your business application and IT structure scale and remain secure.

How to Migrate to .Net 5 without any hassles?

As 2020 came to an end, Microsoft announced their .Net 5 release along with a fixed schedule for release and support for future updates and EOLs. Going forward .Net, .Net Core, and Xamarin will be consolidated during the .Net 5 to .Net6 wave. This is likely to make the development process for Mobile, Web, and Desktop with .Net much more unified and easier. Here are some of the major highlights from a fairly beefy update:
  • .Net now supports single file applications that don’t necessitate for .Net to be on your machine. Now you can compile .Net in your application and get a small single file that you can copy to any machine.
  • One .Net means one SDK for mobile, web, desktop, and console.
  • Native support for ARM64 in .Net core
  • Smaller containers than ever before
  • Cross-platform Native UI

Migration Plan

As with any migration plan, first and foremost you need to be aware of everything that is not making it to the upgraded version. Earlier Core 2.0 borrowed some technologies from the .Net framework, that’s not the case with newer versions. Rather some things may be skipped in the new version for some technological reason or the other.
  • AssemblyLoadContext is replacing app domains, as the latter is quite an expensive runtime feature and not suitable for modern app development.
  • Remoting is being replaced by named pipes and gRPC
  • WebForms is being replaced by ASP.Net Blazor
  • WCF Server is being replaced by gRPC and Open source CoreWCF
  • WF is being replaced by Open source Corewf

How to Migrate your project to .Net 5

1. Ask if and why you need to migrate

The first step in migration is to understand the feasibility and goals for migration. No need to be over aggressive with the migration because .Net is not going anywhere. If you’re happy with how things are, then there is no need to migrate as .Net is part of Windows and is bound to get fixes for a considerably long period. On the other hand, if you want to innovate and leverage new features and technologies then .Net 5 is the way forward. Your migration approach will also depend on your choice of Operating System. If you’re sticking with the existing one or shifting to another. Pro Tip: Ensure that you have backups along the way so you can still ship working software. It’s futile to port in a big one-off migration. While it might work for small projects, not so much as your projects get bigger.

2. Analyze your app

Having worked months, even years on an app, one might think that they know the app inside out. It might be true for simple apps but in the case of complex projects, it’s easy to overlook obsolete things that might add to the difficulty of an already grueling undertaking. Things to keep in mind while auditing your app:
  • Use ApiPort to list outcode and its dependencies.
  • Legacy code can be a pain to carry forward. Analyze legacy code for feasibility if it seems obsolete and expensive to refactor then consider dropping before the port.
  • Analyze dependencies and ensure they have support for .net 5. If they are not supported then consider moving to modern alternatives before porting.

3. Convert Project

After understanding the needs for the port and deciding to ahead with it, you’ll need to convert your project. Conversion typically involves:
  • Replace packages.config with<packageReference> elements in the project
  • Another option would be to use Try-Convert to automate the process to migrate the project files to SDK style
Pro Tip: Consider only migrating the project files without changing the target framework as you’ll need click stops for big projects in case of unexpected downtime There are some limitations to Try-Convert method
  • It can’t convert some project types like ASP.NET and Xamarin
  • It doesn’t migrate any source code (*.cs), only project files(*.csproj)

4. Time to make the move

Replace the target framework string in the project file from the existing version to .Net 5. As stated earlier avoid moving everything at once you would want to start from the bottom with reusable libraries and make your way from there. Additionally, identify if you have shared components that need to continue to work on the existing .Net framework. Retarget those to .Net Standard and then retarget remainder to.Net 5.0

5. If you want to move to another OS

When you’re looking to change your operating system, ensure that you use a CI environment that can run your code in multiple operating systems. Azure DevOps, Github actions, etc. And last but not least, run tests to ensure that everything is working as expected. There are a lot of moving parts in an enterprise .Net project, and the scope for mistakes while porting is immense. It’s not a question of expertise but of time and resources. While the automated tools might make the process less of a pain but you’d still have to engage resources to make time-consuming changes in the source code. Currently handling numerous .Net projects, a few of which are under migration, Galaxy provides the needed expertise and resources to make the migration smoother with zero downtime. Contact us now for a free consultation on your .Net project.

Creating forms in React – The Right Way!

In the world of web development, there are several front-end frameworks. Angular, Vue, React and a few others have gained immense popularity over the last few years. However, React has surpassed other frameworks in terms of popularity and demand:

React is used to build single-page applications and allows the creation of reusable UI components. Forms are an important component of React applications. They facilitate users’ interaction with the application. Some of the common use cases of forms are:

  • Login and Registration Forms
  • Contact Form
  • Checkout Forms
  • Create/Edit Order Forms
  • Adding or updating data into the application

It is virtually impossible to develop a React-based app without forms. At the very least, you will need it for the login and sign up screen, in case the data is retrieved.

In this article, we will share some best practices for creating forms in React. Let’s get started.

Forms using Controlled Components

We know that HTML elements like input remember what we type. Similarly, we can use the React component state to store data of forms. When the input data of forms elements is handled by the React component, it’s called a Controlled Component. Here, the only source of truth is a component state, not a DOM element.

Handling Forms

This describes how the data is handled when the value is changed or submitted. In HTML, the form data is usually handled by the DOM whereas, in React, components are used. When the data is handled by the components, it is stored in the component state.

Here is the code –

This is how one can collect the data from the user and get it right there in the React.

In the same way, if one wants to update the state, one can use the event handler “onChange”.

Now, to execute it, one can use the following code.

Conditional Rendering

If you do not want to display the h1 element until the user has made any input, you can add an if statement. Look at the example below and note the following:

1. Create an empty variable, in this example call it a header.

2. Add an if statement to insert content to the header variable if the user has done any input.

3. Insert the header variable in the output, using curly brackets.

Multiple Input Fields

You can control the values of more than one input field by adding a name attribute to each element. Here is how you can achieve this

  • When you initialize the state in the constructor, use the field names.
  • To access the fields in the event handler use the event.target.name and event.target.value syntax.
  • To update the state in the this.setState method, use square brackets [bracket notation] around the property name.

Validating Form Input

You can validate form input when the user is typing or you can wait until the form gets submitted.

Adding Error Message

Error messages in alert boxes can be a tad bit annoying! We recommend displaying the error when the user input is invalid.

Using React Hooks – Alternate Method

We can also handle the form state using React hooks. To do that we have useState() hook for storing state in a functional component. Let me explain this by creating a simple form with one input element and handle its data using a hook.

import React, { useState } from ‘react’; export default function ControlledFormWithHook() { const [name, setName] = useState(”); return ( <div> <form> <label>Name:</label> <input type=”text” onChange={(e) => setName(e.target.value)} /> </form> <br /> Name is: {name} </div> ); }

Here we have used a useState() hook to handle state.

Why use React-hooks-form?

One of the primary goals of React Hook Form is to reduce the amount of code that you have to write. As you can see from our final result, the React hooks form is elementary to use, and it takes a small amount of code.

Making The Right Choice

Forms are a crucial part of most web applications. It is imperative to know how to handle them, and fortunately, React provides a lot of ways to do just that.

For simple forms that don’t require heavy validations (or that can rely on HTML5 form validation controls), you can use the built-in state handling of the DOM given to us by default. There are quite a few things you can’t do (like programmatically changing the input values or live validation), but for the most straightforward cases (like a search field or a login field like above), you’ll probably get away with an alternative approach.

When you’re doing custom validation or need to access some form data before you submit the form, handling the state explicitly with controlled components is what you want. You can use regular useStateHooks, or build a custom Hook solution to simplify your code a bit.

Whatever you decide to use, handling forms in React has never been more straightforward than it is today. You can let the browser handle the simple forms while handling the state explicitly when the situation requires it. Either way – you’ll get the job done in fewer lines of code.

Contact Us right away to discuss your website or app development according to your business requirement and complexities.

About Galaxy Weblinks

We specialize in delivering end-to-end software design & development services and have hands-on experience with large, medium, and startup business development requirements. Our engineers also help in improving security, reliability, and features to make sure your business application scale and remain secure.

Craft CMS: Building the frontend of a website using Twig and GraphQL

Craft is a mature and tested content management system. Airbnb, W3C, Netflix, PBS, Salesforce, Moz, and countless other brands switched to Craft CMS for redesigning their websites. That for sure proves its credibility against other popular CMSs.

You can use Craft to design and develop complex and intuitive sites that rely heavily on PHP, databases, and query optimizations. However, you can also use Craft to design and develop simple sites where you do none of those things.

Craft CMS has ditched the traditional CMS systems that come with ready-to-go page templates, CSS frameworks, and pre-built themes. As a result, developers have a bespoke solution to build tier solutions. Craft CMS neither offers posts or pages or any bootstrap features and themes to build the frontend.

Craft CMS supports two distinctly different ways of building a front end:

Monolithic: building Twig templates for server-generated pages.

Headless: using a GraphQL API in combination with a separate front end codebase.

But before diving into these two frontend approaches, let’s find out what web developers, designers, and stakeholders love about Craft CMS.

Why Craft is a choice of many front-enders and website projects?

Both web designers and developers find Craft CMS features incredibly useful. Before installing any plugins, the options and functions developers have to work with are impressive. Here is a partial list of features and the reasons why Craft is preferred more for which many other CMSs require plugins:

  • It allows content managers to custom page layout building and preview updates in real-time.
  • One can manage all of their brand sites under one roof, whether it’s a multi-site, multilingual, or both. This is a major problem area with the majority of other CMSs.
  • With virtually no learning curve, the UI of the Craft control panel is very intuitive.
  • Craft is fast for the front end as well as the Control Panel and tops the many reasons for choosing a modern CMS over an older one.
  • Robust sitewide content indexing and search capabilities.
  • Robust custom fields for full control over your design and content.
  • Nearly all content is in one place: Entries. Editors love this and can easily find what they’re looking for.
  • Fine-grained user permissions and group management allow publishing workflows across different departments and individuals. And no, you don’t need a plugin for this.

Building frontend with Craft CMS using Twig templates

Twig is a template engine for PHP so instead of writing PHP you write in this simple Twig syntax.

Some developers are not keen on this, but Craft uses Twig as its template engine. The word “use” should be highlighted as a requirement, as there is no option of writing raw PHP anywhere inside the template.

It is standardized in a way that, when you look at your team’s Pull Requests, you probably don’t expect to see 100 lines of custom PHP that make no sense. You only see the code related to templates.

Apart from this, Twig makes it easy to “component-ize” your elements. This way you define the markup and layout for a component once, then reuse it throughout your site and pass variables.

You can define components for different content modules like image left, image right, headings, cards, etc. This ensures you’re consistent, reuse the same components throughout the site, and reduce duplicate code.

image code

Here’s how to use GraphQL + Craft CMS as a ​“head­less” CMS

Let’s say you’re not digging Twig or you would rather use one of the latest technologies (hello static site generators!). Craft’s templating system isn’t the only way to get content out of Craft. As of Craft 3.3, it provides a “headless” mode and GraphQL built-in with Craft’s Pro features.

That means you can use tools like Gatsby or Gridsome to build static sites with the comfort of Craft CMS. That brings Craft in line with the likes of WordPress that provides its REST API for fetching content to use somewhere else.

As a web devel­op­er, you’d use GraphQL if you were writ­ing a fron­tend that is sep­a­rate from the back­end. You’d be using Craft CMS as a ​“head­less” CMS for its excel­lent con­tent author­ing experience.

Per­haps you’re writ­ing the fron­tend in a frame­work like Svelte, Vue.js, React, or one of the frame­works that lay­ers on top of them like Grid­some, Gats­by, Nuxt.js, or Next.js. You could write a cus­tom API for Craft CMS using the Ele­ment API, but that can be a sig­nif­i­cant amount of work, and you’ll end up with some­thing bou­tique, rather than an indus­try standard.

This is where GraphQL for Craft CMS excels. By cre­at­ing your con­tent mod­els in Craft CMS, you auto­mat­i­cal­ly get a GraphQL API to access it, with no extra work on your part.

Conclusion

Craft abstracts all the field creation and setup to the admin panel. You only need to point it to the right Twig template and then use the fields you connected. Furthermore, it provides localization and multi-site management out of the box with no need for plugins.

The bottom line is Craft is an open-source, modern, affordable CMS with stellar security and first-party support. The features and flexibility it offers out of the box, along with its content-first approach, make it go-to for nearly every custom web project.

About Galaxy Weblinks:

We are your offshore CMS development partner! We offer expert capabilities in developing feature-rich solutions using the latest CMS technology trends. We have hands-on experience in CMS solutions like Craft, WordPress, Drupal for different business needs. We offer assistance from building custom CMS websites to website migration and maintenance processes.

How to Choose the Right Shopify Development Partner?

Ecommerce has been growing at a swift pace along with the several platforms such as Shopify over which these websites are built. Building your company’s online Shopify store is similar to building your new house and choosing the right Shopify development company is very crucial. There are a lot of moving parts to analyze, design, plan and set up. While setting up a Shopify store is easy, but making sure that your visitors have a good user experience is crucial for the success of your Ecommerce website. This is where the right Shopify development team can understand your requirements and help your business grow. In this article, we discuss the need for a Shopify development team and highlight a few important considerations that will help you make the right selection.

Why should you hire a Shopify development team?

Once you have decided to develop an Ecommerce website, there are plenty of things for you to worry about including getting your product-market fit right, sourcing products, managing inventory, preparing a marketing strategy, etc. Developing a Shopify platform and adding it to your list of priority things takes your crucial time away from the other important considerations that are needed to grow your business. This is where an expert Shopify development team helps you free up your time while handling the development aspects of your ecommerce website. We have listed below a few considerations why there is a need for a Shopify development team.
  • Saves your time so that you can focus on your core business objectives
  • Helps you with customized Shopify design and development for your Ecommerce website
  • Has relevant technical expertise working with CRMs, API integration, SEO optimization, page speed optimization, inventory management, email marketing solutions, etc.
  • Saves you cost if outsourced in comparison to building an in-house team
  • Helps you focus on building the right Ecommerce website that targets your business objectives such as increasing sales, maximizing conversions, enhancing user experience, etc.

How to choose the right Shopify development partner?

Once you have decided to hire a Shopify development team, the key considerations in selecting the right partner are –
  • Alignment
The Shopify development vendor should understand your business requirements, help focus on priorities, advice from a technical perspective, and execute work efficiently.
  • Expertise 
It is crucial that your Shopify development team has in-depth knowledge of the Shopify platform and its versions. The team should have required programming skill sets, have experience working with APIs integration, have expertise in building and integrating custom Shopify apps and themes, deep knowledge of database technologies for storage and information management, etc. A good approach to evaluate their expertise is to ask about a few of their Shopify project portfolio and speak to a few of their references.
  • Best Practices
A gap in understanding of the requirements can cause the complete failure of your project. Hence, it is important that the Shopify development company follows best industry practices across communications, execution, documentation, budgeting, quality assurance, security, etc. Project management methods can vary greatly between companies and for a successful engagement with a company, it is crucial that they follow a process that is organised, consistent, and supports quality control. For offshore partners, good communications is a must to understand requirements correctly and efficiently coordinate for smooth and timely execution. In order to better understand their best practices, you should discuss your project needs and evaluate how they plan to execute the development process.
  • Pricing
Cheapest isn’t the best option while selecting a Shopify development vendor, so always look at the bigger picture. Never pick a vendor purely on the basis of their rate. Rather look at the approach they came to the pricing. The best way is to review a few proposals and compare the project plans and time estimates for each phase. Understand the no. of hours, resources each vendor is proposing, and then compare their total costs. Additionally, most vendors provide support/maintenance services, and their pricing can vary. Look at the monthly support hours each vendor is proposing and at what cost. The company should handle all crucial issues for you such as version upgrades, security patch installations, bug fixing, design updates, customization, plugin integrations, performance enhancements, etc.

Conclusion

Running a successful Shopify Ecommerce website in today’s highly competitive online environment requires a good development partner who understands your business requirements and provides a helping hand in realizing your company’s vision, achieving your growth plans and having a great user experience. If you’ve any doubts related to Ecommerce platforms and if you need assistance developing one, then feel free to talk to us here.

A lowdown of PHP 8.0 update

The latest major update in PHP 8 has been made available to the public. It’s a typical three-year cycle version upgrade of PHP. Comes with a few radical alterations, so there’s a high chance you’ll need to make a few changes in code before upgrading. Some of the major features and optimizations introduced in this update are named arguments, union types, attributes, constructor property promotion, match expression, nullsafe operator, JIT, and improvements in the type system, error handling, and consistency. Here’s a lowdown of the official update announcement:

PHP 8 Named arguments

// PHP 7 htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, ‘UTF-8’, false); // PHP 8 // Specify only required parameters, skipping optional ones. // Arguments are order-independent and self-documented. htmlspecialchars($string, double_encode: false);

PHP 8 Attributes

Instead of PHPDoc annotations, you can now use structured metadata with PHP’s native syntax. // PHP 7 class PostsController { /** * @Route(“/api/posts/{id}”, methods={“GET”}) */ public function get($id) { /* … */ } } // PHP 8 class PostsController { #[Route(“/api/posts/{id}”, methods: [“GET”])] public function get($id) { /* … */ } }

PHP 8 Constructor property promotion

Less boilerplate code to define and initialize properties. // PHP 7 class Point { public float $x; public float $y; public float $z; public function __construct( float $x = 0.0, float $y = 0.0, float $z = 0.0, ) { $this->x = $x; $this->y = $y; $this->z = $z; } } // PHP 8 class Point { public function __construct( public float $x = 0.0, public float $y = 0.0, public float $z = 0.0, ) {} }

PHP 8 Union types

Instead of PHPDoc annotations for a combination of types, you can use native union type declarations that are validated at runtime. // PHP 7 class Number { /** @var int|float */ private $number; /** * @param float|int $number */ public function __construct($number) { $this->number = $number; } } new Number(‘NaN’); // Ok // PHP 8 class Number { public function __construct( private int|float $number ) {} } new Number(‘NaN’); // TypeError

PHP 8 Nullsafe operator

In the latest version you can use a chain of calls with the new nullsafe operator instead if null check conditions. In case of chain failure, the execution of the entire chain aborts, and the entire chain evaluates to null. // PHP 7 $country =  null; if ($session !== null) { $user = $session->user; if ($user !== null) { $address = $user->getAddress(); if ($address !== null) { $country = $address->country; } } } // PHP 8 $country = $session?->user?->getAddress()?->country;

PHP 8 Match expression

The new match is similar to switch and has the following features: Match is an expression, meaning its result can be stored in a variable or returned. Match branches only support single-line expressions and do not need a break; statement. Match does strict comparisons. // PHP 7 switch (8.0) { case ‘8.0’: $result = “Oh no!”; break; case 8.0: $result = “This is what I expected”; break; } echo $result; //> Oh no! // PHP 8 echo match (8.0) { ‘8.0’ => “Oh no!”, 8.0 => “This is what I expected”, }; //> This is what I expected Since the update has breaking changes, it’s advisable to have experts help you with the migration to avoid any unexpected downtime. We have a team of experts that’s well versed in PHP. Get in touch with us here if you’re looking for a quick and hassle-free upgrade.