2.0
What's Changed
- Replace Nuxt/Express with Sveltekit/Fastify by @MiraiSubject in #2
New Contributors
- @MiraiSubject made their first contribution in #2
This is a breaking change for consumers of the previous Nuxt version.
The migration to SvelteKit and Fastify is complete now.
This project is now a monorepo with 2 components:
- discordbot, which is Discord bot on a Fastify Server listening on a Unix Socket
- webstack, which is SvelteKit full stack application doing all of the OAuth2 backend logic as well as serving the frontend.
Major Changes
This project has an official name now: Cosette Lite.
Stack:
- Minimum Node.js version is now 18.13
- Framework changed from Nuxt to SvelteKit
- Removed backend Express
- Add Fastify for IPC between the Discord bot and SvelteKit through a unix socket
- Changed package manager from yarn to pnpm
- Added Turborepo with pnpm-workspaces for monorepo management
- Add vitest & playwright for future testing opportunities.
Fixes:
- Reason now gets properly displayed for manual verification
- Other errors are now properly displayed on the user's side too
- Not reliant on passport-osu and passport in general anymore.
- All the OAuth2 code is now written using
fetch
and SvelteKit's native server.
- All the OAuth2 code is now written using
Minor fixes
- on the
done
page osu! Tournament Hub was hardcoded.
Advantages
- No longer required to use Redis or in-memory cookie processing in the backend. Cookies are now fully stateless.
- You get to benefit from all of Svelte's advantages, while keeping SSR.
- Less dependencies for a lighter package.
Disadvantages
- Learning a new syntax (Vue --> Svelte)
- Native Windows compatibility is dropped due to the usage of unix sockets. WSL 2 is still supported.
- More complex project structure (this is more subjective for people)
Migrating from vue2/nuxt-based oth-verification
If you only modified the config.json
file then all you have to do is move the set configuration to the file in packages/config/config.ts
.
Some important notes regarding the config.json
:
- domains is removed: It's not required anymore for CORS, everything is internalised.
- dev, https is removed: It's not used anymore.
Important migration notes:
- pnpm is now the chosen package manager due to the project becoming a monorepo with two components.
- turborepo (
turbo
) is now a requirement for the same aforementioned reason - Native Windows is not supported anymore due to the usage of Unix Sockets for communication between the Discord bot and the web application.
- Workaround: modify the fastify server to create an http server and point the web application to the same URLs. Make sure to properly configure your firewall and/or secure the endpoints if you're going this route.
Any custom modifications made in the Nuxt application will be lost and have to be rewritten using Svelte. Style modifications can easily be migrated if you only lightly modified your instance.
If for any reason you'd like to reference the old Nuxt version of this application you can do so here.
The future of this project
- The plan is to commit to using Svelte as the frontend language of choice for the foreseeable future. SvelteKit by itself is relatively new and it will likely be a while until we see an EOL on the current version.
- I will not commit to using unix sockets in the long term, for now this is what I considered the best case for most environments. I am aware that this likely brings compatibility issues when deploying to Vercel or similar platforms.
- I have been considering changing the Discord bot component for a Rust equivalent version, but on the scale that most of us work at there will be no benefits whatsoever, so for now this won't happen.
- In the undefined future I might try to make it easier to use an
npx
template or similar to scaffold a new project with the configuration burned in so all you have to do is run the build scripts and deploy.
Full Changelog: 1.0...2.0