skip to Main Content

For a short summary: I am creating an app in xCode (for my resume) and it requires local businesses to enter time slots every week that my App will show in a View Page. I haven’t fully designed my app yet, but I’m trying to figure out for future references how I may possibly do this. Would I use an API? Is their like a developer access that I will have to program that can give the Owners access to enter manually? I just want to know if anyone has done something similar to this before.
Any help is appreciated.

I’ve tried searching for some information online but cannot find the right information for what im doing.

2

Answers


  1. First thing which come to my mind is, hook up your App to Firebase. Let the Businesses create Accounts. Setup a View, where the Businesses could book a slot each week. From there one you could define roles. Business roles and a Admin role with more rights for you. I’d suggest to edit your Post and explain your demands a little bit more in Detail.

    Login or Signup to reply.
  2. I’m assuming many businesses will enter their time slots every week (although I’m not sure what you mean by this) and then users will be able to see all the entered time slots for that week. For this, you’ll need to store all of these time slots somewhere. Databases are a great place to store this sort of stuff as users can download all of it from the database and be shown accurate + consistent data.

    I don’t have much experience with database storage but if you’re a beginner you should look into Firebase. I myself started with Firebase cuz it takes like 10 minutes to setup and get going and it’s free up to 1gb of storage. Later on if your startup does well, you can shift to better data storage solutions, or upgrade your Firebase plan. So yes, you’ll need to use an API.

    Important: If you think you’ll end up switching away from Firebase at some point make sure you write your code in such a way that allows an easy migration. A good way to do this is write a bunch of protocols that describe the API of your own app. Eg.

    protocol NicksDatabase {
        func addTimeSlot(_ timeSlot: TimeSlot) async  // you could return something from these functions that indicate if it was successful or not
        func deleteTimeSlot(_ timeSlot: TimeSlot) async 
    
        associatedtype ID
        func editTimeSlot(slotID: ID, to: TimeSlot) async // idk I just made this one up
    
        func fetchThisWeeksTimeSlots(limit: Int) async -> [TimeSlot]
    }
    

    This will allow you to switch between different databases and the only thing you’ll have to do to update your entire app is to change the class that conforms to the protocol. Eg.

    // I'm not sure about the drawbacks of using globals for this
    // but I think it's more conventional to have this as a property.
    
    let database = NicksFirebaseDatabase()  // old
    let database = NicksBrandNewDatabase()  // new
    

    And magically your entire app is updated.

    Hope this helps and best of luck with your app!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search