rrnarayan1 / omni-crosswords

An iOS app that fetches crosswords and allows users to complete them
GNU General Public License v3.0
26 stars 2 forks source link

What JSON format is used for crosswords? #8

Closed iDefault09 closed 1 year ago

iDefault09 commented 1 year ago

Hi, I love Omni Crosswords app, thank you for working on it! I wanted to read the code and try the app, but unfortunately, right now it's impossible to run the app. There is no data model and the DataBuilder.swift file (which I suppose should generate a sample crossword) was updated two years ago.

Could you paste any crossword in JSON format here, and I will figure out the fields and update DataBuilder.swift?

rrnarayan1 commented 1 year ago

DataBuilder.swift isn't meant to be used, even if you did update it, it's not called anywhere (I should just delete this file).

The data model is defined in https://github.com/rrnarayan1/omni-crosswords/blob/master/crosswords/crosswords.xcdatamodeld/crosswords.xcdatamodel/contents

See https://github.com/rrnarayan1/omni-crosswords/blob/master/crosswords/Firebase/JsonToCrossword.swift for how JSON document from Firebase is transformed to the Crossword model.

I believe the app isn't working for you right now because it won't contain the needed permissions to call the Firebase backend (GoogleService-Info.plist is in the .gitignore), so no crosswords will be fetched. I cannot share this file publicly.

Give me a while to see how I can support others wanting to work on this / add instructions to the readme.

iDefault09 commented 1 year ago

I thought I could use DataBuilder.swift to generate a mock crossword instead of Firebase online DB.

What I think would be best to make the app work locally: is to take one random crossword and use it instead of the full online Firestore (full DB of crosswords isn't needed for code improvements by other people).

So instead of DocumentSnapshot use a hardcoded json string? And ask people to remove Firebase manually, it's not big of a deal.

PS and yes the credentials to Firebase should be in .gitignore, that is expected.

rrnarayan1 commented 1 year ago

Yep, I agree with your thinking, and that was what I was planning.

rrnarayan1 commented 1 year ago

Hi @iDefault09 - I have included instructions for how to enable local development in the README. This will enable you to build the app without the Google-Services file, and it will automatically show one crossword in the list that pulls from a local json file. Let me know if you have other questions!