Your folder structure has two jobs, but only does one
blog.sterlingfreeman.net
blog.sterlingfreeman.net
I fail to see the value of grouping all models together, maybe its me but i would rather that collaborators are co-located. I cant see any value to have all models.
src/features/
auth/
models.xx
api.xx
components/SignInModal.xx
todos/
models.xx
acls.xx
api.xx
pages/Todo{List,Create,Edit}Page.xx
Naturally, there’s some code to glue it all together and some shared services, and it’s still a mess sometimes, but overall when related things stay close to each other it’s easier to comprehend.Probably! (Sessions, OIDC connections, probably users if small enough.)
I don’t think putting it all together into the root directory is the way to go. The idea is to store everything related to one particular feature together, so that all the relevant code stays in one place:
// features/auth/models.ts
class User { ... }
// features/auth/api.remote.ts
import { User } from "./models";
export const authorizeUserForm = form((username, password) => { // [1]
// ...
});
// features/auth/components/SignInDialog.tsx
import { authorizeUser } from "../api.remote";
export default () => <form {...authorizeUserForm}>
...
</form>;
[1]: some RPC magic here, like https://svelte.dev/docs/kit/remote-functionsThe problem is no existing file system supports this so you can only use it to organize notes or issues not your code.
Use sym- and hardlinks?