#SEO for ecommerce in Nigeria
Explore tagged Tumblr posts
victorwinnersdotcom · 23 days ago
Text
How to Set up SEO for eCommerce Websites: The 9 Step Guide
After building your ecommerce website, the next thing that comes to your mind is to drive visibility and website traffic so you can make sales but there’s a high chance you’ll not make sales without setting up SEO for. As an ecommerce company, if you want to experience steady visibility, earn consistent traffic and make increasing sales, one of the biggest steps you need to take after setting up…
0 notes
genrosystechnologies-blog · 5 years ago
Link
Genrosys Technologies offers creative services for all businesses such as logo design,banner design, email design, visiting card design, brochure desiging, we have our team of graphic designers, Ui/UX designers, creative designers, creative logo designers,  we are known as the best in logo designs,branding for small and medium businesses. our creative graphic designers are highly skilled and creative in UI/UX design, coding, graphic design. To know more  about our services call us at 91-8588861588 or +234-8184490704.
1 note · View note
techkow-blog · 4 years ago
Text
SEO Posts April
Cryptocurrency  Fundamentals: What Is Cryptocurrency And How It Works?  30 Best Web & Software Development Companies of India  30 Best Web & Software Development Companies of UK  30 Best Web &  Software Development Companies of USA  36 Best SEO  Companies in Chile  40 Best SEO  Companies in Nigeria  50 Best SEO  Companies in Hungary  50 Best SEO  Companies in Netherlands  49 Best SEO Companies in Finland  26 Best SEO Companies in Norway  50 Best SEO  Companies in Sweden  4 Things Digital Sports Marketers Need for Successful  Campaigns  7 Highly Successful  Research Backed Web Design Strategies  The Ultimate Guide of How to Financing for Electronics  Using Facebook for  Business: What You Need to Know to Succeed  45 Best SEO  Companies in Russia  What Are The Core Skills Of An SEO Expert?  Top Reasons To Have A Mobile Application For Business In  2021  7 TOOLS FOR CONTENT  MARKETING  30 Best Hotel Flight  Booking Sites  Top 10 Cryptocurrencies Trading Apps  TOP 10 PLAYSTATON5  GAMES  TOP 10 XBOX SERIES X  GAMES  A NEW WAY TO GET  MORE TRAFFIC FROM LINKEDIN  75 Link Building  Techniques Checklist  Different Kinds of  Folding Brochures In The Marketing Strategy  What is Happening to  Free Anime Platforms? Latest News & Updates  10 Brilliant Push Notification Ideas for Your eCommerce  App  Handy Tips for Car  Buying in Dubai  Top 5 Best Methods  Of Statistics For Data Analysis  Is Investing in Bitcoin and another Cryptocurrency a  smart option in 2021?  How Management  System of The Gym Helps You in Success?  Things You Need To Know About SEO  5 Social Media Marketing Mistakes You Need To Avoid  Making Right Now  Unity 3D 2021 what's  new and how it can boost business  How 9 Extraordinary  Merits of Spa Appointment Software Can Change the Destiny of the Spa?  30 Best PPC  Companies of USA  30 Best PPC  Companies of UK
0 notes
erpcall-blog · 4 years ago
Text
5 best online life procedures for any business achievement
Compelling brand introduction and client commitment are fundamental components for any fruitful business.
Furthermore, web-based social networking stages are an extraordinary chance to grow your key messages and online nearness.
Does your business have social records, and in the event that you do, would they say they are truly working for you? Want help in business exposure ERPcall server website for industry-specific with lots of research and analysis to get more leads through the website. We best website development company in India maximally leveraging cloud services to accelerate the development process. Get the best HTML or WordPress, Divi & template-based website from the Web Design and development company.
Here are some top online life procedures that will help you as you manufacture your important image.
1. Evaluate social stages
Each online life stage has an alternate group of spectators and reason. A broadly utilized stage could possibly be the best choice for your business to draw in your intended interest group. Solid internet based life commitment is essential to keep up your image voice.
Ponder your intended interest group and which online networking channels they utilize frequently. Think about these principle stages:
Facebook ( www.facebook.com) is a decent device on the off chance that you are hoping to construct brand mindfulness and connect legitimately with your clients through advancements. This social stage is enormous and persuasive.
Instagram ( www.instagram.com) comprises of pictures and recordings with a little duplicate. This is a solid match for brands with solid visuals and for organizations that need to draw in youthful grown-ups.
Pinterest ( www.pinterest.com) is extremely prominent with ladies and furthermore exceptionally visual. In the event that you have incredible items to show, this stage may work for you.
LinkedIn ( www.linkedin.com) is an expert interpersonal interaction site that would be ideal for organizations that need to draw in with corporate influencers and spotlight more on industry substance and themes.
2. Specialty quality, drawing in content
Pulling in and beguiling a client is vigorously subject to quality substance, commitment, and spellbinding visuals. Continue creating new internet-based life posts and substances that will draw in watchers.
Online life continually changes, so monitor all-new stage refreshes so your organization can keep your substance crisp and important. Through Facebook calculations, boundless character size in Twitter’s immediate messages, and Instagram’s inclining content tab, there are unlimited chances to draw in new watchers.
Be genuine when making substance and post applicable substance for your watchers. On the off chance that your watchers react well to recordings, proceed toward that path with a substance blend, so content isn’t different.
Try not to be hesitant to take a stab at something new.
3. Construct a network
Make an enticing situation where individuals need to share their very own accounts and associate with your image. Pose drawing in inquiries and react in an opportune way to client requests or protests on your records.
This proactive system will help fabricate positive connections and improve validity for your image.
Screen discussions around any as of late distributed substance. On the off chance that you join a current discussion by utilizing a slanting hashtag, ensure you comprehend why the hashtag is being utilized.
Watch for a negative assessment appended to a hashtag and guarantee the discussion bodes well for you to join. Require some serious energy and reconsider before bouncing in and posting.
4. Track your social nearness
Try not to figure the most ideal approach to follow your image’s web-based life nearness. Investigation devices are significant for enabling you to screen your web-based life destinations and report on your triumphs and choose what regions to improve.
In case you’re simply beginning with following social execution, there are essential announcing highlights incorporated with certain stages – and you can generally buy a membership for a progressively definite examination device. A few devices enable you to screen how regularly individuals are discussing your image and if the notices are sure or negative.
Examination apparatuses can likewise help distinguish potential emergencies for your business or industry.
A few instruments even let you watch contender web based life nearness. Screen contenders, as well. You can gain from their triumphs and botched chances.
5. Continue learning
New web-based life stages and patterns are distinguished normally. Remain over web-based life patterns and stage refreshes by understanding online journals and news outlets that offer experiences and tips. Perceive patterns and discussions that are important to your business to enable your organization to recognize better approaches to draw in online clients.
Recognize what your objectives are for your web-based life nearness at that point decide the most ideal approach to gauge the outcomes. For independent companies, a great many devotees may not be sooner rather than later, yet look past the numbers. Take a gander at the nature of your connections with your online networks and their criticism of your social substance.
Your online life channels ought to support two-way discussions. Become more acquainted with your clients and online crowds so you keep on delivering an important substance, not simply attempts to sell something. On the off chance that you believe you don’t have the skill or time to do this well, locate a believed colleague to make your objective achievement.Serve your customers online. We are in your City. ERPcaLL offers custom website designing and development for any business or individuals. Take your business online with ERPcaLL. We Websitedevelopment company in India are offering low cost for website with free on Page SEO. We cover pan India, Middle East & Africa. Forget about code. Website development company in Nigeria Just drag & drop business features, Get all your business needs, out-of-the-box.Make a website, then add features as you grow: jobs, eCommerce, customer portal, events, company blog, call-to-action, newsletter, etc.
0 notes
olxnigeria · 5 years ago
Link
Tumblr media
ECommergy is a website for ecommerce and enterpreures. Contains "best of the best" articles, videos and audios curated by ecommerc experts. Exclusive articles and other contents, with new content added daily. Exclusive forum with onsite expert for free consultation. Variety of tools and features for organizing and managing your favorite contents. https://bit.ly/39KiEE4 via Latest listings added - Olx nigeria ong - Buy and Sell Online Free classified website
0 notes
leadwebpraxis · 5 years ago
Photo
Tumblr media
We create world-class online stores with varieties of features and functionalities. Over time, we have been able to build a lot of astonishingly beautiful eCommerce #websites with premium efficiency for our clients. For more info visit https://leadwebpraxis.com or call +2349039983860, let's discuss your #project. #Web #Media #Lead #Leadwebpraxis #Markertingstrategy #SEO #businessopportunities #leadwebpraxismedia #FinTech #Appdeveloper #Digitalmarketing #digitalmarketingAgency #Businesses #entrepreneurwoman #entrepreneur #smallbusiness #smallbusinessowner #nigeria #africa #lagos #abuja #digitalart #digitalmarketingservice #digitalmarketingagencies #service #servicedog #bottleservice https://www.instagram.com/p/B-miWAhjvlp/?igshid=mhrdm2i3yanm
0 notes
fuckyeamia-blog · 5 years ago
Text
Internet marketing terms
Tumblr media
If you use this image in any way, shape or form, please give credit to: joshmacdonald.net
Tags: search engine optimization tips companies definition tools for dummies jobs basics techniques services pricing (seo) google training salary wordpress software strategies course 2015 articles an hour a day agency austin atlanta all-in-one analyst analysis amazon audit and social media analytics marketing pdf algorithms advantages advertising job description pay-per-click books best practices blog benefits boston business blogger banner backlinks bible by black hat beginners tutorial ppt cost classes certification career consultant checker company reviews conference coursera cincinnati crash online checklist cheat sheet case studies code new york degree dallas diy defined denver domain name dubai delhi do it yourself disadvantages diagram doc drupal duties duplicate content database driven websites download examples etsy experts education explained ebook ethics expert free earn money en español effectiveness executive elements essay francais ebay edmonton ecommerce small firm facts blogs website lawyers non profits youtube musicians local postings godaddy goals greenville sc adwords generator webmaster goa getting started 2010 (2010) sites guaranteed results how to html help works hubspot history html5 headlines higher hong kong hyderabad h1 guide much does hotels hawaii hamilton harold davis images icon in spanish inc is india infographic internship importance industry the process of quizlet interview questions issues iis investopedia sharepoint 2013 worth sentence journal javascript joomla work from home openings chennai pune mumbai nagpur canada 3 bangalore kansas city keyword tool knowledge research keywords key points kenya kolkata kristopher b jones kpi factors kuwait kerala kitchener keys kaskus los angeles linkedin learning lessons london logo là gì lynda list law limitations lecture notes link building latest trends las vegas links land long island legal monmouth county nj manager meta tags miami methods texas moz metrics metadata music muse strategy minnesota make meaning urdu hindi news note managers orleans nyc nedir newsletter ny nz natural .net noida north carolina zealand jersey nh nottingham orlando on resume overview ottawa page objectives or seo opencart flipkart off organic program plan packages plugin proposal photography pay per click price principles presentation pros cons podcast purpose pagerank quotes queries quora quiz qualifications questionnaire answers quotation quick quebec qatar quicksprout format freshers report ranking reddit raleigh real estate richmond va rules roi papers promotion requirements resources rates registration recruiting rails starter specialist squarespace san diego seattle sacramento statistics school scams shopify secrets steps test terms tactics tricks tampa toolkit udemy url using genetic algorithm uae updates php uses usa upwork redirects utah university user usage java video vancouver wa vs tutorials victoria bc vendors virginia vector visual value vietnam wiki wix words weebly writing white paper web design what why important site word w3schools with example sitemap xml xara webplus x6 x5 yahoo your blueprint effective internet yellow pages yandex bing you gotta use zen cart zenfolio zazzle search-engine-optimization-starter-guide-zh-cn.pdf search-engine-optimization-starter-guide-zh-cn zh tw 2012 2014 photographers handmade jewelry blogspot bangla basic seo-tips-search-engine-optimization.blogspot copywriting matt cutts dan trik easy facebook top 10 pinterest image improve 101 simple ten uk nigeria philippines melbourne sri lanka south africa pakistan agreement ahmedabad australia baltimore chicago california charlotte nc consulting columbus ohio financial houston michigan jaipur singapore johannesburg maryland provider philadelphia ranked rated toronto us that english define wikipedia programs ca submitter submit adalah all one 2nd edition abstract asp.net book 7 dreamweaver documentation dynamic directory employment explanation forum 5th freelance features peter kent indianapolis information introduction ieee c# jacksonville profile optimization/ksp literature review louisville landing malaysia montreal made market size minneapolis magento milwaukee manchester nashville odesk answer objective project poisoning reseller rochester robots.txt seminar versus vadodara validator webinar westchester workshop videos adobe bruce clay susan esparza banks baidu bands b2b churches chiropractors contractors wordpress.com colleges 4th dentists doctors designers automotive dealers flash advisors firms accounting hire hospitals iweb 2.5 my mobile newspapers 3rd second press releases physicians restaurants realtors retail travel twitter tumblr traffic universities writers saudi arabia bhopal bhubaneswar chandigarh coimbatore cochin ncr entry level gurgaon indore karachi leeds lahore part time related sales writer 1 utilization method advanced practiced organizations study four applying increase visibility various blackhat bad 2.0 two ethical used good semantic (ieee 2013) seven illegal lucene learn types 2011 are website’s service affordable about bangladesh surat average comparison costs take monthly month plans winnipeg means which practice mindset apa itu engines video2brain – (6.45 mb pdf) danny dover campaign florida google’s’ document optimize jumpstart
Posted by JoshMacDonald on 2016-01-17 17:43:22
Tagged: , internet , marketing , business , blogging , seo , search , engine , optimization
The post Internet marketing terms appeared first on Good Info.
1 note · View note
pebblesdigitals-blog · 5 years ago
Photo
Tumblr media
Designed an interactive E-Commerce shopping platform for Elins Nigeria,providing them with an online presence to help thier customers book and request their services and products with an integrated payment system. Every business : Every One Needs a website!!! Worry no more! Search no further... Pebbles Digitals is here... Call/Whatsapp for free quote 08100307007 #pebbles #digitals #pebblesdigitals #webdesign #graphicdesign #website #webdevelopment #webdesigner #marketing #socialmedia #digitalmarketing #branding #websitedesign #webdeveloper #ui #web #ux #seo #uidesign #business #wordpress #designer #socialmediamarketing #creative #html #programming #css #ecommerce #coding https://www.instagram.com/p/B06SYAZgmNJ/?igshid=6iz2ru0ypkg
0 notes
mmoinstituteguru-blog · 5 years ago
Text
How to Start Affiliate Marketing in 3 Basic Steps (Beginners Guide)
How to Start Affiliate Marketing - Starting affiliate marketing is a great business idea for smart entrepreneurs. As an internet marketer, affiliate marketing has not just become one of my best sources of income but has also been one of the most powerful life-changing career choices I have ever made. In this age of entrepreneurship, people wake up each day with great business ideas, such include, starting a blog, creating an online store (eCommerce), drop shipping, as well, affiliate marketing, these are great business ideas, and of course the most lucrative business ideas for smart entrepreneurs like you.
Tumblr media
How to Start Affiliate Marketing in 3 Basic Steps (Beginners Guide) Here, I am going to provide you with all the necessary information you need to know about Affiliate Marketing, What is Affiliate Marketing, How to Start Affiliate Marketing, Why you should Start Affiliate Marketing, Things to Consider Before Joining Affiliate Programs, Tips to Promoting Affiliate Products, and How to Get Paid as an Affiliate Marketer. If you are already an affiliate marketer, then this article will show you how to grow your business, earn a passive income, and become a succesful affiliate marketer. Before we proceed to the next step, how to start affiliate marketing, let me quickly bring to your understanding of what affiliate marketing is in just a few words.
What is Affiliate Marketing?
Affiliate marketing is a form of internet marketing where an affiliate is paid a commission to promote the products and services of a merchant. In affiliate marketing, you are an affiliate if you promote people or companies ‘products to earn a commission. You are a merchant if you have products that affiliates can promote to earn a commission. The people who buy the products are customers. To better understand affiliate marketing, here’s the 5 step process to follow: You search for products/services to promote Know the “product name” affiliate program. Sign up for their affiliate program You get a special link that allows the merchant to track the people who clicked your link If they buy the product, you get a commission. Now, the question is, how can you really start affiliate marketing?
How to Start Affiliate Marketing in 3 Basic Steps (Beginners Guide)
In order to get you started down the right path, here, we focus on three critical steps to launch your own profitable affiliate marketing business easy and fast. 1. Choose a Niche. Choosing a niche for your affiliate marketing business is a great first step. A niche is simply an area of interest. What products do you like to promote? You do not have to mix different products from different niches to a website or an online store. If you want to be selling phones, focus on that, do not add shoes or cosmetic products. Well, there is no rule in selecting a niche, but we are just trying to be moderate. RECOMMENDED READING: How to Start an Online Store in 8 Simple Steps (Beginners Guide) Having a niche, guarantees you to position yourself as an expert and talk to a particular set of audience. The niche you select must be something you are genuinely interested in. A range of products that is not focused will be difficult to market. Some niche example includes Technology, Fashion, Business, Sports, Health, etc. Choose your niche wisely. 2. Build a Blog around the Niche. When you select a niche, the next you have to do is build a blog around the niche. So good, you can promote affiliate products and services without having a blog. However, if you want long term success, having a blog will give you an indispensable advantage. A blog gives you the freedom to connect with your readers, give them helpful information about your offer, and build a subscriber base until they trust you enough to follow your recommendations. You can promote countless products on your blog, even sell your own products/services. Your blog serves as your primary marketing tool, helping you generate more revenue through banner ads and affiliate links. RECOMMENDED READING: How to Start a Blog in 9 Simple Steps (Beginners Guide) 3. Join Affiliate Programs. This is the most important part of starting affiliate marketing. Once you’ve decided on your niche, you will want to find out what is out there to promote in terms of programs and products. Here’s the point, you can pick just about any product you can buy online, and there will be an affiliate program that will pay you the rate of a referrer to refer a sale. However, just because you can promote anything, does not mean you should. The most important thing to consider when selecting a product for the market is "is it relevant to the public?" To avoid promoting unwanted products to your subscribers and losing their trust, be sure to select only effective products. This, you will know by the number of reviews each product gets. There are many ways you can join affiliate programs, either by, using a product’s in-house affiliate program or join using an affiliate network or marketplace such as Amazon, ShareASale, Commission Junction, ImpactRadius, Clickbank, Amazon Associates, Rakuten, Alibaba, Aliexpress, etc.
Things to consider while choosing affiliate programs.
1. Reputation of network/products. Very important. Choosing an affiliate program is not something you should rush to do, you need to check out the reputation of the affiliate network/program as well as their products before you join them. Most of the independent affiliate networks boost of high commissions, but, at the end of the day, they fail to pay you as they promised. And since, most of them have nothing to worry about or lose, they don’t really mind a few bad reviews. So, it’s important you get to understand them very well before you make a step. 2. Payment method. Imagine a situation where you promote a product and people to get to see and buy them, and you earned over a thousand dollars, but you can’t get paid, because there is no acceptable payment method in your country. So heartbreaking. Before you try to promote any affiliate program, ensure to check the payment method supported by the affiliate network or program. If there is no acceptable payment method in your country, you can talk to the affiliate manager or use the contact form and see if they can work you through it. 3. Minimum payout or threshold. This is one reason, most newbie affiliate marketers give up so easily. Unlike traditional ad networks, most affiliate programs pay you when you reach a minimum threshold of $50. If you are under that threshold, you can’t get paid. Most affiliate marketers give up because they can’t reach the threshold to start receiving their payment. They may be working so hard to get here, but still find it hard to get there, they feel like they have been cheated as they won’t get paid for the promotion they have done. The point here is that you should always check the payout of any affiliate programs you choose to join, to avoid crying over been cheated or not getting paid as you’ve exhausted your time and resources. However, you can still make it to the threshold, if you keep up the good work and remain patient.
Here are a few of the reputable affiliate programs you can join
If you have a website related to online marketing, blogs or businesses, there are fortunately many really strong affiliate programs for different services. I wanted to share some of my favorites so you could get an idea of ​​what an affiliate program entails and start having an idea of ​​what might work on your site. Bluehost - Bluehost is a web hosting company. The most affordable and reliable blog hosting provider, used with several websites over the years. The Bluehost affiliate program is one of the most lucrative and highest paying affiliate programs available. RECOMMENDED READING: How to Start a Blog in 9 Simple Steps (Beginners Guide) AliDropship - AliDropship is an eCommerce plugin designed to simplify the drop shipping process. It can be integrated with WordPress and WooCommerce, so, you can easily add a drop shipping item to your current website or eCommerce store. The AliDropship affiliate program is completely free and anyone can sign up. Once registered, you can start earning high commissions with minimal effort! RECOMMENDED READING: How to Start Dropshipping Business in 4 Simple Steps (Beginners Guide). BeRush – This is the affiliate program for the SEO research tool SEMrush. I use this religiously on my blog, and their affiliate program gives you all the resources you need and pays a recurring fee of 40%! Good luck finding anything that compares with that. RECOMMENDED: Master SEO with SEMRush Jumia - Jumia, Nigeria's No.1 online shopping platform with the largest collection of fashions, electronics, smartphones, groceries, computers, books and many more. Their affiliate program is excellent, easy to start and fast to make money.
How to promote affiliate products.
Becoming a successful affiliate marketer is not as easy as signing up for an affiliate program. It requires a well-thought, effective strategies, especially, when it has to do with promoting affiliate products. Affiliate marketing is rewarding to anyone who is in the business provided they know what to do, but for those who are new to the business, it would seem a really hard-to-break. However, you don’t have to worry. My mission here is to help you out with the best I know. So, if you are planning to embark on affiliate marketing, then, I am so delighted to share with you these helpful tips and techniques to assist you in promoting affiliate products online. 1. Blogging. Blogging is nothing more than a personal opinion of the author on any subject. There are several blog sites that offer free hosting of opinions and which have the readability of millions of readers. If you are a creative writer, writing an attractive blog about a product is a rewarding job. RECOMMENDED READING: How to Start a Blog in 9 Simple Steps (Beginners Guide) You can attract readers with constant and original content, build their trust, and then post a product on your blog that will really be beneficial to the reader and earn a commission if readers use your blog as a link to purchase the product. When writing content, you must be able to understand the dynamics of the product. Content must be presented in such a way that a layperson can understand and buy the product.  2. Search engine optimization (SEO). SEO is a marketing discipline focused on increasing the visibility of the results of organic search engines. This covers the technical and creative elements needed to improve rankings, drive traffic and increase awareness in search engines. RECOMMENDED: Master SEO with SEMRush Each search engine gives a result based on certain keywords or key phrases of the search query typed in the box, and the most relevant result arrives at the top. You are to write content with a rich mix of keywords and phrases that will improve the chances of your site being at the top of the suggested results. 3. Social media marketing. As more and more businesses turn to social media to drive sales, the need for social media marketers has never been greater. Now, companies use social networks, like Facebook, Instagram, Twitter, LinkedIn, Pinterest, and others to connect with current and potential clients. Marketing has always been about connecting with your audience in the right place at the right time. Today, this means that you have to meet them where they already spend their time: on social media. You can also share a post on social media about how to start a blog and make money blogging to attract more views and take advantage of them for product advertising. In addition, most social networks have their own data analytics tools that make it easy to create and promote social media marketing campaigns. Due to the continuous dissemination of social media discussions, there would be an immediate notifiable product and it would also be shared on other platforms, which would help to publicize the product, there you can generate leads and drive sales. 4. Email marketing. Offer your visitors a chance to become one of your email subscribers. This is a marketing strategy, where an advertiser sends an email to the recipient detailing the products and offers available. It's a blend of graphical content with links that provide the customer with easy purchase and information. It has the potential to reach millions of clients with a click. Offer your subscribers some freebies, promos, and discount as an incentive for signing up. Keep your emails interesting: ask for your clients' opinions often, including reviews. Respond quickly to problems of customer service and product quality, and work on building relationships. No sales interaction is about the first sale; Focus on the next one always. Here are some examples of email marketing tools that you can try 1. Contact form 2. Drip 3. SendiBlue 4. ConvertKit 5. Aweber 6. GetResponse 7. Mailchimp 5. Use Banners Ads Banner ads are basically used to attract visitors and drive traffic, and their main objective is simple: To be appealing to visitors, so they feel like clicking the banner, which is usually a specific promotion, such as an offer. Placing banner ads on your website is one of the most remarkable and easiest ways, you can use to promote your affiliate programs/products effectively.
How to get paid as an affiliate marketer
Affiliate marketers can get paid in different ways, based on different performance factors. The three most common ways to earn money through affiliate marketing are: Pay per sale: This is a commission-based payment method where you earn a set commission based on each sale that comes from a referral visitor from your website. The more sales you generate for the merchant, the more money you make. Pay per lead: Merchants pay you each time you bring a lead to the company. This method is used when a user signs up for a program of some sort - a trial, demo, newsletter, etc. Pay per click: Click-through affiliate marketing pays you each time a visitor clicks on the merchant’s ad that’s on your blog. However, not each click converts to a sale and can become quite expensive, so the pay-per-click method is rarely offered by merchants. Most affiliate networks will pay you when you reach a certain threshold, usually $100. There are several payment methods available. They include PayPal, direct bank deposit, checks, and Payoneer. If you cannot get a PayPal account and you live in a country where the deposit or direct bank checks can be a problem, then Payoneer is the next best option.
Why you should start affiliate marketing
By now, how to start affiliate marketing shouldn’t be a question anymore. But, why do you have to start affiliate marketing, even as we speak? 1. Little or no cost to join 2. No need to create products or services 3. You don’t have to stock or ship products 4. You can work anywhere, anytime as long as you have internet access. 5. You earn passive income, depending on how you market your affiliates programs 6. You earn professional independence 7. No need to employ huge sales staff 8. You are selling what you want 9. The most profitable career choices of most potential bloggers, like Pat Flynn of smartpassiveincome.com 10. It is one of the easiest ways to make money online. No doubt, with these reasons, I am are sure you will agree with me that starting an affiliate marketing business is not just a common suggestion, but a great business idea.
How to become a successful affiliate marketer
The secret success of affiliate marketing is not limited to hard work, consistency, but using the right affiliate marketing strategies, understanding the various traffic generation tips, and also targeting commercial value keywords. With these, the sky is just your starting point.
I hope this guide proves immensely to you.
Do you have any more questions to ask or would you like to make a reasonable contribution that will be useful to our readers? Please talk to us in the comment box below and we would be delighted to welcome your sincere contribution. If you find that this post is useful enough to start affiliate marketing, do not forget to share with your friends using the share buttons below. Read the full article
0 notes
spreadwebng-blog · 7 years ago
Photo
Tumblr media
At spreadweb we makes it easy for you to create a website and grow your business online with ecommerce and SEO solutions all in one place. #spreadweb #lagoswebsite #lagos #web #website #seo #ecommerce #business #oline #grow #webdesign #webpath #top #open #getwebsite #brand #logo #share #tags #trending #topwebinlagos #Nigeria #Friday #webclients
0 notes
laurelkrugerr · 5 years ago
Text
Building A Web App With Headless CMS And React
About The Author
Blessing Krofegha is a Software Engineer Based in Lagos Nigeria, with a burning desire to contribute to making the web awesome for all, by writing and building … More about Blessing …
This article introduces the concept of the headless CMS, a backend-only content management system that allows developers to create, store, manage and publish the content over an API. It gives developers the power to quickly build excellent user experiences, free from the worry of its impact on the back-end business logic.
In this tutorial, you’ll learn what Headless CMS is, and the pros and cons of Headless CMS. In the end, youll have built a shopping cart using GraphCMS (a (backend-only content management system). After that, you can go ahead and build any web app of your choice using a headless CMS and React.
To follow along, you need to have Node and npm/yarn installed on your machine. If you do not have that done already, follow these quick guides to install yarn or npm on your machine. You also need to have a basic understanding of React, Node.js and GraphQL queries. (You can always brush up on React and GraphQL skills, of course!)
As digital products continue to evolve, so does the content we consume. A scalable, cross-platform content management system is crucial to ensuring a product’s growth velocity. Traditional CMS gives the comfort of having the content, the editing interface, templates and custom codes, in a single environment. But with the changes in this mobile era, that’s no longer enough. We need a new breed of CMS — one that can make content available through any channel at which point a Headless CMS is required. A headless CMS gives you the benefits of managing the content and delivering it to any channel. The API makes contents available through any channel and on any device using most favorite tools and programming languages plus it also provides a higher level of security and much better scalability.
What Does This Look Like In Practice?
What happens when you take away the frontend of a CMS? The biggest distinction is that a website can’t be built with a headless CMS on its own. With a traditional CMS, everything happens in the same place.
A headless CMS doesn’t have the features that let you build your site — it doesn’t have site themes or templates. To use a headless CMS, you have to build a site or app, or other experience first, then use the CMS’s API to plug your content into it.
Why Should You Care About Headless?
A headless CMS comes with an API friendly approach, which makes it possible to publish content through an API (either RESTful or GraphQL). It allows you to use the same API to deliver content across various channels such as Android or IOS apps, smartwatches, AR/VR, etc. A headless CMS gives developers the ability to harness creativity quickly. With a traditional CMS, changes can be time-consuming, for example, to tweak a part of your site, you need to re-implement the entire CMS. With a headless CMS, you can make changes to your frontend without having any impact on the back-end infrastructure, hence saving yourself time and resources, which makes it much better.
Traditional vs Headless CMS: The Pros And Cons
It can be complicated to choose between a headless and a traditional CMS. The fact is, they both have potential advantages and drawbacks.
Traditional CMS Pros
It allows for easy customization. A lot of them have drag and drop, this makes it easy for a person without programming experience to work seamlessly with them.
It’s easier to set up your content on a traditional CMS as everything you need (content management, design, etc) are already available.
Traditional CMS Cons
The coupled front-end and back-end results in more time and money for maintenance and customization.
Traditional CMS e.g WordPress relies heavily on plugins and themes which may contain malicious codes or bugs and slow the speed of the website or blog. Here’s a list of 18,305 vulnerable WordPress plugins, themes. Here are security measures for Drupal developers. Check here for more facts.
Headless CMS Pros
Since the frontend and backend are separated from each other, it makes it possible for you to pick which front-end technology suits your needs. This also gives the developer flexibility during the development stage.
Platforms (blogs, websites, etc) built with headless CMS can be deployed to work on various displays such as web, mobile, AR/VR, and so on.
Headless CMS Cons
They give you the hassle of managing back-end infrastructures, setting up the presentation component of your site, app.
They can be more costly to implement — the cost involved in building a user-friendly platform with analytics is high when compared to using traditional CMS.
Best Use Cases For Headless CMS
Headless CMS can have the following use cases:
Static Site Generators (e.g. Gridsome, Gatsby)
Many Jamstack sites created with static site generators like Gridsome, Hugo or Gatsby make use of the headless CMS to manage content, they cannot access a database, Hence content can be stored in a headless CMS and fetched through an API during build time and deployed as static files.
Mobile Apps (iOS, Android)
The advantage of a headless CMS for mobile engineers is that the API enables them to deliver content to an IOS/Android app from the same backend that manages content for their web site, which keeps things in sync.
Web Applications
This approach involves serving content through an API which is then consumed by a web application but offers a centralized place for managing content. An example is an e-commerce application built using HTML, CSS, and JavaScript with content and product data that are maintained in the CMS and served via an external API.
Types Of Headless CMS
There is a list of headless CMSs you might what to check out.
Please note that this article is not written to promote any services or products.
Contentful An API-driven headless CMS designed to create, manage and distribute content to any platform. Unlike a traditional CMS, they offer the ability to create your content model so that you can decide what type of content you want to manage.
GraphCMS A headless CMS for users who want to build a GraphQL content infrastructure for their digital products. This CMS is fully built as API focused from the ground up, allowing creators to define the structures, permissions, and relations for the API parameters. In this article, we’d be using GraphCMS because of its GraphQL API approach.
ButterCMS A CMS that gives complete freedom to build a website or a branded blog with full SEO Company and supports any tech stack. This tool saves you money and the time for site development time. Butter CMS is a maintenance-free headless CMS tool and can integrate with any language or framework. The powerful interface helps you define and customize every element of your website without any hassle.
Directus An open-source tool that wraps custom SQL databases with a dynamic API and provides an intuitive admin app for managing its content. Self-host for free, or use the on-demand Cloud service to manage all your omnichannel digital experiences.
Sanity Another API driven platform for managing structured content. With Sanity, you can manage your text, images, and other media with APIs. You can also use the open-source single page application Sanity Studio to quickly set up an editing environment that you can customize.
Agility A JAMStack focused Headless CMS with Page Management built-in. Faster to build, manage, and deploy. Agility CMS is a Content-First Headless CMS, allowing you to choose any programming language while also getting the flexibility, speed, and power that comes from lightweight APIs. From there, add features like Page Management, Ecommerce, Online Ticketing, and Search. Agility CMS becomes a complete Digital Experience Platform–saving time, removing limitations and allowing for seamless experiences across all digital channels.
Netlify CMS A free and open-source, git-based CMS created by Netlify. It allows you to define your content model, integrates third-party authentication and extends the capabilities of its backend (a single-page app built on React).
Note: All of the examples mentioned above have free and paid versions, except Directus and Netlify CMS which are free. For a list of more headless CMS, check here.
In this article, we’re using GraphCMS — a GraphqQL API-oriented headless content management system that takes care of our back-end architecture.
Using GraphCMS
Content is both dynamic and multi-channeled, however current content management systems (CMS) lack the flexibility to meet the demands of modern-day digital content distribution. GraphCMS is the first HeadlessCMS built around GraphQL and offers a solution to this problem with its mission to facilitate painless content flow between content creators, developers, and consumers.
GraphCMS accept almost any kind of data you can imagine ranging from images, maps, etc. It even makes roles and permissions easy. While other headless CMS solutions exist, GraphCMS aims to provide a hassle-free experience for developers; through leveraging an API specification called GraphQL. It eliminates the need for multiple SDKs to interact with content delivery and provides simple multi-channel content accessibility. It makes creating rich content apps very easy.
GraphCMS And GraphQL
GraphCMS sorely relies on GraphQL, its backbone API specification. GraphQL is API query language and runtime. It was developed by Facebook in 2012 and released open-sourced in 2015. Since then, the likes of Pinterest, Github, Twitter, Intuit, Coursera have all adopted GraphQL to power their mobile apps, websites, and APIs. GraphQL is similar to REST in its core purpose of providing a specification for building and utilizing APIs. However, unofficially dubbed “REST 2.0”, GraphQL has optimized different key functionality offered by REST.
The main uniqueness of GraphQL includes protocol-agnostic usage, controlled data fetching, editable fields, and types and in-depth error handling. The results include removal of code redundancy, prevention of over and under fetching data, and significant reduction of network requests.
As a concrete example, let’s take the relationship of a query to a newsfeed. A newsfeed post has an author, a title and comments. If we use a REST-based CMS, we would have to make 3 different server requests for these 3 different endpoints, whereas, in a GraphQL based CMS, we would only have to make 1 request for all 3. Consequently, the results offer relatively quicker queries and less network flooding — in a practical use case, it would not just be one entity making multiple requests, but thousands and millions.
GraphQL reduces the complexity of building APIs by abstracting all requests to a single endpoint. Unlike traditional REST APIs, it is declarative; whatever is requested is returned.
GraphCMS has a generous free tier of 1 million API operations requests per month and 500 GB assets traffic. Also, GraphCMS provides a Graphiql admin interface that provides you full access to your data and you could just download it all and then execute a create many mutations against your new backend to migrate everything over.
In this article, we’ll be using the free tier of 1 million API operations per month and 500 GB asset traffic. You can make use of the same tier for testing, for projects that need more than this, do well to check out their pricing page.
Building Our Project
To see the power of Headless CMS using GraphCMS we would be building a simple shopping cart.
Getting Started
To get started with GraphCMS follow the steps.
Create an account on GraphCMS. You can use the free tier.
(Large preview)
At successful signup, you’ll be taken to your dashboard. Click on create a new project.
Click on Create new project. (Large preview)
Ensure you click on create a project from scratch.
Select From Scratch. (Large preview)
Set project details for the project fill in what is in the image below and click create.
Set Project Details. (Large preview)
In our dashboard, we would create our models and content.
Create model. (Large preview)
Select the schema in the sidebar of the dashboard to create a schema.
GraphCMS has an awesome drag and drop UI, that make it easy to seamlessly create schema in minutes.
Drag and Drop fields. (Large preview)
Creating our name field. (Large preview)
Note: Click on the ‘Advance’ tab to select the required option in our fields.
If all went well, you should have our schema looking the image below:
Final Schema fields. (Large preview)
Currently, we have no content. Click on ‘Content’ in the sidebar that should take you the Content section, and click on ‘Create New’.
At this point our we have no content/post. (Large preview)
Let’s add a few contents so we can display them later in our app using React.
Here’s how to add content. (Large preview)
Add a few more content if you desire. Here’s our result.
Our final content. (Large preview)
Next, copy the API endpoint URL (Click on the Dashboard) — this is the single endpoint for communication between our React front end and GraphCMS back end.
(Large preview)
Next, let’s make our API endpoint accessible.
Navigate to Settings Under Public API Permission and click on the drop-down and select OPEN and click the update button.
(Large preview)
Setting Up React
The easiest way to set up React is to use Create-React-App. (This is an officially supported way to create single-page React applications, and offers a modern build setup with no configuration.) We’ll make use of it to bootstrap the application we’ll be building.
From your terminal, run the command below:
npx create-react-app smashing-stores && cd smashing-stores
Once the installation is successful, start the React server by running npm start.
React Starter Page. (Large preview)
Creating Our Layout
In creating the layout for our project, we will have five different components.
NavbarTo hold our navigation and cart iconAllproductsTo display a list of all productsProductThe markup for a single productFooterThe footer of our appCartTo hold the items in our cart
For a quick setup, we will be using Bootstrap to create our components. To include Bootstrap, we would use bootstrap CDN, open up your index.html in the public folder, add the link to the head section:
https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css
Now we can make use of bootstrap classes in our application.
Next, create a /components folder and create the following files inside it:
Navbar.js
Allproducts.js
Product.js
Footer.js
Cart.js
Creating Our Navbar
Open up the Navbar.js and add the following code:
import React from 'react'; const Navbar = () => { return ( <nav className="navbar navbar-light bg-light"> <a href="/" className="navbar-brand">Smashing Stores</a> <button className="btn btn-outline-success my-2 my-sm-0" type="submit">Cart</button> </nav> ); }; export default Navbar;
We declared a functional component Navbar, we return our nav tag with a bootstrap class of navbar navbar-light bg-light. What these classes do is to apply a Navbar with a light background. Inside our nav element, we included an anchor tag with a link to just forward-slash(Homepage) and a class of navbar-brand.
The styled button in the Navbar component has a class named navbar navbar-light bg-light. What this class does it to ensure that our button has a light blue background color and a shadow when hovered.
Next, let’s create our Footer. Open up the Footer.js file and add the following code to it:
import React from 'react'; import '../App.css'; const Footer = () => { return ( <footer className="page-footer font-small bg-blue pt-4"> <div className="container text-center text-md-left"> <div className="row"> <div className="col-md-6 mt-md-0 mt-3"> <h5 className="text-uppercase font-weight-bold">Contact Us</h5> <p>You can contact us on [email protected]</p> </div> <div className="col-md-6 mb-md-0 mb-3"> <h5 className="text-uppercase font-weight-bold">Smashing Stores</h5> <p>Built with 💕 by <a href="https://twitter.com/beveloper">beveloper</a></p> </div> </div> </div> <div className="footer-copyright text-center py-3">© 2020 Copyright <span> Smashing Stores</span> </div> </footer> ); }; export default Footer;
We added contact-us email using h5 and paragraph element. Lastly, on this footer section, we added copyright with the name “Smashing Stores”.
Our footer needs some styling so we’d add the following styles to the App.css file:
footer { position: absolute; bottom: -55px; width: 100%; background-color: #333; color:#fff; }
Before we create our product component, we need to query GraphCMS to send us our product details to display. Let’s do that now.
Connecting To The GraphCMS Backend With GraphQL
To connect our application to the backend, we need to install a couple of GraphQL packages. One of the libraries we can use is apollo-boost which gives a client the avenue for connecting to the GraphQL backend using a URI (Uniform Resource Identifier).
The URI is the endpoint provided by GraphCMS and is available on the endpoint section of the dashboard.
Run the following command in your terminal to install the necessary packages:
npm install apollo-boost graphql graphql-tag react-apollo
Once you’re done with the installation update the index.js file in the /src directory to the following code:
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; import { ApolloProvider } from "react-apollo"; import ApolloClient from "apollo-boost"; import * as serviceWorker from './serviceWorker'; const client = new ApolloClient({ uri: "<YOUR_GRAPHCMS_ENDPOINT>" }); ReactDOM.render( <ApolloProvider client={client}> <App /> </ApolloProvider>, document.getElementById('root') ); serviceWorker.unregister();
Here, we wrapped our entire application with the ApolloProvider which takes a single prop: the client. The ApolloProvider loads the Graph CMS schema and gives us access to all properties of the data model inside our application which is possible because our App component is a child of the ApolloProvider component.
Displaying Our Products
If you got this far, pat yourself on the back. We’ve been able to load our schema from GraphCMS into our application.
The next step is to fetch and display our products. Create an /all-product folder under the /component folder and then create an index.js file and add the following to it:
import gql from "graphql-tag"; const PRODUCTS_QUERY = gql` query { productses { id name price description createdAt image { id url } } } `; export default PRODUCTS_QUERY;
What are “productses”? Our model name is products, but GraphQL pluralizes models, hence the name.
Next, we created a variable called PRODUCTS_QUERY that stores the query from our GraphQl back end. The gql function is used to parse (analyze an object, as it were in our schema) the plain string that contains the GraphQL code (if you’re unfamiliar with the backtick-syntax, you can read up on JavaScript’s tagged template literals).
GraphCMS provides a handy GraphQL explorer named (graphiql) specifically for testing our query.
Testing our endpoint using Graphiql Explorer in our GraphCMS Dashboard. (Large preview)
Now that our query works as it should. Let’s go ahead and create our product’s components.
Creating The Allproducts Component
Open up the Allproducts.js file and add the following code to it:
import React, { Component } from 'react'; import { Query } from 'react-apollo'; import PRODUCTS_QUERY from './all-products/index'; import Product from './Product'; import Cart from './Cart'; import Navbar from './Navbar'; class Allproducts extends Component { constructor(props) { super(props); this.state = { cartitems: [] }; } addItem = (item) => { this.setState({ cartitems : this.state.cartitems.concat([item]) }); } render() { return ( <Query query={PRODUCTS_QUERY}> {({ loading, error, data }) => { if (loading) return <div>Fetching products.....</div> if (error) return <div>Error fetching products</div> const items = data.productses; return ( <div> <Navbar/> <div className="container mt-4"> <div className="row"> {items.map(item => <Product key={item.id} product={item} addItem={this.addItem} />)} </div> </div> </div> ) }} </Query> ); } }; export default AllProducts;
Here, we wrapped our products with the <Query/> component and passed the PRODUCTS_QUERY as props. Apollo injected several props into the component’s render prop function. These props themselves provide information about the state of the network request:
loadingThis occurs during ongoing requests.errorThis occurs when the requests fail.dataThis is data received from the server.
Finally, we loop through all the received items and pass them as a prop to our Product component. Before we see what it looks like, let’s create our Product component.
Creating Product Component
Open up Product.js and add the following code to it:
import React from 'react'; const Product = (props) => { return ( <div className="col-sm-4"> <div className="card" style=> <img src={props.product.image.url} className="card-img-top" alt="shirt"/> <div className="card-body"> <h5 className="card-title">{props.product.name}</h5> <p className="card-title">$ {props.product.price}</p> <p className="card-title">{props.product.description}</p> <button className="btn btn-primary" onClick={() => props.addItem(props.product)}>Buy now</button> </div> </div> </div> ); } export default Product;
Since our Product.js is a functional component that receives product details via props and displays them, we call the addItem function on the onClick event listener to add the current product to the cart when it clicked.
Importing Our Components Into App.js
With our components setup, it’s time we import our components into our App.js base component.
Open it up and add the following to it:
import React from 'react'; import './App.css'; import Footer from './components/Footer'; import Products from './components/Allproducts'; function App() { return ( <div className="App"> <Products /> <Footer/> </div> ); } export default App;
From lines 3-4, we imported both Footer and Products component in the App component.
Next, type npm start in your terminal then navigate to https://localhost:3000 in your browser, and you will see the following:
Final Outcome of our Web App. (Large preview)
We’re close to the end of our project, but our products need a feature that adds items to the cart.
Creating Our Cart Component
To include our cart functionality, we’d need to add some methods to our components.
Let’s update our Allproducts.js file to this:
import React, { Component } from 'react'; import { Query } from 'react-apollo'; import PRODUCTS_QUERY from './all-products/index'; import Product from './Product'; import Cart from './Cart'; import Navbar from './Navbar'; class Allproducts extends Component { constructor(props) { super(props); this.state = { cartitems: [], show: false }; } addItem = (item) => { this.setState({ cartitems : this.state.cartitems.concat([item]) }); } showModal = () => { this.setState({ show: true }); }; hideModal = () => { this.setState({ show: false }); }; render() { return ( <Query query={PRODUCTS_QUERY}> {({ loading, error, data }) => { if (loading) return <div>Fetching</div> if (error) return <div>Error</div> const items = data.productses const itemssent = this.state.cartitems; return ( <div> <Navbar cart={itemssent} show={this.showModal} /> <Cart show={this.state.show} items={itemssent} handleClose={this.hideModal}> </Cart> <div className="container mt-4"> <div className="row"> {items.map(item => <Product key={item.id} product={item} addItem={this.addItem} />)} </div> </div> </div> ) }} </Query> ) }; }; export default Allproducts;
showModal This method sets the show state to true so that the modal can be visible to the user.
hideModal This method sets the show state to false to hide the modal.
We created a variable named itemssent that holds the state of all cart items we get from the backend.
Navbar
cart It passes the items in the cart data to our Navbar.
show It triggers our modal method.
Cart
show It opens up the cart modal.
Items It receives and stores the data sent from the Navbar so it can be displayed when needed.
handleClose It closes the modal.
Updating Navbar
Let’s update our Navbar.js file with the following code:
import React from 'react'; const Navbar = (props) => { return ( <nav className="navbar navbar-light bg-light"> <h3>Smashing Stores</h3> <button className="btn btn-outline-success my-2 my-sm-0" onClick={() => props.show()}>Cart {(props.cart.length)}</button> </nav> ); }; export default Navbar;
We added an on click event that takes a function, which triggers that cart modal.
Lastly, we check for the number of items in our cart by using the .length JavaScript method.
Next, create a Cart.js file and add the following code to it:
import React from 'react'; const Cart = ({ handleClose, show, items }) => { return ( <div className={show ? "modal display-block" : "modal display-none"}> <section className="main-modal"> {items.map(item => <div className="card" style=> <img src={item.image.url} className="card-img-top" alt="shirt"/> <div className="card-body"> <h5 className="card-title">{item.name}</h5> <h6 className="card-title">$ {item.price}</h6> </div> </div> )} Total items: {items.length} <button className="btn btn-warning ml-2" onClick={handleClose}>close</button> </section> </div> ); }; export default Cart;
In our parent div, we used a ternary operator that toggles between visibility and hidden state. Next, in other for us to display the items in our cart modal we map through our items.
Lastly, in this section to check out for the total number of items in our cart we used the .length JavaScript method.
Open up your app.css and add the following code to it:
.modal { position: fixed; top: 0; left: 0; width:100%; height: 100%; background: rgba(0, 0, 0, 0.6); } .main-modal { position:fixed; background: white; width: 80%; height: auto; top:50%; left:50%; padding: 10px; transform: translate(-50%,-50%); } .display-block { display: block; } .display-none { display: none; }
Finally open the shopping cart, add items to it and view it via the ‘Cart’ button:
Conclusion
The concept learned in this article can help you create almost anytime of web apps without paying so much attention to your back-end infrastructure. You can take it further by creating a full-fledged e-commerce store and adding payment etc. I’ll love to see what you were able to make in the comments section.
The supporting repo for this article is available on Github.
References
GraphCMS Documentation
Event App with GraphCMS
(ks, yk, il)
Website Design & SEO Delray Beach by DBL07.co
Delray Beach SEO
source http://www.scpie.org/building-a-web-app-with-headless-cms-and-react/ source https://scpie1.blogspot.com/2020/04/building-web-app-with-headless-cms-and.html
0 notes
genrosystechnologies-blog · 5 years ago
Link
our web developers create Custom website design with amazing features and interface, we offer consultation to undertand your business requirements in terms of design and then  begin the design process with research. We help you design a high ranking and competitive custom website that will give you and edge over your compettitors.our development process requires planning, designing, development, testing, lanching. we are service oriented, skilled and passtionate about rendering the best services to our clients all over the world, our hotlines are available for more informaton about our service offerings  91-8588861588 or +234-8184490704.
0 notes
riichardwilson · 5 years ago
Text
Building A Web App With Headless CMS And React
About The Author
Blessing Krofegha is a Software Engineer Based in Lagos Nigeria, with a burning desire to contribute to making the web awesome for all, by writing and building … More about Blessing …
This article introduces the concept of the headless CMS, a backend-only content management system that allows developers to create, store, manage and publish the content over an API. It gives developers the power to quickly build excellent user experiences, free from the worry of its impact on the back-end business logic.
In this tutorial, you’ll learn what Headless CMS is, and the pros and cons of Headless CMS. In the end, youll have built a shopping cart using GraphCMS (a (backend-only content management system). After that, you can go ahead and build any web app of your choice using a headless CMS and React.
To follow along, you need to have Node and npm/yarn installed on your machine. If you do not have that done already, follow these quick guides to install yarn or npm on your machine. You also need to have a basic understanding of React, Node.js and GraphQL queries. (You can always brush up on React and GraphQL skills, of course!)
As digital products continue to evolve, so does the content we consume. A scalable, cross-platform content management system is crucial to ensuring a product’s growth velocity. Traditional CMS gives the comfort of having the content, the editing interface, templates and custom codes, in a single environment. But with the changes in this mobile era, that’s no longer enough. We need a new breed of CMS — one that can make content available through any channel at which point a Headless CMS is required. A headless CMS gives you the benefits of managing the content and delivering it to any channel. The API makes contents available through any channel and on any device using most favorite tools and programming languages plus it also provides a higher level of security and much better scalability.
What Does This Look Like In Practice?
What happens when you take away the frontend of a CMS? The biggest distinction is that a website can’t be built with a headless CMS on its own. With a traditional CMS, everything happens in the same place.
A headless CMS doesn’t have the features that let you build your site — it doesn’t have site themes or templates. To use a headless CMS, you have to build a site or app, or other experience first, then use the CMS’s API to plug your content into it.
Why Should You Care About Headless?
A headless CMS comes with an API friendly approach, which makes it possible to publish content through an API (either RESTful or GraphQL). It allows you to use the same API to deliver content across various channels such as Android or IOS apps, smartwatches, AR/VR, etc. A headless CMS gives developers the ability to harness creativity quickly. With a traditional CMS, changes can be time-consuming, for example, to tweak a part of your site, you need to re-implement the entire CMS. With a headless CMS, you can make changes to your frontend without having any impact on the back-end infrastructure, hence saving yourself time and resources, which makes it much better.
Traditional vs Headless CMS: The Pros And Cons
It can be complicated to choose between a headless and a traditional CMS. The fact is, they both have potential advantages and drawbacks.
Traditional CMS Pros
It allows for easy customization. A lot of them have drag and drop, this makes it easy for a person without programming experience to work seamlessly with them.
It’s easier to set up your content on a traditional CMS as everything you need (content management, design, etc) are already available.
Traditional CMS Cons
The coupled front-end and back-end results in more time and money for maintenance and customization.
Traditional CMS e.g WordPress relies heavily on plugins and themes which may contain malicious codes or bugs and slow the speed of the website or blog. Here’s a list of 18,305 vulnerable WordPress plugins, themes. Here are security measures for Drupal developers. Check here for more facts.
Headless CMS Pros
Since the frontend and backend are separated from each other, it makes it possible for you to pick which front-end technology suits your needs. This also gives the developer flexibility during the development stage.
Platforms (blogs, websites, etc) built with headless CMS can be deployed to work on various displays such as web, mobile, AR/VR, and so on.
Headless CMS Cons
They give you the hassle of managing back-end infrastructures, setting up the presentation component of your site, app.
They can be more costly to implement — the cost involved in building a user-friendly platform with analytics is high when compared to using traditional CMS.
Best Use Cases For Headless CMS
Headless CMS can have the following use cases:
Static Site Generators (e.g. Gridsome, Gatsby)
Many Jamstack sites created with static site generators like Gridsome, Hugo or Gatsby make use of the headless CMS to manage content, they cannot access a database, Hence content can be stored in a headless CMS and fetched through an API during build time and deployed as static files.
Mobile Apps (iOS, Android)
The advantage of a headless CMS for mobile engineers is that the API enables them to deliver content to an IOS/Android app from the same backend that manages content for their web site, which keeps things in sync.
Web Applications
This approach involves serving content through an API which is then consumed by a web application but offers a centralized place for managing content. An example is an e-commerce application built using HTML, CSS, and JavaScript with content and product data that are maintained in the CMS and served via an external API.
Types Of Headless CMS
There is a list of headless CMSs you might what to check out.
Please note that this article is not written to promote any services or products.
Contentful An API-driven headless CMS designed to create, manage and distribute content to any platform. Unlike a traditional CMS, they offer the ability to create your content model so that you can decide what type of content you want to manage.
GraphCMS A headless CMS for users who want to build a GraphQL content infrastructure for their digital products. This CMS is fully built as API focused from the ground up, allowing creators to define the structures, permissions, and relations for the API parameters. In this article, we’d be using GraphCMS because of its GraphQL API approach.
ButterCMS A CMS that gives complete freedom to build a website or a branded blog with full SEO Company and supports any tech stack. This tool saves you money and the time for site development time. Butter CMS is a maintenance-free headless CMS tool and can integrate with any language or framework. The powerful interface helps you define and customize every element of your website without any hassle.
Directus An open-source tool that wraps custom SQL databases with a dynamic API and provides an intuitive admin app for managing its content. Self-host for free, or use the on-demand Cloud service to manage all your omnichannel digital experiences.
Sanity Another API driven platform for managing structured content. With Sanity, you can manage your text, images, and other media with APIs. You can also use the open-source single page application Sanity Studio to quickly set up an editing environment that you can customize.
Agility A JAMStack focused Headless CMS with Page Management built-in. Faster to build, manage, and deploy. Agility CMS is a Content-First Headless CMS, allowing you to choose any programming language while also getting the flexibility, speed, and power that comes from lightweight APIs. From there, add features like Page Management, Ecommerce, Online Ticketing, and Search. Agility CMS becomes a complete Digital Experience Platform–saving time, removing limitations and allowing for seamless experiences across all digital channels.
Netlify CMS A free and open-source, git-based CMS created by Netlify. It allows you to define your content model, integrates third-party authentication and extends the capabilities of its backend (a single-page app built on React).
Note: All of the examples mentioned above have free and paid versions, except Directus and Netlify CMS which are free. For a list of more headless CMS, check here.
In this article, we’re using GraphCMS — a GraphqQL API-oriented headless content management system that takes care of our back-end architecture.
Using GraphCMS
Content is both dynamic and multi-channeled, however current content management systems (CMS) lack the flexibility to meet the demands of modern-day digital content distribution. GraphCMS is the first HeadlessCMS built around GraphQL and offers a solution to this problem with its mission to facilitate painless content flow between content creators, developers, and consumers.
GraphCMS accept almost any kind of data you can imagine ranging from images, maps, etc. It even makes roles and permissions easy. While other headless CMS solutions exist, GraphCMS aims to provide a hassle-free experience for developers; through leveraging an API specification called GraphQL. It eliminates the need for multiple SDKs to interact with content delivery and provides simple multi-channel content accessibility. It makes creating rich content apps very easy.
GraphCMS And GraphQL
GraphCMS sorely relies on GraphQL, its backbone API specification. GraphQL is API query language and runtime. It was developed by Facebook in 2012 and released open-sourced in 2015. Since then, the likes of Pinterest, Github, Twitter, Intuit, Coursera have all adopted GraphQL to power their mobile apps, websites, and APIs. GraphQL is similar to REST in its core purpose of providing a specification for building and utilizing APIs. However, unofficially dubbed “REST 2.0”, GraphQL has optimized different key functionality offered by REST.
The main uniqueness of GraphQL includes protocol-agnostic usage, controlled data fetching, editable fields, and types and in-depth error handling. The results include removal of code redundancy, prevention of over and under fetching data, and significant reduction of network requests.
As a concrete example, let’s take the relationship of a query to a newsfeed. A newsfeed post has an author, a title and comments. If we use a REST-based CMS, we would have to make 3 different server requests for these 3 different endpoints, whereas, in a GraphQL based CMS, we would only have to make 1 request for all 3. Consequently, the results offer relatively quicker queries and less network flooding — in a practical use case, it would not just be one entity making multiple requests, but thousands and millions.
GraphQL reduces the complexity of building APIs by abstracting all requests to a single endpoint. Unlike traditional REST APIs, it is declarative; whatever is requested is returned.
GraphCMS has a generous free tier of 1 million API operations requests per month and 500 GB assets traffic. Also, GraphCMS provides a Graphiql admin interface that provides you full access to your data and you could just download it all and then execute a create many mutations against your new backend to migrate everything over.
In this article, we’ll be using the free tier of 1 million API operations per month and 500 GB asset traffic. You can make use of the same tier for testing, for projects that need more than this, do well to check out their pricing page.
Building Our Project
To see the power of Headless CMS using GraphCMS we would be building a simple shopping cart.
Getting Started
To get started with GraphCMS follow the steps.
Create an account on GraphCMS. You can use the free tier.
(Large preview)
At successful signup, you’ll be taken to your dashboard. Click on create a new project.
Click on Create new project. (Large preview)
Ensure you click on create a project from scratch.
Select From Scratch. (Large preview)
Set project details for the project fill in what is in the image below and click create.
Set Project Details. (Large preview)
In our dashboard, we would create our models and content.
Create model. (Large preview)
Select the schema in the sidebar of the dashboard to create a schema.
GraphCMS has an awesome drag and drop UI, that make it easy to seamlessly create schema in minutes.
Drag and Drop fields. (Large preview)
Creating our name field. (Large preview)
Note: Click on the ‘Advance’ tab to select the required option in our fields.
If all went well, you should have our schema looking the image below:
Final Schema fields. (Large preview)
Currently, we have no content. Click on ‘Content’ in the sidebar that should take you the Content section, and click on ‘Create New’.
At this point our we have no content/post. (Large preview)
Let’s add a few contents so we can display them later in our app using React.
Here’s how to add content. (Large preview)
Add a few more content if you desire. Here’s our result.
Our final content. (Large preview)
Next, copy the API endpoint URL (Click on the Dashboard) — this is the single endpoint for communication between our React front end and GraphCMS back end.
(Large preview)
Next, let’s make our API endpoint accessible.
Navigate to Settings Under Public API Permission and click on the drop-down and select OPEN and click the update button.
(Large preview)
Setting Up React
The easiest way to set up React is to use Create-React-App. (This is an officially supported way to create single-page React applications, and offers a modern build setup with no configuration.) We’ll make use of it to bootstrap the application we’ll be building.
From your terminal, run the command below:
npx create-react-app smashing-stores && cd smashing-stores
Once the installation is successful, start the React server by running npm start.
React Starter Page. (Large preview)
Creating Our Layout
In creating the layout for our project, we will have five different components.
Navbar To hold our navigation and cart icon Allproducts To display a list of all products Product The markup for a single product Footer The footer of our app Cart To hold the items in our cart
For a quick setup, we will be using Bootstrap to create our components. To include Bootstrap, we would use bootstrap CDN, open up your index.html in the public folder, add the link to the head section:
https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css
Now we can make use of bootstrap classes in our application.
Next, create a /components folder and create the following files inside it:
Navbar.js
Allproducts.js
Product.js
Footer.js
Cart.js
Creating Our Navbar
Open up the Navbar.js and add the following code:
import React from 'react'; const Navbar = () => { return ( <nav className="navbar navbar-light bg-light"> <a href="/" className="navbar-brand">Smashing Stores</a> <button className="btn btn-outline-success my-2 my-sm-0" type="submit">Cart</button> </nav> ); }; export default Navbar;
We declared a functional component Navbar, we return our nav tag with a bootstrap class of navbar navbar-light bg-light. What these classes do is to apply a Navbar with a light background. Inside our nav element, we included an anchor tag with a link to just forward-slash(Homepage) and a class of navbar-brand.
The styled button in the Navbar component has a class named navbar navbar-light bg-light. What this class does it to ensure that our button has a light blue background color and a shadow when hovered.
Next, let’s create our Footer. Open up the Footer.js file and add the following code to it:
import React from 'react'; import '../App.css'; const Footer = () => { return ( <footer className="page-footer font-small bg-blue pt-4"> <div className="container text-center text-md-left"> <div className="row"> <div className="col-md-6 mt-md-0 mt-3"> <h5 className="text-uppercase font-weight-bold">Contact Us</h5> <p>You can contact us on [email protected]</p> </div> <div className="col-md-6 mb-md-0 mb-3"> <h5 className="text-uppercase font-weight-bold">Smashing Stores</h5> <p>Built with 💕 by <a href="https://twitter.com/beveloper">beveloper</a></p> </div> </div> </div> <div className="footer-copyright text-center py-3">© 2020 Copyright <span> Smashing Stores</span> </div> </footer> ); }; export default Footer;
We added contact-us email using h5 and paragraph element. Lastly, on this footer section, we added copyright with the name “Smashing Stores”.
Our footer needs some styling so we’d add the following styles to the App.css file:
footer { position: absolute; bottom: -55px; width: 100%; background-color: #333; color:#fff; }
Before we create our product component, we need to query GraphCMS to send us our product details to display. Let’s do that now.
Connecting To The GraphCMS Backend With GraphQL
To connect our application to the backend, we need to install a couple of GraphQL packages. One of the libraries we can use is apollo-boost which gives a client the avenue for connecting to the GraphQL backend using a URI (Uniform Resource Identifier).
The URI is the endpoint provided by GraphCMS and is available on the endpoint section of the dashboard.
Run the following command in your terminal to install the necessary packages:
npm install apollo-boost graphql graphql-tag react-apollo
Once you’re done with the installation update the index.js file in the /src directory to the following code:
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; import { ApolloProvider } from "react-apollo"; import ApolloClient from "apollo-boost"; import * as serviceWorker from './serviceWorker'; const client = new ApolloClient({ uri: "<YOUR_GRAPHCMS_ENDPOINT>" }); ReactDOM.render( <ApolloProvider client={client}> <App /> </ApolloProvider>, document.getElementById('root') ); serviceWorker.unregister();
Here, we wrapped our entire application with the ApolloProvider which takes a single prop: the client. The ApolloProvider loads the Graph CMS schema and gives us access to all properties of the data model inside our application which is possible because our App component is a child of the ApolloProvider component.
Displaying Our Products
If you got this far, pat yourself on the back. We’ve been able to load our schema from GraphCMS into our application.
The next step is to fetch and display our products. Create an /all-product folder under the /component folder and then create an index.js file and add the following to it:
import gql from "graphql-tag"; const PRODUCTS_QUERY = gql` query { productses { id name price description createdAt image { id url } } } `; export default PRODUCTS_QUERY;
What are “productses”? Our model name is products, but GraphQL pluralizes models, hence the name.
Next, we created a variable called PRODUCTS_QUERY that stores the query from our GraphQl back end. The gql function is used to parse (analyze an object, as it were in our schema) the plain string that contains the GraphQL code (if you’re unfamiliar with the backtick-syntax, you can read up on JavaScript’s tagged template literals).
GraphCMS provides a handy GraphQL explorer named (graphiql) specifically for testing our query.
Testing our endpoint using Graphiql Explorer in our GraphCMS Dashboard. (Large preview)
Now that our query works as it should. Let’s go ahead and create our product’s components.
Creating The Allproducts Component
Open up the Allproducts.js file and add the following code to it:
import React, { Component } from 'react'; import { Query } from 'react-apollo'; import PRODUCTS_QUERY from './all-products/index'; import Product from './Product'; import Cart from './Cart'; import Navbar from './Navbar'; class Allproducts extends Component { constructor(props) { super(props); this.state = { cartitems: [] }; } addItem = (item) => { this.setState({ cartitems : this.state.cartitems.concat([item]) }); } render() { return ( <Query query={PRODUCTS_QUERY}> {({ loading, error, data }) => { if (loading) return <div>Fetching products.....</div> if (error) return <div>Error fetching products</div> const items = data.productses; return ( <div> <Navbar/> <div className="container mt-4"> <div className="row"> {items.map(item => <Product key={item.id} product={item} addItem={this.addItem} />)} </div> </div> </div> ) }} </Query> ); } }; export default AllProducts;
Here, we wrapped our products with the <Query/> component and passed the PRODUCTS_QUERY as props. Apollo injected several props into the component’s render prop function. These props themselves provide information about the state of the network request:
loading This occurs during ongoing requests. error This occurs when the requests fail. data This is data received from the server.
Finally, we loop through all the received items and pass them as a prop to our Product component. Before we see what it looks like, let’s create our Product component.
Creating Product Component
Open up Product.js and add the following code to it:
import React from 'react'; const Product = (props) => { return ( <div className="col-sm-4"> <div className="card" style=> <img src={props.product.image.url} className="card-img-top" alt="shirt"/> <div className="card-body"> <h5 className="card-title">{props.product.name}</h5> <p className="card-title">$ {props.product.price}</p> <p className="card-title">{props.product.description}</p> <button className="btn btn-primary" onClick={() => props.addItem(props.product)}>Buy now</button> </div> </div> </div> ); } export default Product;
Since our Product.js is a functional component that receives product details via props and displays them, we call the addItem function on the onClick event listener to add the current product to the cart when it clicked.
Importing Our Components Into App.js
With our components setup, it’s time we import our components into our App.js base component.
Open it up and add the following to it:
import React from 'react'; import './App.css'; import Footer from './components/Footer'; import Products from './components/Allproducts'; function App() { return ( <div className="App"> <Products /> <Footer/> </div> ); } export default App;
From lines 3-4, we imported both Footer and Products component in the App component.
Next, type npm start in your terminal then navigate to https://localhost:3000 in your browser, and you will see the following:
Final Outcome of our Web App. (Large preview)
We’re close to the end of our project, but our products need a feature that adds items to the cart.
Creating Our Cart Component
To include our cart functionality, we’d need to add some methods to our components.
Let’s update our Allproducts.js file to this:
import React, { Component } from 'react'; import { Query } from 'react-apollo'; import PRODUCTS_QUERY from './all-products/index'; import Product from './Product'; import Cart from './Cart'; import Navbar from './Navbar'; class Allproducts extends Component { constructor(props) { super(props); this.state = { cartitems: [], show: false }; } addItem = (item) => { this.setState({ cartitems : this.state.cartitems.concat([item]) }); } showModal = () => { this.setState({ show: true }); }; hideModal = () => { this.setState({ show: false }); }; render() { return ( <Query query={PRODUCTS_QUERY}> {({ loading, error, data }) => { if (loading) return <div>Fetching</div> if (error) return <div>Error</div> const items = data.productses const itemssent = this.state.cartitems; return ( <div> <Navbar cart={itemssent} show={this.showModal} /> <Cart show={this.state.show} items={itemssent} handleClose={this.hideModal}> </Cart> <div className="container mt-4"> <div className="row"> {items.map(item => <Product key={item.id} product={item} addItem={this.addItem} />)} </div> </div> </div> ) }} </Query> ) }; }; export default Allproducts;
showModal This method sets the show state to true so that the modal can be visible to the user.
hideModal This method sets the show state to false to hide the modal.
We created a variable named itemssent that holds the state of all cart items we get from the backend.
Navbar
cart It passes the items in the cart data to our Navbar.
show It triggers our modal method.
Cart
show It opens up the cart modal.
Items It receives and stores the data sent from the Navbar so it can be displayed when needed.
handleClose It closes the modal.
Updating Navbar
Let’s update our Navbar.js file with the following code:
import React from 'react'; const Navbar = (props) => { return ( <nav className="navbar navbar-light bg-light"> <h3>Smashing Stores</h3> <button className="btn btn-outline-success my-2 my-sm-0" onClick={() => props.show()}>Cart {(props.cart.length)}</button> </nav> ); }; export default Navbar;
We added an on click event that takes a function, which triggers that cart modal.
Lastly, we check for the number of items in our cart by using the .length JavaScript method.
Next, create a Cart.js file and add the following code to it:
import React from 'react'; const Cart = ({ handleClose, show, items }) => { return ( <div className={show ? "modal display-block" : "modal display-none"}> <section className="main-modal"> {items.map(item => <div className="card" style=> <img src={item.image.url} className="card-img-top" alt="shirt"/> <div className="card-body"> <h5 className="card-title">{item.name}</h5> <h6 className="card-title">$ {item.price}</h6> </div> </div> )} Total items: {items.length} <button className="btn btn-warning ml-2" onClick={handleClose}>close</button> </section> </div> ); }; export default Cart;
In our parent div, we used a ternary operator that toggles between visibility and hidden state. Next, in other for us to display the items in our cart modal we map through our items.
Lastly, in this section to check out for the total number of items in our cart we used the .length JavaScript method.
Open up your app.css and add the following code to it:
.modal { position: fixed; top: 0; left: 0; width:100%; height: 100%; background: rgba(0, 0, 0, 0.6); } .main-modal { position:fixed; background: white; width: 80%; height: auto; top:50%; left:50%; padding: 10px; transform: translate(-50%,-50%); } .display-block { display: block; } .display-none { display: none; }
Finally open the shopping cart, add items to it and view it via the ‘Cart’ button:
Conclusion
The concept learned in this article can help you create almost anytime of web apps without paying so much attention to your back-end infrastructure. You can take it further by creating a full-fledged e-commerce store and adding payment etc. I’ll love to see what you were able to make in the comments section.
The supporting repo for this article is available on Github.
References
GraphCMS Documentation
Event App with GraphCMS
(ks, yk, il)
Website Design & SEO Delray Beach by DBL07.co
Delray Beach SEO
source http://www.scpie.org/building-a-web-app-with-headless-cms-and-react/ source https://scpie.tumblr.com/post/614237153781776384
0 notes
erpcall-blog · 4 years ago
Text
Website‌ ‌development‌ ‌company‌ ‌in‌ ‌India‌ ‌|‌ ‌Best‌ ‌web‌ ‌design‌ ‌company‌ ‌in‌ ‌India‌
ERPcall help organizations across the private, public, and social sectors to change things. ERPcall have always helped our clients identify and set the direction toward their most important goals. Take your business online with ERPcaLL. We Website development company in India are offering low cost for website with free on Page SEO. We cover pan India, Middle East & Africa. Forget about code. Website development company in Nigeria Just drag & drop business features, Get all your business needs, out-of-the-box.Make a website, then add features as you grow: jobs, eCommerce, customer portal, events, company blog, call-to-action, newsletter, etc. ERPcaLL deal in web design and web development at low cost website. Get the best HTML or Wordpress, Divi & template based website.
0 notes
olxnigeria · 5 years ago
Link
Tumblr media
At Genrosys Technologies we develop applications with shopify that will help give you everything that will help your business stand out among your competitors. We create online presence for your brand with shopify built for ecommerce and other online applications with features that are userfriendly, relaible and easy to use. the features are built to help manage inventories and payment integration set-up. we have expert developers that create outstanding ecommerce online stores with shopify. to ensure that we give you the best services that your business needs to grow . Shopify development witt help to keep your SEO strategy on track, we create search engine result that generate lots of traffic which caters for your long-term goals. feel free to call us via Latest listings added - Buy and Sell Online on Olx Nigeria Free Classifieds
0 notes
scpie · 5 years ago
Text
Building A Web App With Headless CMS And React
About The Author
Blessing Krofegha is a Software Engineer Based in Lagos Nigeria, with a burning desire to contribute to making the web awesome for all, by writing and building … More about Blessing …
This article introduces the concept of the headless CMS, a backend-only content management system that allows developers to create, store, manage and publish the content over an API. It gives developers the power to quickly build excellent user experiences, free from the worry of its impact on the back-end business logic.
In this tutorial, you’ll learn what Headless CMS is, and the pros and cons of Headless CMS. In the end, youll have built a shopping cart using GraphCMS (a (backend-only content management system). After that, you can go ahead and build any web app of your choice using a headless CMS and React.
To follow along, you need to have Node and npm/yarn installed on your machine. If you do not have that done already, follow these quick guides to install yarn or npm on your machine. You also need to have a basic understanding of React, Node.js and GraphQL queries. (You can always brush up on React and GraphQL skills, of course!)
As digital products continue to evolve, so does the content we consume. A scalable, cross-platform content management system is crucial to ensuring a product’s growth velocity. Traditional CMS gives the comfort of having the content, the editing interface, templates and custom codes, in a single environment. But with the changes in this mobile era, that’s no longer enough. We need a new breed of CMS — one that can make content available through any channel at which point a Headless CMS is required. A headless CMS gives you the benefits of managing the content and delivering it to any channel. The API makes contents available through any channel and on any device using most favorite tools and programming languages plus it also provides a higher level of security and much better scalability.
What Does This Look Like In Practice?
What happens when you take away the frontend of a CMS? The biggest distinction is that a website can’t be built with a headless CMS on its own. With a traditional CMS, everything happens in the same place.
A headless CMS doesn’t have the features that let you build your site — it doesn’t have site themes or templates. To use a headless CMS, you have to build a site or app, or other experience first, then use the CMS’s API to plug your content into it.
Why Should You Care About Headless?
A headless CMS comes with an API friendly approach, which makes it possible to publish content through an API (either RESTful or GraphQL). It allows you to use the same API to deliver content across various channels such as Android or IOS apps, smartwatches, AR/VR, etc. A headless CMS gives developers the ability to harness creativity quickly. With a traditional CMS, changes can be time-consuming, for example, to tweak a part of your site, you need to re-implement the entire CMS. With a headless CMS, you can make changes to your frontend without having any impact on the back-end infrastructure, hence saving yourself time and resources, which makes it much better.
Traditional vs Headless CMS: The Pros And Cons
It can be complicated to choose between a headless and a traditional CMS. The fact is, they both have potential advantages and drawbacks.
Traditional CMS Pros
It allows for easy customization. A lot of them have drag and drop, this makes it easy for a person without programming experience to work seamlessly with them.
It’s easier to set up your content on a traditional CMS as everything you need (content management, design, etc) are already available.
Traditional CMS Cons
The coupled front-end and back-end results in more time and money for maintenance and customization.
Traditional CMS e.g WordPress relies heavily on plugins and themes which may contain malicious codes or bugs and slow the speed of the website or blog. Here’s a list of 18,305 vulnerable WordPress plugins, themes. Here are security measures for Drupal developers. Check here for more facts.
Headless CMS Pros
Since the frontend and backend are separated from each other, it makes it possible for you to pick which front-end technology suits your needs. This also gives the developer flexibility during the development stage.
Platforms (blogs, websites, etc) built with headless CMS can be deployed to work on various displays such as web, mobile, AR/VR, and so on.
Headless CMS Cons
They give you the hassle of managing back-end infrastructures, setting up the presentation component of your site, app.
They can be more costly to implement — the cost involved in building a user-friendly platform with analytics is high when compared to using traditional CMS.
Best Use Cases For Headless CMS
Headless CMS can have the following use cases:
Static Site Generators (e.g. Gridsome, Gatsby)
Many Jamstack sites created with static site generators like Gridsome, Hugo or Gatsby make use of the headless CMS to manage content, they cannot access a database, Hence content can be stored in a headless CMS and fetched through an API during build time and deployed as static files.
Mobile Apps (iOS, Android)
The advantage of a headless CMS for mobile engineers is that the API enables them to deliver content to an IOS/Android app from the same backend that manages content for their web site, which keeps things in sync.
Web Applications
This approach involves serving content through an API which is then consumed by a web application but offers a centralized place for managing content. An example is an e-commerce application built using HTML, CSS, and JavaScript with content and product data that are maintained in the CMS and served via an external API.
Types Of Headless CMS
There is a list of headless CMSs you might what to check out.
Please note that this article is not written to promote any services or products.
Contentful An API-driven headless CMS designed to create, manage and distribute content to any platform. Unlike a traditional CMS, they offer the ability to create your content model so that you can decide what type of content you want to manage.
GraphCMS A headless CMS for users who want to build a GraphQL content infrastructure for their digital products. This CMS is fully built as API focused from the ground up, allowing creators to define the structures, permissions, and relations for the API parameters. In this article, we’d be using GraphCMS because of its GraphQL API approach.
ButterCMS A CMS that gives complete freedom to build a website or a branded blog with full SEO Company and supports any tech stack. This tool saves you money and the time for site development time. Butter CMS is a maintenance-free headless CMS tool and can integrate with any language or framework. The powerful interface helps you define and customize every element of your website without any hassle.
Directus An open-source tool that wraps custom SQL databases with a dynamic API and provides an intuitive admin app for managing its content. Self-host for free, or use the on-demand Cloud service to manage all your omnichannel digital experiences.
Sanity Another API driven platform for managing structured content. With Sanity, you can manage your text, images, and other media with APIs. You can also use the open-source single page application Sanity Studio to quickly set up an editing environment that you can customize.
Agility A JAMStack focused Headless CMS with Page Management built-in. Faster to build, manage, and deploy. Agility CMS is a Content-First Headless CMS, allowing you to choose any programming language while also getting the flexibility, speed, and power that comes from lightweight APIs. From there, add features like Page Management, Ecommerce, Online Ticketing, and Search. Agility CMS becomes a complete Digital Experience Platform–saving time, removing limitations and allowing for seamless experiences across all digital channels.
Netlify CMS A free and open-source, git-based CMS created by Netlify. It allows you to define your content model, integrates third-party authentication and extends the capabilities of its backend (a single-page app built on React).
Note: All of the examples mentioned above have free and paid versions, except Directus and Netlify CMS which are free. For a list of more headless CMS, check here.
In this article, we’re using GraphCMS — a GraphqQL API-oriented headless content management system that takes care of our back-end architecture.
Using GraphCMS
Content is both dynamic and multi-channeled, however current content management systems (CMS) lack the flexibility to meet the demands of modern-day digital content distribution. GraphCMS is the first HeadlessCMS built around GraphQL and offers a solution to this problem with its mission to facilitate painless content flow between content creators, developers, and consumers.
GraphCMS accept almost any kind of data you can imagine ranging from images, maps, etc. It even makes roles and permissions easy. While other headless CMS solutions exist, GraphCMS aims to provide a hassle-free experience for developers; through leveraging an API specification called GraphQL. It eliminates the need for multiple SDKs to interact with content delivery and provides simple multi-channel content accessibility. It makes creating rich content apps very easy.
GraphCMS And GraphQL
GraphCMS sorely relies on GraphQL, its backbone API specification. GraphQL is API query language and runtime. It was developed by Facebook in 2012 and released open-sourced in 2015. Since then, the likes of Pinterest, Github, Twitter, Intuit, Coursera have all adopted GraphQL to power their mobile apps, websites, and APIs. GraphQL is similar to REST in its core purpose of providing a specification for building and utilizing APIs. However, unofficially dubbed “REST 2.0”, GraphQL has optimized different key functionality offered by REST.
The main uniqueness of GraphQL includes protocol-agnostic usage, controlled data fetching, editable fields, and types and in-depth error handling. The results include removal of code redundancy, prevention of over and under fetching data, and significant reduction of network requests.
As a concrete example, let’s take the relationship of a query to a newsfeed. A newsfeed post has an author, a title and comments. If we use a REST-based CMS, we would have to make 3 different server requests for these 3 different endpoints, whereas, in a GraphQL based CMS, we would only have to make 1 request for all 3. Consequently, the results offer relatively quicker queries and less network flooding — in a practical use case, it would not just be one entity making multiple requests, but thousands and millions.
GraphQL reduces the complexity of building APIs by abstracting all requests to a single endpoint. Unlike traditional REST APIs, it is declarative; whatever is requested is returned.
GraphCMS has a generous free tier of 1 million API operations requests per month and 500 GB assets traffic. Also, GraphCMS provides a Graphiql admin interface that provides you full access to your data and you could just download it all and then execute a create many mutations against your new backend to migrate everything over.
In this article, we’ll be using the free tier of 1 million API operations per month and 500 GB asset traffic. You can make use of the same tier for testing, for projects that need more than this, do well to check out their pricing page.
Building Our Project
To see the power of Headless CMS using GraphCMS we would be building a simple shopping cart.
Getting Started
To get started with GraphCMS follow the steps.
Create an account on GraphCMS. You can use the free tier.
(Large preview)
At successful signup, you’ll be taken to your dashboard. Click on create a new project.
Click on Create new project. (Large preview)
Ensure you click on create a project from scratch.
Select From Scratch. (Large preview)
Set project details for the project fill in what is in the image below and click create.
Set Project Details. (Large preview)
In our dashboard, we would create our models and content.
Create model. (Large preview)
Select the schema in the sidebar of the dashboard to create a schema.
GraphCMS has an awesome drag and drop UI, that make it easy to seamlessly create schema in minutes.
Drag and Drop fields. (Large preview)
Creating our name field. (Large preview)
Note: Click on the ‘Advance’ tab to select the required option in our fields.
If all went well, you should have our schema looking the image below:
Final Schema fields. (Large preview)
Currently, we have no content. Click on ‘Content’ in the sidebar that should take you the Content section, and click on ‘Create New’.
At this point our we have no content/post. (Large preview)
Let’s add a few contents so we can display them later in our app using React.
Here’s how to add content. (Large preview)
Add a few more content if you desire. Here’s our result.
Our final content. (Large preview)
Next, copy the API endpoint URL (Click on the Dashboard) — this is the single endpoint for communication between our React front end and GraphCMS back end.
(Large preview)
Next, let’s make our API endpoint accessible.
Navigate to Settings Under Public API Permission and click on the drop-down and select OPEN and click the update button.
(Large preview)
Setting Up React
The easiest way to set up React is to use Create-React-App. (This is an officially supported way to create single-page React applications, and offers a modern build setup with no configuration.) We’ll make use of it to bootstrap the application we’ll be building.
From your terminal, run the command below:
npx create-react-app smashing-stores && cd smashing-stores
Once the installation is successful, start the React server by running npm start.
React Starter Page. (Large preview)
Creating Our Layout
In creating the layout for our project, we will have five different components.
Navbar To hold our navigation and cart icon Allproducts To display a list of all products Product The markup for a single product Footer The footer of our app Cart To hold the items in our cart
For a quick setup, we will be using Bootstrap to create our components. To include Bootstrap, we would use bootstrap CDN, open up your index.html in the public folder, add the link to the head section:
https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css
Now we can make use of bootstrap classes in our application.
Next, create a /components folder and create the following files inside it:
Navbar.js
Allproducts.js
Product.js
Footer.js
Cart.js
Creating Our Navbar
Open up the Navbar.js and add the following code:
import React from 'react'; const Navbar = () => { return ( <nav className="navbar navbar-light bg-light"> <a href="/" className="navbar-brand">Smashing Stores</a> <button className="btn btn-outline-success my-2 my-sm-0" type="submit">Cart</button> </nav> ); }; export default Navbar;
We declared a functional component Navbar, we return our nav tag with a bootstrap class of navbar navbar-light bg-light. What these classes do is to apply a Navbar with a light background. Inside our nav element, we included an anchor tag with a link to just forward-slash(Homepage) and a class of navbar-brand.
The styled button in the Navbar component has a class named navbar navbar-light bg-light. What this class does it to ensure that our button has a light blue background color and a shadow when hovered.
Next, let’s create our Footer. Open up the Footer.js file and add the following code to it:
import React from 'react'; import '../App.css'; const Footer = () => { return ( <footer className="page-footer font-small bg-blue pt-4"> <div className="container text-center text-md-left"> <div className="row"> <div className="col-md-6 mt-md-0 mt-3"> <h5 className="text-uppercase font-weight-bold">Contact Us</h5> <p>You can contact us on [email protected]</p> </div> <div className="col-md-6 mb-md-0 mb-3"> <h5 className="text-uppercase font-weight-bold">Smashing Stores</h5> <p>Built with 💕 by <a href="https://twitter.com/beveloper">beveloper</a></p> </div> </div> </div> <div className="footer-copyright text-center py-3">© 2020 Copyright <span> Smashing Stores</span> </div> </footer> ); }; export default Footer;
We added contact-us email using h5 and paragraph element. Lastly, on this footer section, we added copyright with the name “Smashing Stores”.
Our footer needs some styling so we’d add the following styles to the App.css file:
footer { position: absolute; bottom: -55px; width: 100%; background-color: #333; color:#fff; }
Before we create our product component, we need to query GraphCMS to send us our product details to display. Let’s do that now.
Connecting To The GraphCMS Backend With GraphQL
To connect our application to the backend, we need to install a couple of GraphQL packages. One of the libraries we can use is apollo-boost which gives a client the avenue for connecting to the GraphQL backend using a URI (Uniform Resource Identifier).
The URI is the endpoint provided by GraphCMS and is available on the endpoint section of the dashboard.
Run the following command in your terminal to install the necessary packages:
npm install apollo-boost graphql graphql-tag react-apollo
Once you’re done with the installation update the index.js file in the /src directory to the following code:
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; import { ApolloProvider } from "react-apollo"; import ApolloClient from "apollo-boost"; import * as serviceWorker from './serviceWorker'; const client = new ApolloClient({ uri: "<YOUR_GRAPHCMS_ENDPOINT>" }); ReactDOM.render( <ApolloProvider client={client}> <App /> </ApolloProvider>, document.getElementById('root') ); serviceWorker.unregister();
Here, we wrapped our entire application with the ApolloProvider which takes a single prop: the client. The ApolloProvider loads the Graph CMS schema and gives us access to all properties of the data model inside our application which is possible because our App component is a child of the ApolloProvider component.
Displaying Our Products
If you got this far, pat yourself on the back. We’ve been able to load our schema from GraphCMS into our application.
The next step is to fetch and display our products. Create an /all-product folder under the /component folder and then create an index.js file and add the following to it:
import gql from "graphql-tag"; const PRODUCTS_QUERY = gql` query { productses { id name price description createdAt image { id url } } } `; export default PRODUCTS_QUERY;
What are “productses”? Our model name is products, but GraphQL pluralizes models, hence the name.
Next, we created a variable called PRODUCTS_QUERY that stores the query from our GraphQl back end. The gql function is used to parse (analyze an object, as it were in our schema) the plain string that contains the GraphQL code (if you’re unfamiliar with the backtick-syntax, you can read up on JavaScript’s tagged template literals).
GraphCMS provides a handy GraphQL explorer named (graphiql) specifically for testing our query.
Testing our endpoint using Graphiql Explorer in our GraphCMS Dashboard. (Large preview)
Now that our query works as it should. Let’s go ahead and create our product’s components.
Creating The Allproducts Component
Open up the Allproducts.js file and add the following code to it:
import React, { Component } from 'react'; import { Query } from 'react-apollo'; import PRODUCTS_QUERY from './all-products/index'; import Product from './Product'; import Cart from './Cart'; import Navbar from './Navbar'; class Allproducts extends Component { constructor(props) { super(props); this.state = { cartitems: [] }; } addItem = (item) => { this.setState({ cartitems : this.state.cartitems.concat([item]) }); } render() { return ( <Query query={PRODUCTS_QUERY}> {({ loading, error, data }) => { if (loading) return <div>Fetching products.....</div> if (error) return <div>Error fetching products</div> const items = data.productses; return ( <div> <Navbar/> <div className="container mt-4"> <div className="row"> {items.map(item => <Product key={item.id} product={item} addItem={this.addItem} />)} </div> </div> </div> ) }} </Query> ); } }; export default AllProducts;
Here, we wrapped our products with the <Query/> component and passed the PRODUCTS_QUERY as props. Apollo injected several props into the component’s render prop function. These props themselves provide information about the state of the network request:
loading This occurs during ongoing requests. error This occurs when the requests fail. data This is data received from the server.
Finally, we loop through all the received items and pass them as a prop to our Product component. Before we see what it looks like, let’s create our Product component.
Creating Product Component
Open up Product.js and add the following code to it:
import React from 'react'; const Product = (props) => { return ( <div className="col-sm-4"> <div className="card" style=> <img src={props.product.image.url} className="card-img-top" alt="shirt"/> <div className="card-body"> <h5 className="card-title">{props.product.name}</h5> <p className="card-title">$ {props.product.price}</p> <p className="card-title">{props.product.description}</p> <button className="btn btn-primary" onClick={() => props.addItem(props.product)}>Buy now</button> </div> </div> </div> ); } export default Product;
Since our Product.js is a functional component that receives product details via props and displays them, we call the addItem function on the onClick event listener to add the current product to the cart when it clicked.
Importing Our Components Into App.js
With our components setup, it’s time we import our components into our App.js base component.
Open it up and add the following to it:
import React from 'react'; import './App.css'; import Footer from './components/Footer'; import Products from './components/Allproducts'; function App() { return ( <div className="App"> <Products /> <Footer/> </div> ); } export default App;
From lines 3-4, we imported both Footer and Products component in the App component.
Next, type npm start in your terminal then navigate to https://localhost:3000 in your browser, and you will see the following:
Final Outcome of our Web App. (Large preview)
We’re close to the end of our project, but our products need a feature that adds items to the cart.
Creating Our Cart Component
To include our cart functionality, we’d need to add some methods to our components.
Let’s update our Allproducts.js file to this:
import React, { Component } from 'react'; import { Query } from 'react-apollo'; import PRODUCTS_QUERY from './all-products/index'; import Product from './Product'; import Cart from './Cart'; import Navbar from './Navbar'; class Allproducts extends Component { constructor(props) { super(props); this.state = { cartitems: [], show: false }; } addItem = (item) => { this.setState({ cartitems : this.state.cartitems.concat([item]) }); } showModal = () => { this.setState({ show: true }); }; hideModal = () => { this.setState({ show: false }); }; render() { return ( <Query query={PRODUCTS_QUERY}> {({ loading, error, data }) => { if (loading) return <div>Fetching</div> if (error) return <div>Error</div> const items = data.productses const itemssent = this.state.cartitems; return ( <div> <Navbar cart={itemssent} show={this.showModal} /> <Cart show={this.state.show} items={itemssent} handleClose={this.hideModal}> </Cart> <div className="container mt-4"> <div className="row"> {items.map(item => <Product key={item.id} product={item} addItem={this.addItem} />)} </div> </div> </div> ) }} </Query> ) }; }; export default Allproducts;
showModal This method sets the show state to true so that the modal can be visible to the user.
hideModal This method sets the show state to false to hide the modal.
We created a variable named itemssent that holds the state of all cart items we get from the backend.
Navbar
cart It passes the items in the cart data to our Navbar.
show It triggers our modal method.
Cart
show It opens up the cart modal.
Items It receives and stores the data sent from the Navbar so it can be displayed when needed.
handleClose It closes the modal.
Updating Navbar
Let’s update our Navbar.js file with the following code:
import React from 'react'; const Navbar = (props) => { return ( <nav className="navbar navbar-light bg-light"> <h3>Smashing Stores</h3> <button className="btn btn-outline-success my-2 my-sm-0" onClick={() => props.show()}>Cart {(props.cart.length)}</button> </nav> ); }; export default Navbar;
We added an on click event that takes a function, which triggers that cart modal.
Lastly, we check for the number of items in our cart by using the .length JavaScript method.
Next, create a Cart.js file and add the following code to it:
import React from 'react'; const Cart = ({ handleClose, show, items }) => { return ( <div className={show ? "modal display-block" : "modal display-none"}> <section className="main-modal"> {items.map(item => <div className="card" style=> <img src={item.image.url} className="card-img-top" alt="shirt"/> <div className="card-body"> <h5 className="card-title">{item.name}</h5> <h6 className="card-title">$ {item.price}</h6> </div> </div> )} Total items: {items.length} <button className="btn btn-warning ml-2" onClick={handleClose}>close</button> </section> </div> ); }; export default Cart;
In our parent div, we used a ternary operator that toggles between visibility and hidden state. Next, in other for us to display the items in our cart modal we map through our items.
Lastly, in this section to check out for the total number of items in our cart we used the .length JavaScript method.
Open up your app.css and add the following code to it:
.modal { position: fixed; top: 0; left: 0; width:100%; height: 100%; background: rgba(0, 0, 0, 0.6); } .main-modal { position:fixed; background: white; width: 80%; height: auto; top:50%; left:50%; padding: 10px; transform: translate(-50%,-50%); } .display-block { display: block; } .display-none { display: none; }
Finally open the shopping cart, add items to it and view it via the ‘Cart’ button:
Conclusion
The concept learned in this article can help you create almost anytime of web apps without paying so much attention to your back-end infrastructure. You can take it further by creating a full-fledged e-commerce store and adding payment etc. I’ll love to see what you were able to make in the comments section.
The supporting repo for this article is available on Github.
References
GraphCMS Documentation
Event App with GraphCMS
(ks, yk, il)
Website Design & SEO Delray Beach by DBL07.co
Delray Beach SEO
source http://www.scpie.org/building-a-web-app-with-headless-cms-and-react/
0 notes