A reimplementation of that one website in Fresh.js
Find a file
2023-09-19 14:42:54 +08:00
.codesandbox Fix conflicts 2023-09-11 03:17:12 +00:00
.devcontainer Fix global statistics not being hydrated properly 2023-09-19 01:29:06 +00:00
.vscode Properly encode responses 2023-09-11 04:57:06 +00:00
components Finally style the button 2023-09-19 11:57:14 +08:00
home_content This should allow internationalization later on 2023-09-19 14:32:38 +08:00
islands More styling changes 2023-09-19 14:42:54 +08:00
routes More styling changes 2023-09-19 14:42:54 +08:00
shared Finally figure out how to increment this lol 2023-09-12 06:38:05 +00:00
static refactor(islands, routes): remove ScrollingMascot and add animateMascot function to CounterCard 2023-09-19 02:39:17 +00:00
.gitignore Initial Commit 2023-09-10 20:22:22 +08:00
deno.json This should allow internationalization later on 2023-09-19 14:32:38 +08:00
dev.ts Initial Commit 2023-09-10 20:22:22 +08:00
fresh.config.ts Initial Commit 2023-09-10 20:22:22 +08:00
fresh.gen.ts Add le license 2023-09-19 13:53:35 +08:00
LICENSE Add le license 2023-09-19 13:53:35 +08:00
main.ts Initial Commit 2023-09-10 20:22:22 +08:00
README.md Finally do something with this template README 2023-09-19 11:06:41 +08:00
twind.config.ts Initial Commit 2023-09-10 20:22:22 +08:00

Herta Kuru (v2)!

This is a proof-of-concept implementation of duiqt/herta_kuru with a global statistics feed, this time, it's a little more secure!

Background

Around a while ago, the original website's global statistics screen had been removed due to network abuse. I started investigating ways to reimplement this (embarassingly I made a PR that just adds a single useless line in the API), so I spent a few more weeks finding a way to implement it, until I got bored, and then I picked it up again.

The new system I implemented works using the following:

  • Using BroadcastChannels - we can send SSEs to update the counter, and it only updates on mutation, so this is practically realtime.
  • No websockets, everything is done using Server Sent Events (SSEs) using event streams.
  • No API is actually exposed to the user, so no one can just take the statistics endpoint and just spam it, because the statistics server is also the website.
  • POSTing to the API is delayed by 5000ms (5s) before its submitted to the API in the frontend. While the provider does allow this, its due diligence to only submit it when there's inactivity.

Usage

Make sure to install Deno: https://deno.land/manual/getting_started/installation

Then start the project:

deno task start

This will watch the project directory and restart as necessary.

Credits

Original website by @duiqt, All Rights Reserved. Kuru-kuru gif is by @Seseren_kr. All rights Reserved.

Uses some assets from Honkai Star Rail. Copyright Cognosphere, All Rights Reserved. This website is not affiliated with Cognosphere/miHoYo.