Alright folks, I thought I’d create my own sister thread to @Dynamic_Gravity’s. (linked below) I’ll focus this one more on the backend development and in here, we’ll have more deep-dives on backend, concepts and that sort of stuff.
https://git.covalent.space/varrel/hydrogen-api
Backend is written in Golang (paging @ChrisLifts) and we’re using mysql for the database at the moment. I’ll be sharing API docs in a couple days when the API gets a bit more sorted.
Alright, here’s my first very early stab at creating some self-documenting, self-testing API definitions:
I’ve been working on some of this over the course of the last week, so it’s not all 100% standardized yet, but once I get more of it up and running, I’ll be getting it more in line with how I want it.
@Dynamic_Gravity anything that’s documented here should show up on the mock server. we’re at 1.4% request utilization, the cycle resets on Nov 6.
I’ve got tickets mocked out, I’m going to be working on replies shortly. This will allow you to wire up some frontend stuff against that. Format might change ever so slightly, but it’ll be reflected in the docs before we get a chance to test against an actual API.
So I’ve got a mock server running publicly, but due to the constricted nature of the free tier of postman, we only get 1000 request per month. I’m not going to share that URL because I’d rather not go over that limit faster than I need to. Once I hit that limit, I’ll upgrade to the next tier, but if we can make it a couple months without doing that, it’d be nice.
@dynamic_gravity I’ve finished mocking up all the base routes. If you have a request for a more complex route, please open an issue on the API and I’ll get right on it. If you have a preference, please include the expected data structure, or I’ll make my own.
Some models are missing DEL routes for now. I’ll add them when I get a chance. In the mean time, I think I’m going to spend some time working on actually building some of them out in go.
Alright. End of day 1. Got all the mocks done. Started on actual routes for basic CRUD. You can see my work in the repo if you’re interested. Going to build out a very crude API, then I’ll worry about going back and making it neat, protecting the routes and handling user privs.
Hoping to get the crude V1 complete by EOB Tuesday.
Over the last couple days I made some progress. All of the Create and Read routes are complete, I need to still finish up the Update and Delete routes, but I’ve decided I need to switch it up a bit, writing routes is getting tedious, so I’m building Postman tests for the routes now.
I’ve heard of it, I might have to pull an all-nighter and focus on that one of these days.
GraphQL
Done it before. @Dynamic_Gravity and I actually looked at it briefly for this project, but we decided it was a lot of effort for very little gain. It’s a cool tool, but not the best one for this job.
Upon initial inspection, Insomnia looks like a more open version of Postman. I’ll give it a go, since I need to rebuild a bunch of my testing framework.
Insomnia
I might have to pull an all-nighter and focus on that one
lol
I see you are using Insomnia Designer.
I think your problem comes from the fact that GitHub changed the default branch name from master to main, for obvious reasons.
I got it to work by creating a Blank Document, linking a repo (which has a master branch), commit, push.
Insomnia Designer is used with OpenAPI Spec (OAS).
Just a word of warning: While I like OAS for the ability to define API data models and use the client generators, it is a double edged sword and I wish there would be a less verbose solution.
Moreover, Insomnia Designer is a relatively new product and last time I checked, it was not mature enough for me.
I am fine using VS Code with the OpenAPI plugin to edit my .yml and importing it into Insomnia / Insomnia Designer.
Hope this helps and does not make things too complicated.
Edit:
I just noticed you use GitLab and your repo has a master branch, so nvm my assumption.