Use website database as a flutter app backend [closed] - flutter

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed last year.
Improve this question
I have just started the flutter journey. I have been asked to develop a mobile app that uses the data of a website instead of its own database(firestore etc.). The website is about car dealing business. It has data about cars and I want to fetch that data into flutter app I have no idea how to do it. Is there any package or anything else.

You would combine an HTTP Client with an HTML parser, assuming the website itself didn't have a accessible API that readily returns the data you're interested in via JSON.

If your website has a firebase backend, then you can use this set of plugins. The google-services.json file should be the same as that of the firebase project used in your website.
If your website has an API you can use the http package to make http requests.

First you have to build the REST Full API in the website backend using a backend language PHP or Node.js or .Net whatever good for your project, and then use flutter Dio or http to make requests to the REST API you built, you get back a JSON response then populate the data on your flutter app

Related

what is exactly firebase and is it best choice for authentication in flutter? [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 would like to know what is exactly firebase. When i want to create authentication for my app i see on google firebase is often used on flutter for do it but it is not clear what is it exactly. I have a MySQL/php api from the server side and i need to find a way for save on mobile phone an user id when the user create an account, what is the best solution for do that with security. I have seen too, there is people who uses shared preference but security is low i think
Firebase is a whole set of applications and services that acts as a link to Google Cloud, which provides these services. Here's their website.
Firebase is a toolset that (according to them) allows you to “build, improve, and grow your app”, and they give you the tools that cover a large portion of the services that developers would normally have to build themselves. This includes things like analytics, authentication, databases, configuration, file storage, push messaging, etc.
This is different than traditional app development, which typically involves writing both frontend and backend software. The frontend code just invokes API endpoints exposed by the backend, and the backend code actually does the work. With firebase, your app accesses those services directly (or, allows you to write APIs to handle that, if needed)
These are the firebase functions that (arguably) are the most commonly used amongst developers.
Authentication — SECURE user login and identity, with applicable
rules
Realtime Database — realtime, cloud hosted, NoSQL database (older
version)
Cloud Firestore — realtime, cloud hosted, NoSQL database (but with
better queries)
Cloud Storage — massively scalable file storage
Cloud Functions — “serverless”, event driven backend (this is where
you'd write your
APIs)
Firebase Hosting — global web hosting (this is GREAT for flutter
because you can upload your designs immediately without paying for
it.)
ML Kit — SDK for common ML tasks
Here are all their services... but I haven't used most of them.
Finally, the great thing about firebase is that all their functionality is free, and you only start paying when the traffic starts growing.
Is it the best choice for authentication? Without. a. doubt. Not only is it secure, it provides a wide range of side services like "login with your google/facebook/whatever account" and "Forgot your password" retrievals. But it also allows for full token authentication, and access rules.
Sources:
https://firebase.google.com/
https://medium.com/firebase-developers/what-is-firebase-the-complete-story-abridged-bcc730c5f2c0
https://howtofirebase.com/what-is-firebase-fcb8614ba442
as u have api already then what u can definitely use firebase for verifying the phone number of user & then continue him to register that way u can get verified phone number of user.
u dont have to save phone number of user u can get it using
await FirebaseAuth.instance.currentUser().phoneNumber
what shared preference is used for is to store basic info about user like phone number, username, isLogin etc. but if u care about security which i dont think u need to worry about u can use another package like hive which uses AES 256 CBC with PKCS7 padding encryption.

For complex request is rest better than graphQl [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 have a complexe request to send to the server . In sumary i am creating a feed system
So in my request i use 2 tables.
First i start with the login user id and i pull all the other users he is following from a FOLLOW table .
So now I have the logged in user plus an array of other user he is following .
Second step is i use a FEED table the complexity is i would like to pull all the action from this table that are eitheir performed by the main user or the following users.
I am using Graphql for all my other request ... however for a complxe request like this one . I am thinking that REST is more suited
I would like to know your thoughts
There's no such term as better. It all depends on what you need, what your architecture is and after all, what you know to use better.
GraphQL is great for such complex request because you can return exactly what you need and nothing more. So if you're asking if GraphQL can handle it, for sure it can!
Where is this complexity?
You can use one graphql query - user{followers{feeds{action.. and user{feeds{action... - both action arrays will be available in Apollo.
You can always combine results from these 2 arrays into one on client side from [normalized] Apollo cache [for some component needs]. You have both sets separated as they are separated in reality and universal for future needs/other app/client/admin.
If you really want/need it combined serverside just add user to his followers in resolver for query like user{userAndFollowers{feeds/action... - it can be done beside main/separated schema, just by adding additional 'branch'.
It always depends on details ... but REST better? in witch version/convention/'standard'? good joke ;) - no offence, tons of pro/cons/comparisions everywhere ... try/read/choose suitable to requirements.

How to work with Pagination in Delphi REST components [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 6 years ago.
Improve this question
Within Delphi Seattle, I am using the Delphi Rest components to retrieve data via REST services. My data provider appears to limit results to 1000 rows at a time, meaning I need to use pagination. I know a pagination URL is returned in the REST data stream. So a couple questions...
(1) Do the Delphi components support a GetNextPage (or something similar?). If so, I could not find it.
(2) How do I retrieve the URL to get the next page? Do I then update the TRESTRequest resource property and EXECUTE again?
(3). I am using a RestResponseDataSetAdapter to access this data (via DataSource and ClientDataSet). I am assuming that there is NO WAY to "combine" the data results from multiple REST calls. For example, if I retrieve 1,000 rows via my first call, and 300 rows via the second call, there is no way to access all 1300 rows at the same time?
I have looked on Google, as well as REST documentation and did not find anything useful. Any help appreciated.
There is no single standard way to implement pagination, as different Web/REST servers implement it in their own way. It's next to impossible for these components to have built-in pagination options covering any and every possible scenario.
Whatever service you're using should provide you details of how to implement pagination. Usually, this is part of the query string. For example...
http://someserver.com/someresource?pageSize=100&page=1
...or sometimes perhaps in the resource...
http://someserver.com/someresource/1/
...or sometimes in the HTTP headers...
Page-Size: 100
Page: 1
I've also seen some servers which provide a URL in their response, pre-defined and ready for you to use to navigate to the next page of results...
{
"next_page": "http://someserver.com/someresource?pageSize=100&page=3",
"prev_page": "http://someserver.com/someresource?pageSize=100&page=1"
}
But again, every server is different. I've never seen any two REST servers which follow the exact same rules as each other.
You will just have to read the rules as instructed by this service, and implement your pagination in each and every request, as you need.
That being said, whenever I write any sort of API wrapper, the first step is to establish a standard communication layer, which implements anything which is common across all requests available on that particular service. Here, I would add pagination options, working according to how that service was designed.

Amazon web services issue. Should I pay for the web services? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm new in iOS development, and I faced an issue with amazon.
I wanna gain information about amazon products with amazon web servises. I wanna enter the keyword and get information about proper products.
I looked at http://aws.amazon.com/mobile/ and saw that I should register. During the registration Amazon asked me about my Visa card information and then tried to withdraw 1 dollar.
The questions are:
Should I pay for amazon web services
Is it compulsory to register or I can just download Amazon sdk from http://aws.amazon.com/sdkforios/
Can you give some Amazon sdk code examples?
AWS is paid service. So, it's not a matter whether you should or not pay for using AWS. You MUST pay for the capacity you have used.
The pricing differs between the various services and is typically listed in http://aws.amazon.com/<service name>/pricing/. Here are couple of examples - EC2, S3.
Note that for some of the services there is a free tier for about a year, as long as you stay under certain amount of usage. So, while you WILL get a bill every month, that bill might be for $0.
More about the AWS Free Usage Tier.
You can download the client SDKs freely and write code against it. However, to actually run it against AWS, you will need AWS Access Key ID and Secret Access Key, so that AWS servers can authenticate the requests from your application (and incidentally also bil you properly for your usage).
You should start with the Getting Started with the AWS SDK for iOS and the AWS SDK for iOS FAQs. The SDK also contains bunch of sample apps into the <SDK install folder>/samples folder.
Update:
Ah, you want to search the Amazon catalog? That's different from AWS. AWS is intended to provide you access to computing resources (storage, CPU, load balancing, and so on) for your own services. For your scenario you need to use the Amazon Affiliate Program Product Advertising API.
While that API does share credentials with AWS (it uses the AWS Access Key ID and Secret Key), it most likely is free (but double check to be sure), as amazon will be making money on any product your users buy.
Also, the Product Advertising API does not have client SDKs (as far as I know), so you will have to deal with making the HTTP requests yourself. The API supports both REST and SOAP, so you can choose your own poison. There's also bunch of samples for both server and client apps, in PHP, C#, Java, Node.js, Ruby, and so on.
AWS is great! Its totally worth the price. So you can download the AWS iOS SDK and integrate it into your project; however, before it will work you need to signup. I would give you some examples but I don't fully understand what you're asking. The AWS iOS SDK has tons of code samples in it. If you want, you can comment on this post what you want to use AWS for and then I can help you come up with the code to achieve it :) I hope you have fun with iOS Development, its great :)
Good Luck!
Are you maybe confusing Amazon web services with a request API? You said:
I want to enter the keywork "iphone" and get some iphone products on amazon with its description and price
That is what an amazon web API would do (from this question, I understand there is maybe no such thing for Amazon?). AWS is a cloud service where you can run your programs and pay according to the resources you use. Think of that as a web host.
All in all, AWS is not directly related to Amazon content, if I understood correctly this is not what you want.
Yes of course you have to pay.
You can download it without registration, but you have to register to use it.
There is Documentation in AWS SDK for iOS.

What security mechanisms does Meteor have? [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 9 years ago.
Improve this question
We all know that Meteor offers the miniMongo driver which seamlessly allows the client to access the persistent layer (MongoDB).
If any client can access the persistent API how does one secure his application?
What are the security mechanisms that Meteor provides and in what context should they be used?
When you create a app using meteor command, by default the app includes the following packages:
AUTOPUBLISH
INSECURE
Together, these mimic the effect of each client having full read/write access to the server's database. These are useful prototyping tools (development purposes only), but typically not appropriate for production applications. When you're ready for production release, just remove these packages.
To add more, Meteor supports Facebook / Twitter / and Much More packages to handle authentication, and the coolest is the Accounts-UI package
In the collections doc says:
Currently the client is given full write access to the collection.
They can execute arbitrary Mongo update commands. Once we build
authentication, you will be able to limit the client's direct access
to insert, update, and remove. We are also considering validators and
other ORM-like functionality.
If you are talking about restricting the client not to use any of your unauthorized insert/update/delete API, thats possible.
See their, todo app at https://github.com/meteor/meteor/tree/171816005fa2e263ba54d08d596e5b94dea47b0d/examples/todos
Also, they have now added a built in AUTH module, that lets you login and register. So its safe. As far as you are taking care of XSS , Valiations, client headers etc.
but you can anyday convert meteor app into fully working nodejs application by deploying to node. So if you know how to secure a nodejs application you should be able to secure meteor.
As of 0.6.4, during development mode, is_client and is_server blocks still both go to the client system. I can't say if these are segregated when you turn off development mode.
However, if they are not, a hacker might be able to gain insight from the system by review the blocks of if(Meteor.is_server ) code. That particularly concerns me, especially because I noted that I still at this point can't segregate Collections into separate files on client and server.
Update
Well, the point is don't put security related code in an is_server block in a non-server directory (i.e. - make sure it is in something under the /server .
I wanted to see if I was just nuts about not being able to segregate client and server Collections in the client and server directories. In fact there is no problem with this.
Here is my test. It's a simple example of the publish/subscribe model that seems to work fine.
http://goo.gl/E1c56