Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e0fae23
refactor: switch to `tomllib`, switch to `pyproject.toml` and `uv` an…
THEGOLDENPRO Mar 29, 2026
2be258b
uhhhh
THEGOLDENPRO Mar 29, 2026
aa7fbb1
refactor: switch to tailwindcss v4
THEGOLDENPRO Mar 29, 2026
dd93f9c
chore: sync lock file
THEGOLDENPRO Mar 29, 2026
3d2c8ec
feat: apply constraint for python 3.13.x and update ruff workflow
THEGOLDENPRO Mar 29, 2026
2367269
fix(docker): locked cannot be used with frozen
THEGOLDENPRO Mar 29, 2026
9125221
fix(docker): uv run is required
THEGOLDENPRO Mar 29, 2026
f53cca1
fix(docker): uv pulls dev deps when uv run invoked
THEGOLDENPRO Mar 29, 2026
5360d91
feat(pyproject): remove meow-inator 500 and update dependencies
THEGOLDENPRO Apr 17, 2026
eac45d1
refactor!: introduce aiohttp session wrapper, introduce api for markd…
THEGOLDENPRO Apr 17, 2026
d18a8e8
feat: remove less relevant or less "cool" projects
THEGOLDENPRO Apr 17, 2026
94b3988
feat: add mouse clicks on buttons and hyprlinks
THEGOLDENPRO Apr 17, 2026
6839094
feat: mouse click script should be loaded on all pages
THEGOLDENPRO Apr 17, 2026
bca15b9
feat: add music player, add more projects card and refactor other par…
THEGOLDENPRO Apr 17, 2026
9e66a2e
fix: should be iteration
THEGOLDENPRO Apr 17, 2026
abed135
chore: version bump
THEGOLDENPRO Apr 17, 2026
63408f4
feat: remove music player on mobile layout and improve colours
THEGOLDENPRO Apr 17, 2026
e914245
feat: add debug mode env and improve tablet and mobile responsiveness
THEGOLDENPRO Apr 18, 2026
c3a9b06
feat: improve button colour
THEGOLDENPRO Apr 18, 2026
459ac23
feat: increase music volume
THEGOLDENPRO Apr 18, 2026
9fdfc68
fix: music player song title disappears when played for the second time
THEGOLDENPRO Apr 18, 2026
63494e4
fix: should be `src` in ty config and fix some ty checking errors
THEGOLDENPRO Apr 18, 2026
a28252a
fix: mouse click script was not loading on other pages
THEGOLDENPRO Apr 18, 2026
abb1d40
feat: improve and reformat about me section
THEGOLDENPRO May 4, 2026
f2906ee
feat: improve colours and add randomly picked songs
THEGOLDENPRO Jul 13, 2026
dd64516
feat: add info window, add two new songs and improve formatting
THEGOLDENPRO Jul 14, 2026
53565a1
feat: check if anime response is empty dict
THEGOLDENPRO Jul 14, 2026
de7d442
fix: Attribute `get_text` is not defined on `None` in union `Tag | None`
THEGOLDENPRO Jul 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 14 additions & 21 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
name: Ruff check
name: ruff check

on:
push:
workflow_dispatch:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
ruff_check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: python -m venv .venv && source .venv/bin/activate
- run: python -m pip install --group dev

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt

- name: Run ruff check
run: ruff check .
- name: Run ruff check
run: ruff check --output-format=github .
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ __pycache__
node_modules
package-lock.json
.env
.venv
jikan4snek_cache
config.xml
.ruff_cache
config.toml
config.toml
*.egg-info
package.json
8 changes: 0 additions & 8 deletions .vscode/settings.json

This file was deleted.

13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM python:3.11-slim-bookworm
FROM python:3.13.12-slim-bookworm

COPY --from=ghcr.io/astral-sh/uv:0.11.2 /uv /uvx /bin/

USER root

Expand All @@ -10,15 +12,18 @@ COPY /templates ./templates
COPY /markdown ./markdown

COPY input.css .
COPY requirements.txt .
COPY pyproject.toml .
COPY static_config.toml .
COPY tailwind.config.js .

RUN apt-get update && apt-get install -y git

RUN pip install -r requirements.txt
ENV UV_NO_DEV=1

COPY uv.lock .
RUN uv sync --locked

EXPOSE 8000
ENV LISTEN_PORT=8000

CMD ["uvicorn", "app.main:app", "--host=0.0.0.0", "--proxy-headers"]
CMD ["uv", "run", "uvicorn", "app.main:app", "--host=0.0.0.0", "--proxy-headers"]
20 changes: 0 additions & 20 deletions Makefile

This file was deleted.

7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

## Prerequisites
- ~~[NodeJS](https://nodejs.org/en)~~ (no longer needed)
- ~~[Python 3.8+](https://www.python.org/)~~ (Might still work on 3.8 but versions below 3.9 are now depreacted)
- [Python 3.9+](https://www.python.org/)
- [Make](https://www.gnu.org/software/make/) (Optional)
- ~~[Python 3.8+](https://www.python.org/)~~ (is now constrained to one major python version)
- [Python 3.13](https://www.python.org/)

## Run Locally
> [!WARNING]
Expand Down Expand Up @@ -50,4 +49,4 @@ cp config.template.toml config.toml
6. RUN!!!!
```sh
fastapi dev
```
```
2 changes: 1 addition & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.3.17"
__version__ = "1.3.30"
92 changes: 0 additions & 92 deletions app/anime.py

This file was deleted.

102 changes: 102 additions & 0 deletions app/anime_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import typing

import logging
from datetime import datetime, timedelta

from .http_client import HTTPClient

__all__ = ()

logger = logging.getLogger(__name__)

class AnimeAPI():
def __init__(self, username: str) -> None:
self.username = username

self.__history_cache: tuple[float, dict[str, str]] = (0, {})
self.__updates_cache: tuple[float, dict[str, str]] = (0, {})

self.cache_expire = timedelta(minutes = 5)

async def get_anime_status(self, http_client: HTTPClient) -> list[dict]:
anime_list = []

mal_history = await self.__get_history(http_client)
mal_updates = await self.__get_updates(http_client)

if not mal_updates == {}:

for anime_update in mal_updates["data"]["anime"]:
action = ""

status = anime_update["status"].lower()

if status == "watching":
continue

elif status == "plan to watch":
action = "Planned to watch"

elif status == "completed":
action = "Completed"

anime_list.append(
{
"action": action,
"url": anime_update["entry"]["url"],
"title": anime_update["entry"]["title"],
"date": datetime.fromisoformat(anime_update["date"]).strftime("%b %d %Y"),
"date_timestamp": datetime.fromisoformat(anime_update["date"]).timestamp()
}
)

if not mal_history == {}:
anime_list += [
{
"action": f"Watched episode {anime['increment']} of",
"url": anime["entry"]["url"],
"title": anime["entry"]["name"],
"date": datetime.fromisoformat(anime["date"]).strftime("%b %d %Y"),
"date_timestamp": datetime.fromisoformat(anime["date"]).timestamp()
} for anime in mal_history["data"][:20]
]

anime_list.sort(key = lambda x: x["date_timestamp"], reverse = True)

return anime_list

async def __get_history(self, http_client: HTTPClient) -> dict[str, str]:
current_timestamp = datetime.now().timestamp()

if current_timestamp > self.__history_cache[0]:
http_session = await http_client.get_http_session()

async with http_session.get(f"https://api.jikan.moe/v4/users/{self.username}/history") as response:
if not response.ok:
logger.error(f"Received unsuccessful response from jikan! Response: {response}")

data = typing.cast(dict, val = await response.json() if response.ok else {})

self.__history_cache = (
current_timestamp + self.cache_expire.seconds, data
)

return self.__history_cache[1]

async def __get_updates(self, http_client: HTTPClient) -> dict[str, str]:
current_timestamp = datetime.now().timestamp()

if current_timestamp > self.__updates_cache[0]:
http_session = await http_client.get_http_session()

async with http_session.get(f"https://api.jikan.moe/v4/users/{self.username}/userupdates") as response:
if not response.ok:
logger.error(f"Received unsuccessful response from jikan! Response: {response}")

data = typing.cast(dict, val = await response.json() if response.ok else {})

self.__updates_cache = (
current_timestamp + self.cache_expire.seconds, data
)

return self.__updates_cache[1]
13 changes: 0 additions & 13 deletions app/async_http_client.py

This file was deleted.

16 changes: 8 additions & 8 deletions app/goldy_exe_api.py → app/blog_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@

from datetime import datetime

from . import constants
from .async_http_client import get_http_client
from .http_client import HTTPClient
from .constants import BLOG_CDN_URL, BLOG_API_URL

__all__ = ()

class GoldyEXEAPI():
class BlogAPI():
def __init__(self) -> None:
self.blogs_data: Tuple[int, list] = (0.0, [])
self.blogs_data: Tuple[float, list] = (0.0, [])

async def get_blog_posts(self, limit: Optional[int] = None) -> List[dict]:
async def get_blog_posts(self, http_client: HTTPClient, limit: Optional[int] = None) -> List[dict]:
params = {}

if limit is not None:
Expand All @@ -24,15 +24,15 @@ async def get_blog_posts(self, limit: Optional[int] = None) -> List[dict]:
now = datetime.now().timestamp()

if now > self.blogs_data[0] + 60 * 60 * 12: # 12 hours
http_client = await get_http_client()
http_session = await http_client.get_http_session()

async with http_client.request("GET", constants.BLOG_API_URL + "/posts", params = params) as r:
async with http_session.request("GET", BLOG_API_URL + "/posts", params = params) as r:
if r.ok:
blog_posts = [
{
"id": post["id"],
"name": post["name"],
"thumbnail_url": constants.BLOG_CDN_URL + post["thumbnail"] if post["thumbnail"] is not None else None,
"thumbnail_url": BLOG_CDN_URL + post["thumbnail"] if post["thumbnail"] is not None else None,
"date_added": datetime.fromisoformat(post["date_added"]).strftime("%b %d %Y")
} for post in await r.json()
]
Expand Down
Loading