-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to TypeScript and express & Add stats API #1
Conversation
I can't request more than one reviewer at a time in a private repository, so I'll just ping @Ryujinx/developers and hope you'll take a look. :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sensible, just one comment.
Setup environment for: - Typescript - express with ejs as the view engine
GitHub supports pnpm for dependabot natively now: https://github.blog/changelog/2023-06-12-dependabot-version-updates-now-supports-pnpm/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good here.
@riperiperi the latest changes were made for better Nix compatibility. Since these changes are now finished, feel free to take a look and review these as well. |
This should be the last thing that needs to be done before we can make this repo public.
Deployment notes
@marysaka make sure to block public access to
/info
, it's just intended for health checks that could be used by a Kubernetes cluster for example. I wanted to add health checks for Docker as well, but we can only use commands for that and the node image does not have curl.Overview
The change to TypeScript was done for the server code, so it's easier to maintain. The static website code is still plain JavaScript as I didn't want to change too many things at once and the main goal of this PR was to get the stats API working again.
I also decided to use pnpm instead of npm for package management, since it's a lot faster and feels a little more modern.
In case dependabot creates update PRs a workflow will be triggered to update the(Dependabot now natively supports pnpm as well.)pnpm-lock.yaml
as well, so it shouldn't break due to dependency updates.API changes
The new API is now using express and a Redis client to read the data provided by the LDN server.
Since the website and the LDN server have been split we needed to come up with a new way to provide stats for the website.
The API itself changed minimally and only in places where it was possible without breaking existing Ryujinx LDN builds.
The LDN server has already been adapted to write the data into a Redis database nearly in real time.
Possible future changes
Since we are now using express and TypeScript we can polish this website a lot more and potentially get rid of all the JavaScript with the help of a template engine like EJS.
By opening this repository to the public we might also see some external contributors with new ideas, so I hope these changes also make it easy to work with the website and won't be a hindrance to anyone who is interested.