I don't think there's anything that's outright "wrong" about the current structure of the project, but have been thinking about making the following changes:
Lib
The lib
folder keeps growing more and more, with files and many subfolders. Been thinking about moving the folders within it, out of it, so they'd live under src
instead of lib
. This change would make it so you don't have to open lib
before opening something like db
or trpc
, which each contain many other files and subfolders.
How would this look like?
Current
.
└── src/
├── components
└── lib/
├── classes
├── db
├── env
├── stores
├── trpc
├── constants.ts
├── jwt.ts
├── modal-registry.ts
├── paypal.ts
├── schemas.ts
├── server-utils.ts
├── types.ts
└── utils.ts
Proposed
.
└── src/
├── components
├── classes
├── db
├── env
├── stores
├── trpc
└── lib/
├── constants.ts
├── jwt.ts
├── modal-registry.ts
├── paypal.ts
├── schemas.ts
├── server-utils.ts
├── types.ts
└── utils.ts
Tournament routes
As they are right now, the URL to certain pages related to tournaments can be very long, like for example, to go to the tournament's general settings page, you have to go to /tournament/[tournamentId]/manage/settings/general
. An idea proposed by @Entropy-10 was to have a tournament have a unique slug and I think that's very much possible, and have also thought about other ways to shorten the URLs a bit.
A few examples:
Tournament landing page: /tournament/[tournamentId] -> /[tournamentSlug]
Tournament manage general settings: /tournament/[tournamentId]/manage/settings/general -> /[tournamentSlug]/general-settings
To keep things organized, we can also make use of SvelteKit's (group)
routes which don't affect the URL.
How would this look like?
Note: For the sake of an example, I'll be using the "hypothetical" final structure, as in, the rough structure the project would follow if it were finished.
Current
routes/
└── tournament/
└── [tournamentId]/
├── mappools
├── bracket
├── stats
├── rules
├── teams
├── free-players
├── players
└── manage/
├── referee-settings/
│ ├── general
│ ├── mod-multipliers
│ └── rules
├── settings/
│ ├── dates
│ ├── general
│ ├── graphics
│ ├── links
│ ├── prizes
│ └── stages
├── staff/
│ ├── roles
│ ├── team
│ └── apps
├── pooling/
│ ├── suggestions
│ ├── mappools
│ └── playtesting
├── referee/
│ └── matches
└── stats/
├── calculate
└── leaderboards
Proposed
routes/
└── [tournamentSlug]/
├── (public)/
│ ├── mappools
│ ├── bracket
│ ├── stats
│ ├── rules
│ ├── teams
│ ├── free-players
│ └── players
├── (manage-settings)/
│ ├── dates
│ ├── settings
│ ├── graphics
│ ├── links
│ ├── prizes
│ ├── stages
│ ├── referee-settings
│ ├── mod-multipliers
│ └── rules
├── (manage-staff)/
│ ├── staff-roles
│ ├── staff-team
│ └── staff-apps
├── (manage-pooling)/
│ ├── pool-suggestions
│ ├── mappools
│ └── playtesting
├── (manage-referee)/
│ └── manage-matches
└── (manage-stats)/
├── calculate-stats
└── leaderboards
Remember that routes within parenthesis don't affect the URL structure, so if we want to navigate to the matches management page in the browser, we don't have to navigate to /[tournamentSlug]/(manage-referee)/manage-matches
but rather just to /[tournamentSlug]/manage-matches
.