t3-oss / create-t3-app

The best way to start a full-stack, typesafe Next.js app
https://create.t3.gg
MIT License
24.35k stars 1.11k forks source link

feat: Stale T3 Folder Structure in docs #1897

Open benmarg opened 2 months ago

benmarg commented 2 months ago

Is your feature request related to a problem? Please describe.

Currently the T3 Folder Structure in the docs only allows you to view the file structure that you get when using the pages router. We also aren't showing the difference in folder structure when you select the Prisma vs Drizzle options.

Describe the solution you'd like to see

Now that T3 includes the app router and drizzle options, the scaffolded folder structure should include a toggle between those options.

Plan was too add 3 more checkboxes in that container at the top of the page, "App Router", "Page Router" and "Drizzle". The checkboxes would be done in such a way that you can only select either one of the corresponding options at a time. Let me know if you think their's some better/more intuitive UI to display these options(could use a drop down for example).

Example:

Screenshot 2024-05-24 at 11 57 49 PM

This will also involve some additional copy below the Folder structure diagram for the new options.

Describe alternate solutions

N/A

Additional information

Let me know how this sounds, planning on implementing this over the weekend if the proposed changes sound good!

c-ehrlich commented 2 months ago

i've been meaning to work on this but haven't had the time. would be amazing if you want to pick it up! maybe pages/app can be a toggle or some other ui element that shows it's one or the other?

benmarg commented 2 months ago

@c-ehrlich Thoughts on this behavior? Just in regards to the buttons, I haven't actually started working on the folder structure.

https://github.com/t3-oss/create-t3-app/assets/14111627/ee9e622d-c5aa-4662-af47-d6ed479c338c

juliusmarminge commented 2 months ago

I think in the longer term we'll need a global toggle for app/pages router

benmarg commented 2 months ago

Are you looking for that to be addressed in this PR @juliusmarminge ? Might be a little beyond what I was looking to tackle 😅

IMO this would be a good solution for the short term, then I can create a separate issue for the "global app router support" that someone else can pick up. Most of this upcoming PR should be able to stay in even when that issue eventually gets resolved.

juliusmarminge commented 2 months ago

Yea no you definetely don't have to tackle all of this yourself 😅

1900 added a switch and I've requested #1894 to do the same. If we can atleast keep the same switch for all of these individual pages to keep some coherancy that'd be great.