Node server hosting

Discussion in 'iOS Programming' started by patent10021, Mar 13, 2016.

  1. patent10021 macrumors 68020

    patent10021

    Joined:
    Apr 23, 2004
    #1
    Right now I'm just using localhost for my own Node server testing but what if I want to distribute an app in TestFlight so testers can experience a chat app simulation and view mock/static chat user avatars, chat user usernames, chat user lat.long. What do you recommend to host the Node server? Heroku or Amazon? After I have Node server hosting how do I access it for testing in the Terminal?

    And for tools is there something for Atom that can push localhost updates to the live Node server? Can a Node server be hosted on GitHub? That way my local Git can update the live server.

    Lastly, right now I just have simple properties like username and comments. I guess

    Code:
    var comments = [
      {
        username: "osaka123",
        comment: "This video was good"
      }
    ];
    I guess username and comment are built into js so what about avatar and location? When you have properties like username avatars that require images and username lat.log data how do you write that and where do you put the avatar images?

    Or maybe what I should be asking is how do you create a user object? So user12354 has a username of "dave123"; location of "-34.0, 123.00"; avatar "stallone.jpg".
     
  2. AxoNeuron macrumors 65816

    AxoNeuron

    Joined:
    Apr 22, 2012
    Location:
    The Left Coast
    #2
    I would suggest using an Amazon AWS EC2 Linux instance to host the Node.js server. I would suggest using Bitbucket to host the actual code.

    There are some Atom packages that will let you sync all of the files in a folder to another computer, which could be used to sync your Node server to AWS. But I would advise against it for sure. Do minute-to-minute testing on localhost, and when you are happy with it, commit it to Bitbucket and run a git pull on the EC2 instance.

    With the username thing, are you saying that you don't know how to structure the user accounts data model? You should probably have a users.js source file, with all the properties and functions related to user accounts. You should also have a Users collection (mongoDB) or table (SQL) with all the user account details saved. With Avatars, you should probably use AWS S3 to store the actual .png files (use the AWS SDK for iOS to do the uploading), and just save the filename URL in your database as a property on the user account object.

    MongoDB has some pretty awesome geo features, you would store the lat/long as a GeoJSON object in the database. You might automatically generate a new collection/table every time a user creates a new account and save all the GPS coordinates for that user in that collection, since this can quickly become a huge amount of data if you intend to save all of it.
     
  3. patent10021 thread starter macrumors 68020

    patent10021

    Joined:
    Apr 23, 2004
    #3
    lol That's a big learning curve just to set up 5 mock user accounts. I just want to create 5 users with avatars, geo, username, for the purpose of presenting a proof of concept for a key feature I created for the app. The user info is just for show. The 5 user objects can be static.

    The key feature I want to present relates to the users' geo info so I would need to get the 5 geo sets and place pins on a map for each user with their avatar as a pin.
     
  4. AxoNeuron macrumors 65816

    AxoNeuron

    Joined:
    Apr 22, 2012
    Location:
    The Left Coast
    #4
    It's not as complicated as it all sounds. If you do eventually intend to have users accounts, save coordinates to a DB, etc. then you might as well start learning all that stuff now.
     
  5. firewood, Mar 22, 2016
    Last edited: Mar 22, 2016

    firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #5
    What I did:

    First I setup my server on a Raspberry Pi running Linux at home, and got everything working. I did all the setup on the Pi using Terminal from my Mac, so I could record all the steps needed to get the Pi server running. There are plenty of tutorials online showing how to setup a node.js server on a Pi. It's not that many lines of commands needed.

    Then I rented a cheap $5/mo Linux VPS in the cloud, and re-ran my setup commands on it. Pushed my database to the VPS from the Pi using ssh and scp, and restarted services. Done.

    Obviously not scalable if the iOS app becomes popular, but it's only being used by a few people for testing and playing.
     
  6. patent10021, Mar 23, 2016
    Last edited: Mar 23, 2016

    patent10021 thread starter macrumors 68020

    patent10021

    Joined:
    Apr 23, 2004
    #6
    Why Bitbucket over GitHub? BTW, what about Parse Open Server with Heroku for a solution?
     
  7. AxoNeuron macrumors 65816

    AxoNeuron

    Joined:
    Apr 22, 2012
    Location:
    The Left Coast
    #7
    For a huge number of newer programmers, Parse is a bad idea. It can inspire some very bad programming habits and eventually can cause apps to become a real mess. If I were you...I would avoid Parse like the plague. Just learn Node.js and mongodb. It's not that hard at all and it definitely pays to know it (literally)
     
  8. tyche macrumors 6502

    Joined:
    Jul 30, 2010
    #8
    For a paid solution, either. For a free option, GitHub is public visible only. Bitbucket allows private repos.
     

Share This Page