WizardRandom
[LARP DB] Welp, ran into one issue that appears it's going to be a minor issue for the front end programmer, but relatively minor. Basically there's going to be a wrapper JSON object called "rootElement" that needs to be removed entirely. The body of a POST or PUT must not contain it.
(^・ェ・^))ノ彡☆
I do have to admit, I'm not entirely sure I understand that rootElement bit in your scheme, but it might be something we need to talk about.
WizardRandom
It's an artifact of the data schema I'm using, but yeah we'll talk. I don't see it as a big deal, but I can't remove it at my end as it gets tacked on with the GET response.
(^・ェ・^))ノ彡☆
I don't think it's something that needs to be there, though.
(^・ェ・^))ノ彡☆
Because I work with JSON quite a bit and I've never seen anything like it, so I'm not even honestly sure what it is?
(^・ェ・^))ノ彡☆
I'm heading to bed and going into surgery in about 5 hours, but we can figure it out one way or the other, know we can. ^^
WizardRandom
ooph, well, hope all goes well! And yeah, it's really just an extra key that gets tacked in when returning a Microsoft JsonDocument class that wraps the outgoing JSON. It appears to be automatically added when the response to the GET happens.
WizardRandom
Like, I'd EXPECT "Fields":{<JSON stuff here>}

But instead it's "Fields":{"rootElement":{<JSON stuff here>}}
(^・ェ・^))ノ彡☆
but rootelement is what like
WizardRandom
That's the thing, Microsoft is tacking it in due to the fact I'm storing data in the Postgres DB as a singular JSON column.
WizardRandom
I've got NOT freaking clue why.
(^・ェ・^))ノ彡☆
could you put an example here
(^・ェ・^))ノ彡☆
so I'm not trying to go back and forth to FB
WizardRandom
sure, here's a small snippet from actual data:
(^・ェ・^))ノ彡☆
I think I know what the problem is but I'm not sure I actually know how to express it
WizardRandom
Here's what gets POSTed
{
"seriesguid": "d230601a-8cc8-11ea-8e54-c386fdbf80e6",
"name": "Nene's Hardsuit",
"typeGuid": "894caf3e-8d4f-11ea-99fe-5ff858a827e9",
"fields":
{"Resilence":"1", "Grade":"0", "Jump":"+1",
"INTEGRITY":"15","HS":"-5", "Energy":"25"}
}
(^・ェ・^))ノ彡☆
you had pics of the results on FB though
WizardRandom
And here's the returned GET:
{ "seriesguid": "d230601a-8cc8-11ea-8e54-c386fdbf80e6",
"name": "Nene's Hardsuit",
"typeGuid": "894caf3e-8d4f-11ea-99fe-5ff858a827e9",
"fields": {
"rootElement": { "HS": "-5", "Jump": "+1", "Grade": "0", "Energy": "25", "INTEGRITY": "15", "Resilence": "1"}
}
WizardRandom
ah, right, one sec
WizardRandom
https://images.plurk.com/5fHcbARa0kGoXT5nO1JYLS.png
(^・ェ・^))ノ彡☆
that doesn't have the rootElement thing in it though?
WizardRandom
https://images.plurk.com/6loHSTWn3j1Bu9RbC4RlCf.png
WizardRandom
This one does, the point is to compare a POST to a GET
(^・ェ・^))ノ彡☆
fixes the spelling of Gauntlet
WizardRandom
I'm cutting and pasting and not caring about fixing issues just yet.
(^・ェ・^))ノ彡☆
I'm just playing XD
WizardRandom
I know
(^・ェ・^))ノ彡☆
uh
(^・ェ・^))ノ彡☆
squints tiredly at your code
(^・ェ・^))ノ彡☆
question
WizardRandom
yes
(^・ェ・^))ノ彡☆
maybe I'm missing something but why isn't it
(^・ェ・^))ノ彡☆
"fields": [
(^・ェ・^))ノ彡☆
like... all that stuff is in fields
(^・ェ・^))ノ彡☆
so like...
(^・ェ・^))ノ彡☆
[ ] ?
(^・ェ・^))ノ彡☆
like all the abilities are in [ ]
WizardRandom
hm,
WizardRandom
right, hm... Let me try that. (you're more experienced working with this than I am, so, if that works, it would be one less thing.
(^・ェ・^))ノ彡☆
I legit super might not be thinking about this right
(^・ェ・^))ノ彡☆
I'm on pain killers and it's 1 am
(^・ェ・^))ノ彡☆
Like another thing I'd want to see is
(^・ェ・^))ノ彡☆
does it do this if you just have one or two items in there?
(^・ェ・^))ノ彡☆
inside fields
WizardRandom
okay one sec: can show that off. And yeah, same issue with square brackets: https://images.plurk.com/65TaF2xHWNaYU2BuR1qGnj.png
(^・ェ・^))ノ彡☆
If you just say have HS and Jump in here
(^・ェ・^))ノ彡☆
does it still do the same thing?
WizardRandom
https://images.plurk.com/2EQ5dP87rga7xEvXuh2lYB.png
WizardRandom
same issue
(^・ェ・^))ノ彡☆
I need to get to sleep, but maybe it has something to do with the actual command you're using to post?
(^・ェ・^))ノ彡☆
Such a strange issue!
WizardRandom
Go to bed, but if you look at the raw JSON in the DB, it's not there. https://images.plurk.com/7brjI6qrTb6fx5Ktx7mhFv.png
WizardRandom
Far as I can tell it's Microsoft being a little shit with the way they handle JsonDocument objects.
WizardRandom
I'm getting some sleep too. Hope all goes well tomorrow!
(^・ェ・^))ノ彡☆
Thanks! Night and sleep well!
Battler
Oh that looks cool.
Battler
Glad this is getting worked on. I just haven't had the time or the fucking mental wherewithal to get anything done with my stuff.
WizardRandom
It's fine, I understand, just at this point I've already got a base DB and basic API functionality going, so we'll just push that all to the side.
Battler
Nah, that's the right thing to do, especially if you've got it. You need any code reviewers to look at stuff and I can give you a hand, though.
WizardRandom
Don't need any code reviewers as of yet, but thanks. Luckily this system is pretty damned straightforward when it comes to relations.
Battler
Yeah, it always was even with the design I had.
WizardRandom
yup
WizardRandom
I think the big game changer is my implementation of JSONb in postgres, which means we can store item cards in the same table, no matter if it's a sword, or a Gundam or a Pokemon.
Battler
Ah, nice
Battler
Oh cool.
WizardRandom
Since the front end would have to know the difference between the types or items anyways and then account for those differences anyways, the overall effect is the same while remaining elegant in backend design.
Battler
We might still have some work for the auth functionality as well, but that shouldn't be difficult. Can I see your schema? I might still have use for my and Dave's stuff for a Mobile app of some sort.
WizardRandom
I have a current schema, but it might change in the future. I'm working with Jantra on that since they'll be working the front end effort and we need to agree on the overall setup.

I'll send it along when I'm done with work. I'm on my work laptop currently.
Battler
OK
WizardRandom
But yeah, if you know of an easy auth setup we can implement using C#, that'd be one less thing on my plate.
WizardRandom
I wouldn't be against throwing my code base on github/gitlab to collaborate.
Battler
Auth0 has strong C# support
WizardRandom
Yeah, was pondering auth0
Battler
Might as well since we already have the account set up for it
WizardRandom
Cool cool.
SmileySkeletor
I hate to be the one to bring this up but there is also a contingent from Otakon LARP that’s been working on something like this, so you may want to inform them as well just so there’s not too much duplication of effort going on
WizardRandom
Well I haven't heard anything from anyone in Otakon in a long long time. And at this point I'm sure I can get this thing running in basic mode by the end of May.
Battler
Last I heard, their stuff is also desktop focused, anyway.
WizardRandom
Yeah, also I haven't seen proof them them that anything at all exists. Only talk, and talk, as they say, is cheap.
Battler
I think they had a registration system going, but I'm not fully sure.
WizardRandom
Yeah, if they want to speak up, they're more than free to do so as I just threw down the gauntlet on the LARP GM's group on Facebook.
Battler
They've never really responded in the past either when we talked about it.
WizardRandom
Like at this point we've been complaining we need this for YEARS. Forgive me if I feel a little bit uncaring if I run a monster truck over work someone else was doing but never shared.
Battler
Oh, I was just thinking: What's the hosting plan for the API server at this point?
WizardRandom
I think we can get by with a bargain basement host setup, (single box +web hosting) since it's going to have maybe a few users hitting it at once. The cost would be comparable to dropbox. I'm willing to front the costs for a year if everyone helps with data entry.
WizardRandom
Unless you have a suggestion?
Battler
I still might be able to write a PDF parser, honestly.
WizardRandom
If you can get that done, I'd love to see the results. that'd save a LOT of time.
Battler
Nah, not really. I was just wondering if you'd thought about it, since it's a bit more resource intensive than Python on the backend. I will offer the use of the www domain for accessing it.
Battler
nexussystem dot net
WizardRandom
Awesome. If you've got a host, then we're golden
WizardRandom
Well domain anyway
Battler
Yeah. I can also see if you can host it on my NAS for testing, if you want. It's got Mono on it, so it can run C#
Battler
Since you're going to need something that's externally routable to fully work with Auth0, I believe
Rabbit Witch
I setup an s3 bucket for saving images
Rabbit Witch
Maybe this weekend I'll refamilarize myslef with everything I did
Battler
Same. I'll see if I can hammer out a basic PDF Extractor this week.
WizardRandom
Good, I haven't done anything with images. I've got columns in the DB for pathing purposes, but that's in.
Battler
That should honestly be all you need in that situation. The images should be left up to the front end.
WizardRandom
And yeah, see if you can get the PDF extractor going. I tried it awhile back and failed miserably, so, if you can it'd be a lot of man-hours saved.
Rabbit Witch
What I did with my test data is that it shoves the image into the bucket and then would pull the bucket location from the data object
Rabbit Witch
so instead of messing with blobs and shit we can just reference where in the bucked the image is and save that in the database
WizardRandom
:;thumbs up:; that's pretty much what i assumed the plan would be. I've worked with blobs before, don't wanna do that again.
WizardRandom
The "img" columns I've set up are for strings which are paths to your bucket.
Battler
Oh yeah, blobs would just slow the database down.
WizardRandom
Yup
Battler
If I do Java would you be able to understand it?
WizardRandom
... lil bit? Been a long time.
WizardRandom
depends how in depth you need me to understand.
Battler
I mean, if you know C# you'll probably know the Java I'm writing. I just don't want to learn the basics of C# to get the project going, since that'd throw off my interest.
Battler
Basically, I'm trying to manage my ADHD right now so I can strike while the iron is hot.
WizardRandom
Do what you need to do to get it going. I'll worry about understand Java if you're not good with C#.
WizardRandom
And to be fair, if you get the parser going where you can just dump out a huge string, I can handle hooking it up to the DB and letting it rip .
Battler
OK
WizardRandom
::thumbs up:: Good luck, cause I had NONE awhile back.
Battler
What did you use to do it?
WizardRandom
I honestly forget, it was like, 6 years ago I made the attempt.
Battler
Ah, OK.
WizardRandom
that was before I learned C#
Battler
I know that a long time ago, Irene had a somewhat basic parser, but it was written in LISP and is useless to any of us
Battler
And it only got the stats out
WizardRandom
yeah. Getting special abilities out is going to be the big hurdle since there's no set format.
WizardRandom
But yeah, do your best.
WizardRandom
worse comes to worst we just go with divying up data entry. We'd likely have enough people with access to the DB that each person would only need to do about 30-50 sheets.
Battler
Or at least have them enter it in a spreadsheet, which might be faster for initial import
WizardRandom
But if we get sheet creation as an ability of the front-end, can't we make it so it's cut and paste as easily as into a spreadsheet?
Battler
In the end, that's likely going to be up to you and Holly.
Battler
For an initial import, I'd think having them put into a spreadsheet might be better, if only because it wouldn't involve waiting to post and get responses back, and it could all be done in bulk
WizardRandom
::shrug:: it's 6 of one, half dozen of the other, far as I'm concerned. The work needed to get everything formatted in a spreadsheet would be the same as cutting and pasting into a web form, from my perspective. DB posting speed is largely insignificant with the work that needs to be done for data entry.
WizardRandom
But again, if you can get a parser going, it'll speed the process immeasurably, no matter where the data winds up being funneled.
WizardRandom
Also can I just ask how the FUCK is it I'm acting like a project lead right now????!
annakratos
"Microsoft being a little shit" killed me bc welcome to fucking microsoft
annakratos
it seems like you guys have most of the db modeling already covered but I can def help with some data entry shit if and when it comes to that
WizardRandom
::thumbs-up ::
載入新的回覆