How to create / organize / archive mobile network development in a Rails application?

I will do my best to formulate this as an answer question and less as the beginning of a discussion.

The essence of my question is that in your experience is it better to develop a mobile web version of your site as a standalone application that uses your site as an API or to develop from the same Rails application that serves your site ?

Currently, I plan how we are going to implement it, and for each of them there are drawbacks / drawbacks that seem to me.

Standalone mobile app

  • get even
    • Performance: less overhead from an existing website = better performance
    • Less footprint: easier to organize and cleaner application for work / development
    • De-coupled: will force us to create archiving services for desktop / mobile devices.
  • Downsides
    • Subdomain: you will need to use m.thredup.com so that mobile traffic can be redirected to a separate application.
    • Session management: you will need to deal with authentication in multiple applications / domains
    • Local development is harder: another local development support service
    • Branch management: the new code requires separate branches for the web application + mobile application.

The same applications for mobile networks

  • get even
    • URL scheme: the ability to use the same URLs for the desktop + mobile (easier to share)
    • Session management: the ability to use existing user sessions
    • Faster implementation: a shorter project timeline, since all logic circuits are already installed.
  • Downside
    • Code overlay: more code for our already large Rails web application.

If we developed a mobile network in our existing application, here we could use the approach for rendering mobile views - http://scottwb.com/blog/2012/02/23/a-better-way-to-add-mobile- pages-to-a-rails-site / p>

Any ideas would be appreciated.

+4
source share
2 answers

You are 9 times out of 10, it will be better if you design the site so that you can use the same code for any device, so that it adapts reasonably to the device, and in such a way that it provides the most important / useful content / functionality for each device based on style sheets or rendering / non-rendering options. Remember that, unlike 6 years ago, your main problem with mobile devices today is the lack of computing power, but rather a different screen size and different input.

As a rule, mobile users do not want to see a damaged or split version of your site. They want to see a useful version of your site. What is suitable for use varies, but often this means that the most common functions are very easy to access, while the more obscure options are buried a little lower or maybe not so optimized. Useful may mean that you give them exactly the same functionality as on the desktop, but stylized for better display on a mobile phone. Or that you cut things that make no sense on your mobile phone. But you will make it much more difficult for yourself if you configure it so that you need to support two code streams or one code stream that starts very early, or a fundamentally different application. This is a lot more testing, much more coding and a much greater chance of breakage.

We follow this approach, and it works well for our very small development team - we successfully used it so that we can use the same code base to run two different implementations for different clients - one very complex desktop, the first user interface, as well as a very simplified application for mobile devices:

  • suppose all devices access the same URL
  • Suppose that 90% of device optimization will be done using CSS queries, 7% will be done using jQuery hacks, and 3% will be done using browser detection very early.
  • Build your application so that individual components or user interface modules can be easily turned on / off using code (logic in ApplicationController? Rack Midleware?). We do this by putting our individual "widgets" in overtones, which are wrapped with Enablement checks on the widget (either in Rails.config or as an instance variable in the ApplicationController side), so that we can disable whether we return the corresponding HTML back to the browser
  • use CSS multimedia queries not only to style fonts and widths, but also to change menus / functions and other user interface elements to work with the various form factors you need.

As a rule, the API-for-mobile approach will be most useful for you if you intend to create a compiled application for a mobile device and intend to do the heavy work in the user interface using the device’s user interface libraries, not the HTML generated on the server. Again, if you decide to use an approach such as Backbone.js or Angular.js to process your front display, and then go with an API approach only COULD also be a good architecture for you to follow. But then you go beyond Rails much more.

+2
source

It seems to me that one piece of important information is “why?” and you need to consider your budget and the time frame and time frame for work.

Providing you use a fluid layout similar to the amazing Matthew James Taylor layouts, which will resize to fit the available screen size. The only reason I can see that mobile templates require a specific CSS style to make your looks more like a mobile app.

I do not see performance as a problem. If you have performance overhead from an existing website, and you are developing these performance issues for mobile devices, then why not solve these problems for non-mobile users. that is, to create a mobile site with the layout of liquids and make it work for viewing desktop / tablets. This may be a good opportunity to redesign the entire site to be more productive.

I see that you really have two options, depending on the budget and time scale.

1) Create an entirely new set of templates while developing performance problems using a liquid layout to switch existing layouts to new layouts over time

2) Redesign existing templates and functions to make a mobile site.

In any case, users of your desktop and tablet will benefit, but how far you go, it depends on your deadlines and budget, since option 1 is a cheaper and faster way in the short term, and option 2 is a cheaper and faster way in long term. The way I see it is that by not providing the same templates for mobile and desktop and tablet users, you will secure someone to provide the best experience for all users.

This is truly a solution for your project managers.

UPDATE - based on comments

In this case, I would go on to develop a separate mobile application. I would even think about using alternative technologies for streaming updated data in real time. There is a good comparison between Rails Live Streaming and Node.js.

If you decide to introduce new technologies or not by providing a separate application for mobile users, you will provide maximum mobility and be able to fully concentrate on this.

I don’t see different domain names being too much of an SEO issue. You should be able to take advantage of the existing visibility from the main site and with a separate domain for mobile devices, you can significantly increase the ranking of your SEO without doing any additional advertising.

I assume that you yourself have come to your own conclusions regarding the best way forward, and the best advice I can give you is to tell you to just give yourself a little more time to think and let your chosen decision strengthen and I’m sure that if he is right, he will simply “feel” the right to you.

Nobody knows your business better than you, and it is really impossible, without participating in the project and business, to say what is ultimately the best option.

0
source

Source: https://habr.com/ru/post/1494134/


All Articles