What's the difference between Apollo and Gatsby? [closed] - graphql

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I am trying to understand their difference.
From my understanding, Apollo is an implementation of GraphQL, and Gatsby is a framework that uses Apollo to build severside-rendered apps. Is that interpretation correct?
Would appreciate any input!

Apollo (apollo-client) is a highly customizable graphql client with normalizing cache.
Gatsby is a node.js based static content generator. Resuls with a kind of [severside rendered] react app that can be 'run' from any (cheap) server supporting static content (static html, js, images) - even without any dynamic content support (f.e. php). Pages are prerendered as html (good for SEO) and transition between them is optimized (preloading).
Gatsby and graphql - it manages internally content in redux but provides graphql api data source consumed (in pages/templates) by own/internal client/lib to create static [fast] pages. This is compile time only 'server+client'. De facto not server and not client (not apollo), more like a set of helpers (customizable compiling system) using graphql querying format to describe templates data requirements, data processing etc.
You can use apollo-client [react] components/hooks in gatsby page templates for run-time data fetching [from static/generated pages]. You can use it in gatsby's node.js compiling environment for data fetching (instead of source plugins).

Related

Why should I use strapi cms with React? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I want to start a project but I am unable to select a technology. I basically work in JavaScript. So, develop a project with JavaScript both in front end and back end will be good for me. But I need a suggestion regarding a headless cms called Strapi. Why should I use it with React? What is the advantage and disadvantage of using strapi with react. Because Strapi is still fixing many bugs they had with their alpha version. So, I need a suggestion for this case.
You are not required to use React in your client application while creating a project with Strapi. The whole concept of is that Strapi is front-end agnostic which means that you can use it with your preferred framework or library.
The administration panel which is provided with your project is built with React, however it is completely different than your client application.
You already said, Strapi is a Headless CMS, which is defined as:
A headless CMS is a back-end only content management system (CMS)
built from the ground up as a content repository that makes content
accessible via a RESTful API for display on any device.
source
This explains why it is NOT A MUST to use a React Library, #scoupette pointed out. It does not work with REACT itself, it just sends you a data as a response, when you query something or gaining access to somewhere.
Strapi is meant to stay as a backend. Be responsible for all hard work like authentication, content type management and flexibility. When you create a content type in Strapi, you are not limited by creating only Posts or Pages, as it would be on a Wordpress default CMS configuration.
When you start developing in Strapi, generally is enough to control the backend and whole system you have created only by sending and receiving some JSON data between the listening server on default :1337 port. I do it with Postman. Whenever you decide to build a frontend, you start "rendering" the JSON responses got from Strapi. They might be displayed on your web app using: React, Gatsby, Angular, Next.js and many more. You can find their "Blog" demos with those frontend frameworks on the website.
Now lets have a look at the second part of the question:
What is the advantage and disadvantage of using strapi with react
Let's reassemble the question: Pros and Cons of using React with a Headless CMS. To know that you have to compare it with other opportunities we have, but that might get us out of the topic. Instead you might like to refer more experienced users of the frameworks in The Best JS Frameworks for Front End.

How to prepare half dynamic web page with best performance? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Imagine you have a web page which has some static contents and some dynamic contents based on the user's session. For example, you may see a webpage with a menu at top of the page which displays username but the remaining content is completely cachable and static.
There could be a simple solution to achieve that:
You can handle the dynamic part of the page in the client side with ajax request (which is not cachable) e.g. single page applications.
There may be another solution that client sends a request to a middleware(e.g. API Gateway) and the middleware fetches static part from cache and dynamic part from the backend then returns aggregated content to the client.
In my idea, the worst solution is to disable the cache.
What Facebook is doing, loads dynamic part at first request, and loads remaining contents with XHR requests.
Questions:
What is the best practice for this issue?
What would be the drawback of the second solution?
What do you think about Stackoverflow top menu that displays your username?
An AJAX request (or fetch, or any other HTTP based request) may well be cached by using a RESTful service.
For more fine grained controll over what should be cached you could use a service worker, for example by adding https://developers.google.com/web/tools/workbox/ to your application.
If your dynamic data has to be updated live, you should also have a look at WebSockets. Depending on your stack you could use a wrapper library like SignalR, socket.io or simply follow one of the tutorials at http://websocketd.com/

What backend-agnostic admin interfaces / GUIs are there? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
This question should serve as a listing of all the different backend-agnostic admin interfaces. Update the community wiki answer below to add more.
This is a community wiki answer. You should edit me with your improvements. Alphabetically sorted.
Implementations
AdminJS is a database table like GUI with CRUD abilities
NOTE: No longer maintained.
(source: webresourcesdepot.com)
Create.js is an inline editing GUI for editing content and managing collections, it provides a widget interface and can be extended to have WYSIWYG editors placed ontop of it
(source: bergie.iki.fi)
HydraConsole is a generic API console for Hydra-powered Web APIs.
Lumber Lumber uses your SQL or MongoDB database to generates a modern Admin Interface application that is completely backend agnostic and highly flexible.
ng-admin: Add an AngularJS admin GUI to any RESTful API
Web Write's InlineGUI is an inline editing GUI with CRUD and site management abilities
Specs/Frameworks
Create.js Backend Integration Guide - REST API spec for CRUD actions
VIE - server-agnostic JavaScript data layer built on the W3C RDFa and JSON-LD specs and used in Create.js
Hydra - a lightweight vocabulary to create hypermedia-driven Web APIs. By specifying a number of concepts commonly used in Web APIs it enables the creation of generic API clients.
Web Write Spec - REST API spec for CRUD actions and collection listings
Neutron Protocol - XML and WebDAV protocol for content editing
The Atom Publishing Protocol - XML and WebDAV protocol for content editing
MetaWeblog API - XML-RPC API for blog-oriented content editing
Data.js - data representation framework for Javascript
Twingle - XUL application and protocol for cross-system content editing (discontinued)
Articles
Moving DocPad Forward, the rise of backend-agnostic GUIs
Decoupling Content Management
VIE 2.0 is starting to emerge
Using RDFa to make web pages editable
Neutrol Protocol - separating UI from the CMS
ng-admin: Add an AngularJS admin GUI to any RESTful API
There is also https://github.com/punkave/jquery-rest-admin
In this context http://jsonapi.org could also start playing a role.

Sinatra build REST API documentation [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I have been looking all night for a gem to generate an API documentation from my sinatra routes. I should be able to specify with inline comments.
I have found https://rubygems.org/gems/sinatra-api-docs & https://rubygems.org/gems/sinatra-croon
but both just don't seem to work with my setup and are outdated too..
The other option was yard with some sinatra plugin, but that does not generate REST API specific layout when generating the docs.
Does anyone have any tools they know about?
All the information i want to reference for each route:
Object: Groups
Route: POST /create
Params: Name of the group
Output:
{
"name": "group",
"members": []
}
thanks
I would check out Apiary.io, it looks pretty well designed and uses a Markdown-style domain-specific language to describe your API. Plus its free while still in beta.
Have you tried Sinatra Yard? I've used it, with some modifications to Yard, to produce my API docs.

W3C validation for complete site [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I am working on a project where I have to validate the complete site, which has around 150 pages, through W3C Markup Validation. Is there a way to check W3C Markup Validation of an entire website?
The W3C doesn't offer this on w3.org.
http://validator.w3.org/docs/help.html#faq-batchvalidation
But you can use this tool and check "Validate entire site": (Also w3.org refers to this site!)
http://www.htmlhelp.com/tools/validator/
But you have a limit of 100 URLs to validate and will get this message when you reach 100 URLs:
Batch validation is limited to 100 URLs at one time. The remaining URLs were not checked.
Also there's a limit of errors displayed for each url.
The WDG offers two free solutions:
Validate entire site (select 'validate entire site')
Validate multiple URLs (batch)
You can run the validator yourself. As of 2018, W3C are using v.Nu for their validator, the code is at https://github.com/validator/validator/releases/latest and usage instructions are at https://validator.github.io/validator/#usage
For example, the following command will run it on all html files under the public_html directory:
java -jar vnu.jar --skip-non-html public_html
I use this tool bulk w3c html validator to validate my entire website
http://www.bulkseotools.com/bulk-w3c-validator.php
This tool uses W3c validator engine, you can check 500 urls at once.
I've used http://sitevalidator.com; I think it would be helpful to you.
I made this java app (Windows installer) in my spare time because I needed it at work:
https://gsoft.no/validator. It's free.
It uses either https://validator.w3.org/ or v.Nu running locally to validate an entire site.
It crawls a website and in the end makes a report with validator-links to all pages with warnings or errors. Because it crawls, all pages to be validated must be linked.
By running v.Nu locally you can validate an internal site (e.g. an intranet) which is not available online and therefore cannot be validated by online validators (unless you post the entire content of each page).

Resources