Noob, I tried to follow along with the docs but got a different file structure.

Hello, I recently tried to learn the T3 stack and decided to use the official T3 docs. However, I got confused when I ran npm create t3-app@latest and got a different file structure than the one shown at https://create.t3.gg/en/folder-structure anyway my question is how can i get the showen folder-structure
Create T3 App
Folder Structure 🚀 Create T3 App
The best way to start a full-stack, typesafe Next.js app.
8 Replies
Deleted_user_f8439ab4ed59
it seems that i don't have the /pages folder
Ben
Ben•7mo ago
The pages folder(often called pages directory or pages dir) is an older alternative to the app directory. To get a project that uses the pages dir, answer "no" when asked "Would you like to use the Next.js App Router?" by the CLI. You answered "Yes" to that question when using the T3 CLI, so your project was created the app folder. Honestly would recommend using the app directory, as it's the more modern approach. Most of the tutorials and stuff you see will be using that Docs should get updated to reflect this though, so good job catching that!
Deleted_user_f8439ab4ed59
okay thank you for the detailed response it really confused me since i followed along a tutorial that used the pages folder
Ben
Ben•7mo ago
Yup no worries, you're welcome to use the pages directory, though like I said if you're learning all this for the first time, it might make more sense to use app dir(even if you need to find a different tutorital) becuase it's pretty much what everyone has switched over to.
Deleted_user_f8439ab4ed59
hello 🙂 i was just woundering how i would use the session in my next.js compunets i created my project with the app router as your suggested and i seem to have errors when i make a usestate since i use the getServerAuthSession i could read it only work in server compunets but i don't seem to be able to use the useSession() since a project in the t3 stack created with the app router don't have the session provider? do you have any suggestions to fix this issue? i would love to hear your input thank you !! i tried look up how they do it in the t3 docs but it seems that they only use the /pages router and it really confuses me
Ben
Ben•7mo ago
I’m assuming you’re using next-auth? Just search up “next-auth NextJS 14 tutorial” and you should find a guide to walk you through it. I know Cody sets it up in the this tutorial around the 34 minute mark https://youtu.be/xF2WvGuI5Ww?si=snthdeZffmOJDU-4&t=10011
Web Dev Cody
YouTube
Build an Online Auction App with Notifications (Next.js, Shadcn, Ty...
Be sure to checkout the sponsor of this video https://knock.app/?utm_source=cody if you want a great way to easily setup notifications directly into your applications. Code: https://github.com/webdevcody/bid-buddy Timestamps: 00:00:00 Overview 00:05:08 Next Setup 00:06:56 Docker + Postgres Setup 00:09:21 Drizzle ORM 00:11:32 env-nextjs 00:14:0...
Ben
Ben•7mo ago
I guess be a little careful following that tutorial exactly because he’s not using create-t3-app, which creates a fair amount of the files and schemes you need for next-auth, for you. You can follow that tutorial but avoid duplicating any files T3 already creates for you
Deleted_user_f8439ab4ed59
thank you
Want results from more Discord servers?
Add your server