This is a T3 Stack project bootstrapped with create-t3-app
.
To learn more about the T3 Stack, take a look at the following resources:
- Documentation
- Learn the T3 Stack — Check out these awesome tutorials
Follow our deployment guides for Vercel, Netlify and Docker for more information.
- Create .env file by copying .env.example and filling in the required fields, define your database name in the start-database.sh script. Ensure docker is running and installed. You can leave the database password as "password" and it will be generated for you or change it to your desired password.
- Run
./start-database.sh
to start a local postgres database in a docker container - Run
npm run db:push
to push default migrations - Run
npm install
to install the dependencies - Run
npm run dev
to start the development server
- Run
./start-database.sh
to start a local postgres database in a docker container - Run
npm run db:push
to push the models to the database - Update your schema in
drizzle/schema.ts
- Run
npm run db:push
to push the new schema to the database - We can leverage InferSelectModel and InferInsertModel to type our queries and mutations so we can use them in our tRPC routes and app for type safety. When we update schema our types will automatically be updated and reflected.
- All TRPC routes are defined in
src/server/api/routers
- Add new TRPC routers in
src/server/api/routers
- Resolve TRPC router imports in
src/server/api/root.ts
by adding them to thecreateTRPCRouter
function - Call TRPC routes within the app, see post as example, this creates a tunnel from the frontend to the backend in a type safe manner
- Read into queries and mutations, queries are used for read only data that is fetched on the client side by default on load and mutations are used for write operations
- Add auth providers to
src/server/auth.ts
- Include proper environment variables for auth providers in
.env
andsrc/env.js
- Shadcn UI components are located in
src/components/ui
- Use npx shadcn-ui@latest add {component} to add a new component it will automatically update the
src/components/ui/index.tsx
file - Reference the website for the component you want to use here: https://ui.shadcn.com/