wysi-inc / web

Unofficial player statistics and song browser website for osu!
https://wysi727.com
MIT License
14 stars 4 forks source link
htmx osu-api osugame rythm-game typescript

Translations

If you want to help translating the site there is a crowdin project with all the words to translate, contribute there and it will get added whenever i have time :P

If your language is not on the list, DM me and i'll add it

Contribute

Prerequisites

Setup

Create .env file from .example.env:

cp .example.env .env

then change the dummy values in .env to your real ones. (CROWDIN and KOFI are not needed to run the project)

Run the project

To install dependencies:

bun install

To run there is 2 scripts:

bun run dev # runs the project
bun run css # regenerates the css for tailwind

you need to be running both scripts.

Guidelines

Only a couple things here:

(some of this i haven't been following myself but lets try to do it from now on)

File Structure

Code

Components should use the function(){} syntax and not () => {}. It would look something like this:

function Example(p: { a: string, b: number, c: Something<T> }) {
    return (<>
        <div>
            {a} and {b}
        </div>
    </>);
}

export default Example;

Props type should be defined on the arguments itself, unless either the type needs to be exported or its extremly complex (20+ values) in which it can also be defined elsewhere:

type SomeType = {
    a: string, 
    b: number, 
    c: Something<T> 
};

function Example(p: SomeType) {
    return (<>
        <div>
            {a} and {b}
        </div>
    </>);
}

export default Example;

notice that all component returns are structured with (<></>) unless its a oneline component <></> is prefered.