Devember in October - Project Hydrogen API - A Ticketing System

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.

API Docs:

3 Likes

Nice. Ay fam for Auth check out

:wink:

1 Like

Already using it. :wink:

image

I know my way around auth.

2 Likes

Nice. I haven’t explored everything yet :stuck_out_tongue_winking_eye:

1 Like

Can you fix those urls please? They still point to the old name.

1 Like

Yep, just did that.

Handy one-liner sed command for those who need to go through and fix up package imports that have changed:

find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's.lukeb/ticket-system-api.lukeb/hydrogen-api.g'
2 Likes

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.

1 Like

Perfect, thanks!

1 Like

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.

2 Likes

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.

1 Like

Thanks! For now you can ignore DEL just focus on PUT.

1 Like

Yeah, for sure.

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.

Update:

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.

Little preview:

1 Like

I can recommend insomnia (https://insomnia.rest) for API Desgin / Client.
Much less bloated than Postman. ^^

Moreover, you might want to have a look at OpenAPI.
If you are out for a challenge, try writing a GraphQL backend.

1 Like

Insomnia

I’ll have a look at it.

OpenAPI

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.

1 Like

@m1ckey can you help me out here? I’m looking at insomnia and it looks alright, but I can’t for the life of me get Git Sync to work.

When you connect a repo and pull to get the latest from master, it throws an error: “unable to expand reference master”

Now, I’m lost because when I try to create a new project from git clone, it throws a fit because I have no insomnia data in there yet.

So it seems to me that insomnia has no workflow that allows for using it with an existing project.

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.

2 Likes

lol really