Rails 6 frontend architecture [closed] - ruby-on-rails

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 am developing a new app from scratch in rails 6 and I'm looking for a simple way to:
Allow users to access the app offline and
Access some native features of the phone: like Geolocation, Camera and Bluetooth.
Indeed, I'm looking to keep the architecture as simple as possible in the frontend and avoid having two code-bases.
The app itself is not very complex (think of a "listing app" similar to AirBnb) but given the targeted users, I would like to have strong control over the design.
I should underline that I am a hobbyist developer (in my last project I used rails 3 --yep, that's a long time ago! ; ) so I would prefer to avoid learning "yet another framework". For that reason, I would like to use html 5 / css as much as possible, in order to keep the development experience as close as possible to a simple web-app.
Question: what frontend framework and / or approach would better answer to my needs?

I see the two forms below:
1- You can create a pwa (Progressive Web App) with rails so you can use offline resources.
2- You can create an api with rails and develop an outside project with react and if you want a mobile app you can use react native.
For the first option, there is a rails gem called ServiceWorker::Rails.
For the second option you can use the rails new app --api command, to create a cleaner project prepared for building an api

Related

PHP // MYSQL // JAVASCRIPT needed for a native iOS online app? [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
I'm thinking of developing an app where you can look at each other's profiles (basically a Job-Finding Application) and I would like to know if you needed any knowledge of PHP, MYSQL for the databases and would you need any knowledge of Javascript to develop the application.
I'm currently looking at Google Firebase and also didn't know if that required any PHP knowledge?
All of the Firebase SDKs that you would use in your client app do not require any programming language knowledge other than what's required for your client platform. If you want to write entirely in swift, that's fine.
The only exception is Cloud Functions, which requires that you learn JavaScript to run on the backend.
iOS apps are built in Swift or C#, typically not javascript and never php.
You can build a PWA (progressive web app) that acts like an ios app using javascript Libraries such as react.
However, MySQL is a database that can be used with any number of applications and programming languages, so you should probably learn that.
My guess is that if you are asking this question, you probably should consult the Apple developer documentation before asking on this form.

What's the intended way working with angular and ruby on rails [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 3 years ago.
Improve this question
I've just startet my first project with angular in combination with ruby on rails. There isn't that much documentation outside. After some research I'm confused about this combination.
In a normal angular project you would server the content and the style via angular. But in rails this doesn't seems to work out of the box, so there must be an other intention.
Is it really meant to serve the templates and styles using rails views and than add only the client logic using angular?
Angular is not really meant to work with any kind of backend templating. Angular is meant for Single Page Applications (SPA) that work on their own. Usually, you would have one or more APIs to communicate with your Backend (usually via REST, sometimes GraphQL). Templatiting, Styling and Bindings should be done by Angular alone.
So in your case you would only supply a REST Based API using Rails and do all of the frontend work in your Angular application, which in turn communicates only via REST with your Rails Backend.

Are there any RoR projects exploring the use of web components? [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 3 years ago.
Improve this question
This might not be an acceptable question for Stack Overflow but I didn't know where else to ask the question.
Web Components has been "about to happen" for a very long time. It now appears that most browsers have most of the required pieces natively instead of using polyfills (which always worried me).
I'm wondering if Ruby On Rails is planing on moving to it or if there are any projects creating web components as well as Rails server code to take advantage of them.
I'm wondering if Ruby On Rails is planing on moving to it or if there are any projects creating web components as well as Rails server code to take advantage of them.
The webpacker gem makes it easy to include some of the JS frameworks for non-native web components like Vue or React, but you can also use it with Polymer to support native web components. We do this at my work, and we don't necessarily use webpacker for it right now but I can assure you it's a very good gem.
Here's more info: https://github.com/rails/webpacker
Here's how you'd initiate a new rails project with webpacker set up for VueJS for instance:
rails new myapp --webpack=vue
I'm not sure if rails is going to implement web-components as a built-in feature or not but the motive behind adding webpacker as default in rails 6 is to improve the integration of front-end/javascript libraries. So, you can use vue-js, react-native easily along with your rails app and build components in it.
I'm personally using many vue-js components in rails projects and having no issue with that.
P.S: Same as the question this might not be an acceptable answer :P

Is it ok if the framework has inbuilt database? [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 5 years ago.
Improve this question
Me and one fellow developer are working on a iOS framework and we are in a debatable situation. I will try to explain it in more details below
Questions: Is it a good practice to bundle the database in the framework, instead of allowing developer using our developed framework to implement the local database of his own.
My argument: We should never bundle the database within the framework and we should allow user to implement the local database of his own so that perform different operations in the app as per his/her convenience. We should never force the developer to be dependent on the database and database structure we created for various tasks such as caching or offline storage. As a framework provider what we should provide is a base using which he can access functionality provided by our platform.
His argument: The database should be bundled in the framework itself so that developer can directly implement the front end of the app instead of managing database and its architecture. It doesn't matter if he want to use our database or not. If he doesn't want to use anything he will simply ignore it.
I would like to know which is a correct approach for designing a SDK/framework
There can be multiple databases, the fact that a framework has a database doesn't mean that the app that using the framework can't have a database and that shouldn't be a consideration for the framework.
If your framework can offer database or caching capabilities as an option then great , and if someone thinks that he can manage database better then your framework can and wants to do it by himself then also great.
I would think how can the framework suggest local database as an optional feature of the framework.

How to publish and implement Ruby file to my website [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 6 years ago.
Improve this question
I'm a beginner of Ruby. I want to establish my website by programming with Ruby language.
Before that, I used to upload HTML files to my web-host server, so that I could update my website. But now I have no idea about what should I do with Ruby file.
Thank you!
If you are using the rails framework you may wanna try using cloud9 instead. Brackets from what i understand is "local". Whereas cloud9 is a "real" IDE. Additionally you can easily push your code to heroku where your code will be hosted at.
To get things started just head over to cloud9 to create an account to setup your IDE. If you are unfamiliar with it there are lots of guides out there that can help you to get things started.
However if you lack the fundamentals in using the rails framework, guides.rubyonrails.org may be a good place to start too.
Update:
There is no best language when it comes to developing a website. The fundamentals of a webpage are HTML/CSS.
HTML gives you the bones or structure, such as your titles and your paragraphs etc.
CSS gives you your styling, such as creating buttons or changing font color etc.
This 2 languages form the core part of what would be your website, at the very least on the front end (meaning to say what people see when they visit your website)
JavaScript is not a must but definitely a plus. It is able to improve the UI/UX (user interface/user experience) of your website.
Lastly would be your back-end language; what handles the processes that goes on behind the scenes. If you choose ruby (and by extension rails) then that is fine as well. Basically your back-end language will support your database and CRUD (create, read, update, delete) actions.

Resources