Zarran API: A simple API on glitch that was written partially by an AI

Project URL: Glitch :・゚✧
Frontend: https://excited-glacier-knight.glitch.me/

Zarran API is a simple POST request based API. It can handle users, authentication, and (UNTESTED!) matchmaking.

Why?
A lot of people said POST requests didn’t work after the pinging block. After finding they worked fine (:face_with_raised_eyebrow:) I decided to go make an API for the hell of it.

How use?
There’s a few endpoints you can access. The API accepts JSON data, and form data by default.
One example is /api/adduser, which takes a username and password and returns the UUID (The main method of accessing user data).

Why do the 2 modules include ChatGPT in the credits?
Some of the module code was indeed written by ChatGPT. Since it worked, it looked nice, and was fast, I kept it.
Some of it is my own, though. Not matchmaking. I haven’t touched that bull yet, I’m doing that after V2 (Once I’ve tested and fixed all the endpoints).

Have fun working with this pet project! and do not try to make a frontend in HTML and JS oh my god

2 Likes

Awesome project, great idea to bcrypt the passwords! I will try remixing and implementing Authflow passwordless on it.

I did implement authentication tokens, so it’s completely possible to check against a user :slight_smile:

1 Like

Zarran API 1.0
What’s new?
I’ve tested (and fixed) literally EVERYTHING in the API. Everything works fully as intended, all the usual checks work, and Zarran API is now ready-to-go for production enviroments!

How do I use this again?
I’ll post the documentation at a later date. I’ll do that before I start on 1.1…

1 Like

Zarran API 1.1: I’m naming these now. I’m going to call this one Procrastination…
What’s new?
There’s documentation now! Check out the repository. Oh, and the frontend should be done soon. I think (Keyword: Think I)

How do I use this?
RTGD (Read the glitchin’ docs)! You can find them here now that I have them added: Glitch :・゚✧

(Yes, ChatGPT wrote them. It’s honking midnight and I refuse to write documentation this late)

1 Like

Zarran API Frontend v1.0: IT’S HEEEEEERE
As my new years gift to you all, I release the FUNCTIONING Zarran API frontend! Feel free to remix and make it look… well, decent. Please tell me if you do that.

Anyway… The main page (example page) was written by ChatGPT, everything else was written by me without the help of an almighty AI that somehow knows how to fix any JS issue given enough time.

Yeah I suffered making this. Enjoy :slight_smile:
https://excited-glacier-knight.glitch.me/

1 Like

Cool! I’ve made some CSS to style it:

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap');
* {
font-family: 'DM Sans', sans-serif;
}
body {
    max-width: 700px;
    border-radius: 10px;
    margin: 43px auto;
    padding: 50px;
    box-shadow: 0px 0px 0px 100vh rgb(248 249 250 / 99%);
    -webkit-box-shadow: 0px 0px 0px 100vh rgb(248 249 250 / 99%);
    -moz-box-shadow: 0px 0px 0px 200px rgba(248,249,250,0.99);
}
a {
    margin-right: 10px;
}

input {
    margin-bottom: 5px;
    border: 1px solid #00000070;
    border-radius: 4px;
    padding: 3px 5px;
}

button {
    margin-top: 6px;
    background-color: black;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

input:focus, button:focus, select:focus-visible {
    -webkit-box-shadow: 0px 0px 0px 2px #ffffff, 0px 0px 0px 3.6px #000000;
    box-shadow: 0px 0px 0px 2px #ffffff, 0px 0px 0px 3.6px #000000;
    outline: none;
}
/* CSS by tiago rangel: tiagorangel.com */

Zarran API Frontend v1.01: The Styling Update

Tiago’s CSS is now integrated into the “main page”, which is now the default. Looks way better now, thank you Tiago! :smiley:

1 Like

Looks cool, awesome! But seems like the navbar is gone.

Btw, I’m Tiango🤗

Intentional. Will add it back later :slight_smile:

Updated the update post.

1 Like

Zarran API v2.0 Beta 1: The Matchmaking Update
Matchmaking is NOW AVAILABLE via the API call startMatch! It takes a UUID and token.
Once 2 users are in the queue (And each user’s RANK data is within 50 of eachother), you’ll be paired together and given a mock server ID! I haven’t implemented readding the ID, so until it restarts to due to an error you’ll not get that same server again.

Can we talk about this though? No, seriously. There is NO DOCUMENTATION on something like this and it is fucking ass. I tried to ground-up make it, but I failed so I had to resort to modifying ChatGPT code AGAIN.

1 Like

Zarran API v2.0 Beta 2: I hope Akismet stops flagging me already… Oh, and Authflow/Google ID token support
I added support for Authflow to the backend! You can now create users using an Authflow token. I have not documented the new calls yet, so wait until Beta 3 when I clean up the rough edges.

Oh, and hi! This is my home account. Yes, it is still me, the Zarran API creator.

1 Like

Awesome :+1:! Here’s a tip: Authflow Instant adds a real Google button and makes it faster, but Authflow Button is also cool!

1 Like

I decided to use Authflow Button to make things simpler. You help me, I help you.

1 Like

I have to say, this is simply awesome. Gotta use it on the next project I do that has login!
(btw, is it possible to support 2FA with this?)

insert I Was Already Doing That meme here, Alan

1 Like

:joy: I only saw that after I posted that feature idea, while inspecting the code in detail

Yeahhh. Took me a while to finish the encrypted DB- Wait a minute I forgot to post an update log :skull:
Zarran API NPM Modules v1.0: :slight_smile:
Some of the Zarran API code snippets / modules are now NPM modules! Check out zapi-matchmaking and authflow-helper :smiley:

1 Like

Awesome! I published a official package (@authflow-js/verify) for this. (ps: no worries, credits given!)

1 Like

Added a “please use that instead” to the original package. :slight_smile:

1 Like