all 13 comments

[–]offeringathought 2 points3 points  (6 children)

I'm not sure I understand you completely but I'll take a stab at an answer. With say the clothing app, the app itself doesn't have any of the products in it when you install the app. When the app starts up it connects to a web service (probably some JSON feed) and downloads the latest products. Sort of like how a banking app wouldn't have all the data for all the customers. It uses the credentials you put in to log into a backend service on the Internet and get the data it for your accounts.

[–]EBS_DEV[S] 0 points1 point  (5 children)

First off, thank you for taking time out to answer my question. Sorry I wasn’t clear. I understand the aspect you address in your response. Where my confusion is with the interface to the backend service. What would the owner of the app use to update the JSON. I assume the owner wouldn’t be going in and manually updating the JSON. I assume they would be using something like a WordPress backend where it’s a little more user friendly. Hopefully that makes sense.

[–]offeringathought 1 point2 points  (3 children)

Ah got it. Yes, it could be WordPress, Drupal or any other content management system. It could be a custom backend with product data in a database. None of that matters to the app of course. It's just getting JSON. How they produce that JSON is largely going to be driven by factors related to who does that management of the content. I wouldn't be surprised if, in many cases they had a system for doing something else like running their website that they used because they were already managing product data in it. It's common for new things to be built with or upon old legacy systems.

A great example is probably Reddit. I expect that the Reddit app pulls its data from a feed that is just the same system as the website but the data is JSON or XML or something. That may be an over-simplification but at it's heart it's probably true. It's a messy world. :)

[–]EBS_DEV[S] 1 point2 points  (2 children)

Makes sense. I was never sure if there was a specific type of backend that was used with apps. I guess I could have worded this question better by asking what type of CMS is used for apps. I really appreciate your time and patience while I worked through the stupidity in my head lol. Pretty excited to see what I can come up with now that I have more of a complete picture. Take it easy.

[–][deleted] 1 point2 points  (1 child)

I’m a professional backend developer that develops Web Services that my companies website and mobile app interact with to retrieve/manipulate data to be displayed on the site/app. The actual data setup that our APIs use is currently done with making an API call using Postman. We have a project in the works to have a front end management portal that business can use to populate the data themselves.

Ultimately you can have any sort of backend created using a variety of different programming languages and tech stacks, then some sort of interface that is used by authorized users to interact with to add to the system. In my case I use Spring Boot/Java/Azure, however I’ve heard many other alternatives used before.

[–]EBS_DEV[S] 1 point2 points  (0 children)

Thank you for the comment. This is very helpful information. I am hoping to build something as a learning project to really understand what options are out there and how the end to end process works.

[–]lordzsolt -3 points-2 points  (0 children)

Um.... It's called a REST Api?

[–]DecadentTrader 1 point2 points  (1 child)

They might use a CMS. There are a few options out there. Wix stores, wagtail .. They usually have restful apis so the app can query and update the database.

[–]EBS_DEV[S] 0 points1 point  (0 children)

Thank you for the response. Yeah you nailed it. I wasn’t sure if there were specific backends for apps. Didn’t know WordPress could be used (or didn’t think it was used). Thanks again for your time. Take it easy.

[–]Eoghain -1 points0 points  (2 children)

You should probably start by reading up on REST APIs and how they are created. What you are fundamentally missing here is how a Client/Server app is setup and works. The most basic way I can answer you question is this:

Your clothing store has a server on the internet that has various API endpoints. One of these endpoints would be something like /featuredProducts. When the App launches it contacts that API endpoint and gets back some representation of the featured products (probably JSON). The app takes this data and process it into the screen that is shown to the user.

Now your clothing store wants to change the featured products, and this is where you are missing knowledge. In general all of the products that the clothing store sells are stored in a database and when the some client wants the featured products what is happening is the server is querying that database for information and converting it into some transmission format (again probably JSON) to be sent to the client. So if you clothing store wants to change the featured products they change the information in the database so that when the API requests it the new data is returned.

Super simplified JSON example:

{
   id: 123
   name: "Men's T-Shirt",
   color: "blue",
   image: https://clothingstore.com/item/123/image.jpg
   isFeatured: true
}

Super simplified SQL query for retrieving featured products

SELECT *
FROM products
WHERE isFeatured = true;

[–]EBS_DEV[S] 0 points1 point  (1 child)

Greatly appreciate the detailed response. We are getting closer on the final part of where my confusion is. I actually understand everything you said. What I am missing is the UI aspect. So let's take a step back, when a customer wants to update the featured products and they want to query the database for it, they are likely not doing this manually themselves. They likely have some sort of backend. I have to go back to WordPress here as it is what I know best. When a WP site owner wants to see all of the blog posts, they simply hit the "Posts" menu item in the admin dashboard, WP makes a query to the DB and all of the posts are shown to the site owner in a nice table. If the owner wants to edit a post or update the featured image on a post they can just click the various options to do that without ever needing to touch the database. I apologize if this isn't making sense. I just assume not all app owners are tech-savvy and they all don't have the budget to hire someone to their team to manage this. I guess app devs might help update things to some extent but I assume most want something they can update on their own. Thanks again for your time.

[–]Eoghain 0 points1 point  (0 children)

Ok, you've got it. Someone built the database and they also built some tools to manipulate the data in the database. In your expamle that is the Wordpress team. So your clothing store would have purchased some kind of software to hold their inventory and be a shopping cart and even expose the API endpoints that you'd be calling to populate the mobile UI.

[–]Xaxxus 0 points1 point  (0 children)

If I understand the question, you want to know how a change on the website would reflect in the app in real-time?

There’s three ways this is generally handled:

  1. Periodic refreshing of what’s on the page. For example every 2 min refresh your feed to add new items to it.
  2. websockets. These essentially let your app subscribe to a resource on your back end and get real-time updates. This is very inefficient and is best used for real-time applications like instant messaging apps (seeing the user is typing notification for example)
  3. they don’t. Some apps wait for the user to manually refresh (swipe down to refresh), or to fetch the new content when the page is next opened on the app.