codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Follow publication

Why Would You Implement A Backend For Your React App?

You ain’t gonna need it. But once you do, it is too late! Unless…?

Frank Zickert | Quantum Machine Learning
codeburst
Published in
4 min readNov 7, 2019

Do you need a “back end”? Maybe yes, maybe no! Photo by Clem Onojeghuo on Unsplash

A React web-app interacts with the user dynamically. It avoids interruptions of the user experience between successive pages. It rather appears to be a desktop application than a website.

You can do quite a lot with a React web-app. Even if it has no (own) backend.

  • You can server different routes. React adds the path of a route after a #. Usually, anything after the # is ignored. But React-Router uses this information and provides it to your web-app.
  • You can work with local states. React provides the useState-hook and supports a Redux-store
  • You can call any (existing) API. You can send or fetch data.

Why would your app need a backend?

Maybe you need to write your own web-services. Services that access your database. Services that cater to the specific needs of your app. Services that provide the exact data your app needs in the exact format your app needs.

Maybe you need to render your web-app at the server-side. Completely rendered HTML pages enable search engines to crawl the content of your app.

Maybe your app needs to open socket-communication to support real-time events.

There are plenty of good reasons, why your app needs a backend. If your app needs a backend to achieve its purpose, then go ahead. Implement a backend!

But what if your app does not yet really need a backend?

When you start coding your React app, you may not know for sure whether you would need a backend later. You don’t know all the user stories. You don’t know all the non-functional requirements. Like the required load performance, scalability, HTTP-response behavior.

You cannot foresee the future.

YAGNI! “You ain’t gonna need it!”

This best practice in software development tells you to not add anything to your code until you actually need it. You implement the code you need to solve your problem at hand. Not more.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Published in codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Written by Frank Zickert | Quantum Machine Learning

You're interested in quantum computing and machine learning. But you don't know how to get started? Let me help

Responses (2)

Write a response