I’m very new to programming, I know I’m not supposed to ask here, but I really got lost, I’m building a food ordering app with Expo and the only thing left for me is to add Stripe and building the iOS and android projects. I’m really confused on what are the next steps, some people talk about ejecting and then developing Stripe. The expo documentation just provides examples in TypeScript, and my project is in JavaScript. And the Stripe documentation talks about a “server-side” which I still can’t understand how it works, for example, when I launch then my app in the stores, do I have to run the server in my computer separately at all times when the app launches? Also I should add that I’m using Firebase for Authentication and Databases. If someone could provide me good tutorials or have some suggestions I’d be glad, thanks
Usually StackOverflow is for very specific question, not "global" how-tos, I won't then write code for you, but will try to explain as much as I can.
First of all welcome to the amazing world of programming ! One of my mentor oftenly says "Developer can change the world with a text editor".
Concerning your Expo App : No you don not need to eject to use Stripe, the great expo team is providing a brigde between #stripe/stripe-react-native and expo. You can read more here.
For the demo, just remove the typescript params, it should work like a charm (thus, as you're new to programming, I strongly recommend you to check typescript, as it's (almost) now a standard for JS programming, both front and backend).
For the backend part, yes, you'll have to create your own, raw - using the JS runtime Node.js (Express, Nest, Koa...), PHP, Python or any language you're familiar with, or a "serverless" one, you've mentionned Firebase, it's one of it, bit there're many solutions out there (AWS Lambdas...)
Of course, you won't have a backend on your computer, but on a dedicated server which will handle every call from your app serving from 'https://myapi.mydomain.com/what/to/do'. Imagine your app as a shop, a visitor can see shoes, try them, and if he/she wants it, he has to pay.
And here, usually the shop needs some customer informations (for retargeting) and stock management (Hey ! 4 customers has bought Shoes #42 in Size #4 and Color #17, we should reorder some), that requires a bit a security and business logic (confirm payments, send orders, ...).
Concerning Stripe, you'll need a backend to create a Customer cus_XXX, create a Payment Intent, send it back to your app and confirm it then (for Europe 3D Secure, or SCA stuff), it's slightly more complicated, i took the quickest path.
For the tutorials, there's PLENTY, if you can afford $10 to $50 check the insanely good ones from Udemy or Pluralsight otherwise, check Medium or just ... Google it with "Node.js getting started".
As you're new in programming, and as SO is slightly for more "advanced" peeps, I'd recommend you to find some dev community on Slack / Discord, you'll probably more "welcomed". At some point we're all the junior of someone, but this place is - once more - for very specific questions ;)
Happy programming !
Related
so me and a friend started a venture for an app as I'm sure many other friends did as well. My job was to develop the app and his was to develop the web page and database.
Brief description: The app is the end product and relies on information uploaded by users. This information is uploaded to the database through the web page and the app. The app in turn pulls information from this database and performs its functions with it.
Well, now the app is done and the site is only partially developed. He seems to have dropped off the face of the planet and I don't want to abandon the project.
My questions:
1) The queries to the database were being made using php searches. To start off, is that the right terminology?
2) I've stumbled across a ton of different hosting sites and software today. What site/software allows you to use server side code to error check data and store it? (I've seen a lot about wordpress but still don't grasp what I really need)
3) Most web pages seem to use java to check the form entries. However, Java seems to be an overarching group for a bunch of sub categories. What version of Java should I start learning to work with forms on web pages?
I'm a novice on this side of the fence, but what I need doesn't seem overly complicated in my mind so I'm pretty sure with a little direction I can start researching and learning how to get this done. Thanks for the help in advance.
I'm trying to make a group chat extension, basically you can open it put in a code to connect to a group chat and then you can talk and stuff.
Go to Udemy and take several courses until you feel really comfortable with html, css, js, and Node.js.
Learn a few frameworks (Angular, Vue, React, Mithril... have fun and stay safe out there)
Pick a framework/stack (eeny meeny miny moe)
Start coding (you’ll know what to do if you followed steps 1-3).
After coding a bit, you’ll realize this is very hard. Make some friends in the JS community, take more courses, and keep grinding.
Take a course on launching Chrome extensions.
If you’re still working at it, and feeling optimistic, take a course on security and authorization concerns, and don’t you dare release that app without double checking the security of your Node server.
Blow all your money on some cloud services to host your db, server, etc.
Profit. (Jk sorta, I’m just tired of typing)
Writing micro-services on back-end is not that much confusing, specially if we are building api endpoints. We can write separate project for users management, separate project for reporting, ..., and combine all their endpoint with AWS gateway api, or for smaller one acomplish this with nginx reverse proxy to provide a integrated api service.
The way I am suggesting the team for writing back-end is something like that:
localhost:8001/list <- reverse proxy to -> apiproxy.com/users/list
localhost:8003/transaction <- reverse proxy to -> apiproxy.com/transactions/create
So it seems simple, we write our projects by category in separate repos, and each team/person can work individualy on it. But here goes my question:
" How can we implement a solution, that a server rendered React app ( Or, angular, Vue ) can render, and developed with separate repositories, but in build time, they merge into each other, and their routing works well."
So, in this senario, each repository must be able to bootstrap independetly. The aim is not create a new framework.
Does anyone has any kind of suggestion?
Canopy Tax, a tech startup based in Utah that builds solutions for tax professionals, faced a similar situation about 2 years ago. They wanted to be able to implement some sort of microservice architecture in the front end, and guess what, they succeeded. The solution is not perfect yet, there's a lot of trade offs, but the objective is met and they are using this in production with their customers. I have seen it in action at some meet ups they have hosted.
Canopy Tax open sourced their framework last year, it is called Sofe. Here it is the link to the github project. Their solution, is used in production and is here to stay for a long time. They recently raised another 20 million in VC this year.
This sofe framework is what they call a Meta-framework. It is basically a main router that decides where to dispatch your routes. Then it dispatches to an angular, ember, react, angular2 app. And it gets even better, in the same page you can have pieces built in react, pieces in angular, etc. You get the idea. This allowed them to scale faster, get more talent as well as they are no longer limited to just one framework. And they can deploy anytime and their teams (squads) don't depend on each other as those pieces of the app are independent applications, like microservices in the front end.
It is still fairly new but definitively worth a look. I recently talked with them at a meet up and some other companies are using this as well in production. They also have an inspector tool an other tools that show you what framework that piece of the web app you select belongs to (e.g. react, angular, etc). Here it is the live demo of sofe in action.
Click on framework inspector there, then turn it on. It will show you.
There's trade offs on this approach, one is that this is not supported yet for mobile. It works great for their product but they are working on solutions for that as well.
Disclaimer: I do not work at Canopy Tax, I have never worked there and I do not have any relation with the company. I just like Sofe and what they are doing with the project.
I'm currently working on a project for a student led program at my school to make a mobile application that involves advertising various events and such, but more importantly, allows the app users to chat to one another. My question has to do with this chat functionality. I have heard good things about candy chat, and thought I might try to use it. The issue I have run into is setting up the XMPP server.
The program I'm doing this for has a very limited budget, so I have to find the cheapest solution possible to host this XMPP server. The idea I had, was to somehow use Google's App Engine or a similar cloud computing platform with a good free offering as the backend chat server. So, my question is, does anyone have any experience in doing something similar to this who can give me a better idea of how to accomplish it? Not necessarily with the exact same tools, but at least a similar concept.
Also, if I'm going in the totally wrong direction, feel free to set me straight. I'm still in the very early stages of this project, so I'm not really tied to any aspects of this solution, this just seemed to be the most straightforward way to go to me.
Thanks guys!
Since you seem to have a budget constraint, I would suggest going with the free tier of Amazon's EC2 service (Google App Engine won't work as it only lets you implement an xmpp client, not a server). You can host any XMPP Server on your Amazon EC2 instance. Ejabberd seems to be a popular choice.
I think you're in the right general direction, once you have your XMPP Server installed and running, you can easily connect whatever client you want to it.
Me and my startup app company is working on a turn based multiplayer iPhone application. Let it be said that neither one of us have any database, or server, knowledge whatsoever. Though, we are willing to learn.
The flow of the game will be similar to such games as: WordFeud, WordsWithFriends, Rumble etc.
Let me start of by where a lot of searching on the web has gotten us:
We have decided to use CouchDB as a tool for storing information about users, game sessions and other stuff. CouchDB is an open source noSQL database system. The reason is that we have been taught, that it should support a lot off concurring users. Besides, that it scales - we are hoping to go big, of course.
Our CouchDB, is hosted on IrisCouch. IrisCouch is an "in cloud" hosting service designed for running CouchDb.
So, we've got a CouchDB server up and running, and we know the basics on how to query data from the server.
Our biggest confusion right now, is how we should set up the system to work according to best practices. Right now we are at the point where we are able to receive and submit data to the server.
Our game is supposed to have Facebook integration, so that the users can register via our app or through Facebook. After that they can play with random matched opponents, or play with friends. After a match is started, one player will get a set of question to be asked, after he has answered, the other player should be notified, through push notification, that it's their turn. After a few rounds the game is finished.
At this point, we think this might be the best solution for the flow of the application:
A user connects to another user -> a game session is opened as a
document in a database called "games".
The newly created document contains both player names, question,
answers etc
A field named "whos_turn" decides which of the two players turn it is.
After the game has ended, the session is erased.
Again, and as you may see, we are in the dark as of how to really do it, but this is the general idea.
So, my questions goes as following:
Is it best to query the data directly from the iPhone application, or through a web service?
What is the best way to set up the database, to best manage the flow of the application?
Any information, that could lead us closer will be gladly appreciated :)
In advance, thank you!
Olav Gundersen
EDIT#1 : Our Objective-C programmer managed to connect two iPhone devices using CouchDb. The iPhone application consists of a table view, that has a concurrent connection with the database, so that when someone POST to the database, it shows up on the tableview of all the other connected phones. Behold: a severely ineffective chat system.
If is a multiplayer you would need to have the app to communicate to the remote iriscouch.db but I am concerned by the point where you state that neither you or your friends have any database experience. You are willing to learn so I think the best place to start is:
http://guide.couchdb.org/editions/1/en/index.html
There are several issue you might find with scalability if you plan to erase documents continuously. DB Size can be considerable on couchdb and you will need to compact &cleanup the db regularly. But I don't think is a major issue for now as this is at a start up level.
The question "best way to setup the database and best manage the flow of the application" should be addressed by your team. If you do not have someone with any database experience you should try to find someone willing to help you. It should be someone with extensive experience in databases. You might find some fairly reasonable professionals at http://www.odesk.com
In total honestly I don't think you will be successful if you don't have such a figure - either as a freelancer or contributor - to help you having a solid database logic in the game that will ensure a great user experience.
For example: have you considered the latency-delay issue by using a db based in the USA (Iriscouch) vs. where your users are located?
For this reason you might want to do as much as possible client side (embedded database like sqlite or touchDB that is essentially couchDB for iPhone)
For an iPhone application you might want to try TouchDB that is made exactly for that
https://github.com/couchbaselabs/TouchDB-iOS (caveat: being that you need connectivity to check turns etc this might not be the ideal solution but it could work to store some information locally).
To lay this out you would need someone with experience with couchdb to set up a proper, usable application. There is nothing wrong in being enthusiast about your idea but to make it a success you need a technical mind in the database side. Of course you might be well capable to learn this yourself. After reading the CouchDB book you should be in position to create a basic flow to fit your needs.
Of course other more experienced users might come with a more comprehensive answer or a sample layout but I don't think would be the best approach. Even if someone posts a full layout of the doc structure and how to query it how are you going to service the app if something goes awry e.g. sessions don't get deleted, conflicts etc. ? hence my sincere advice to get some ad-hoc expertise for your case.
This might also result in analyzing suitable alternatives. I don't think you should buy into the idea that CouchDB can scale and hence is the best/only option for you (of course this might well be the case and if you feel that is a good option..go for it). For example twitter, google adwords and many other online apps are using mysql to store their data so for sure CouchDB is not the only database that can scale!
I think this demo app could be a good example to follow: iOS Couchbase Demo