This repository contains the source code for the Guzek UK API, which is used to power the Guzek UK Website -- my personal homepage. It has general website-related routes, such as page content for my custom-made content management system, the entire backend of LiveSeries, a public torrent indexer and scraper, and much more.
This repository contains only the necessary lightweight public-facing APIs. It used to contain user authentication, but that has been moved to a separate server.
Fun fact: this API's first implementation was as a JSON file serving as the database, and raw Node.JS http server code. It's now a MariaDB database operated by Sequelize, an ORM for JS/TS -- yes, it's still based on Node.JS.
Below is a list of accessible API routes, all of which use a base of https://api.guzek.uk.
Permissions: public
Returns an array of pages to be displayed in the website navbar.
Parameters:
lang
(required):EN
orPL
-- the language of the page titles.
Returns the HTML body content for that page, if it exists. Parameters same as for GET /pages
.
Permissions: public
Returns a dictionary of endpoint-timestamp pairs. For each endpoint, the UNIX timestamp represents the last modification date of any resource behind that API endpoint.
It ignores the /logs
endpoint as well as itself (/updated
); i.e. these endpoints are not present in the response body.
Permissions: admin only
All sub-endpoints return an object containing a date
field and a logs
field, where logs
is an array of JSON-formatted log entries.
Returns all logs (except for error-level logs) made on the specified date. The date must be specified as a string in such a way that JavaScript's new Date()
constructor can parse it. The date
field is set to the date in ISO 8601 format.
Returns all logs ever made with level error
. The date
field is set to "error"
.
This parent endpoint is shared by the LiveSeries decentralised server.
Permissions: admin only
Get all watched episode data stored in the database.
Permissions: authenticated only
Get all of the logged in user's watched episodes.
Sets the logged in user's watched episodes in the given season of the given TV show, where the ID is the numerical ID from the Episodate API.
Permissions: admin only
Reads all user's liked and subscribed shows.
Permissions: authenticated only
Reads the logged in user's liked and subscribed shows, as arrays of show IDs.
Adds or removes (depending on request method) the show ID from the given list specified by type
, where type
is either liked
or subscribed
.
Permissions: authenticated only
Reads all Tu Lałem entries or creates a new one, depending on the request method. New entries must be JSON objects with key coordinates
and value in the form of a two-value array (geographical coordinates).
Tu Lałem is a currently-private dormant project, which may or may not be revisited in the future.
This repository isn't really meant to be cloned or downloaded by anyone, it's just where I keep the source code so I can develop from different locations. If you read this README, say hi!