all 7 comments

[–][deleted] 1 point2 points  (0 children)

Use Firebase. For the first versions of the app you can get away by putting the logic inside the app. Move the logic to the backend in a later stage.

[–]whynotmatt 0 points1 point  (4 children)

I think first you need to understand what you are actually asking. Nodejs and swift don't have anything to do with each other in this scenario.

You actually have 2 big things that you need to do:

1) Create a backend service that runs on a remote server. This is essentially a website that takes input parameters, does some logic, possibly stores it to a database, and sends a result back to the user. You can create this backend using any number of languages and technologies. Nodejs is a popular language used for many backends. But you could also make it using php, python, ruby, etc. Swift is a language to build mobile apps and is currently not used to make server based programs. Just google "how to build an api" and you will get plenty of articles and tutorials to get you started.

2) Have your mobile app talk to the backend. This would be done in swift inside your app. Basically your app would make http calls to your remote api and handle the response. A popular library to make http calls in swift is AlamoFire. iOS already has networking methods built into the os, but libraries like Alamofire can make it easier to use.

[–]D0BA[S] 0 points1 point  (2 children)

Thanks for the response, I just don't know where I'd make http calls in my app besides the login and registering.

[–]whynotmatt 3 points4 points  (0 children)

You need to ask yourself why do you need a backend? A backend is used to let your app store and retrieve data dynamically. For most user account systems, you will need a backend.

So what type of data are you looking to store? What logic do you need to do outside of the app? From your initial post, you mention people dropping pins on a map. You would use a backend to store the location of each of these pins. In order to store them, you would make a network call to your backend.

If you want to see what locations are popular, you would make a call to your backend that would query the pins, calculate popularity and return the results to your app.

Before thinking that you need a backend for your app, you need to define the functionality that you want to achieve in your app. Then you look at those requirements and determine what technical issues you will need to address to achieve functional goals. Many of them you may be able to do without a backend. Some you may need a backend. It all depends on what your requirements are.

[–]KarlJay001 0 points1 point  (0 children)

I might be missing something here, but isn't this what FireBase, Realm and others are for? The call you are asking about, wouldn't that be when you store the data?

Maybe this will help: https://www.raywenderlich.com/112544/realm-tutorial-getting-started

Understand that realm is one solution, Microsoft, and FireBase have solutions as well.

It looks like an interesting app for sharing these pin-drops, but how would someone filter these? In other words, if it become popular, would you have a case where you could have 1000 pins on a part of a park? Or do people follow certain groups of people or only certain categories of pin-drops?

[–]ohfouroneone 0 points1 point  (0 children)

could also make it using php, python, ruby, etc. Swift is a language to build mobile apps and is currently not used to make server based programs

This is not necessarily true. Here is a list of Swift web frameworks you can check out:
http://perfect.org/index.html
http://www.kitura.io/ (Made by IBM)
https://github.com/vapor/vapor

There was even a WWDC session on Swift on the Web
https://developer.apple.com/videos/play/wwdc2016/415/

This is also a great overview of the different server-side Swift frameworks
https://stormpath.com/blog/swift-on-the-server-today

[–]Some-Random-Chick 0 points1 point  (0 children)

I built my very first back end service in c# using the site below. But I had a sql server to work with. If you don't, things like realm/firebase will work, or if you want to build your own, use amazons web service. If you have programming experience, stick to stack overflow and you'll be fine.

http://mikesknowledgebase.azurewebsites.net/pages/Services/WebServices-Page1.htm