Skip to content

Latest commit

Β 

History

History
74 lines (65 loc) Β· 4.41 KB

File metadata and controls

74 lines (65 loc) Β· 4.41 KB

This project uses the following technologies:

  • Next.js 15 - React framework. For more information about this technology, check out its documentation Next.js 15 check out the documentation at https://nextjs.org/docs
  • tRPC - End-to-end typesafe APIs. For more information about this technology, check out its documentation tRPC check out the documentation at https://trpc.io
  • Better Auth - Authentication. For more information about this technology, check out its documentation Better Auth check out the documentation at https://better-auth.com
  • Drizzle ORM - TypeScript ORM for SQL databases. For more information about this technology, check out its documentation Drizzle ORM check out the documentation at https://orm.drizzle.team
  • PostgreSQL - Database. For more information about this technology, check out its documentation PostgreSQL check out the documentation at https://postgresql.org
  • AWS S3 - File storage and uploads. For more information about this technology, check out its documentation AWS S3 check out the documentation at https://aws.amazon.com/s3
  • Polar - Payment processing. For more information about this technology, check out its documentation Polar check out the documentation at https://polar.sh
  • Tailwind CSS - Styling. For more information about this technology, check out its documentation Tailwind CSS check out the documentation at https://tailwindcss.com
  • TypeScript - Static type checking. For more information about this technology, check out its documentation TypeScript check out the documentation at https://typescriptlang.org

Project Structure

The project follows a standard Next.js 15 App Router structure with additional configurations for the tech stack:

Root Level

β”œβ”€β”€ drizzle/              # Database migrations and metadata
β”œβ”€β”€ public/               # Static assets (images, icons, etc.)
β”œβ”€β”€ src/                  # Main source code directory
β”œβ”€β”€ drizzle.config.ts     # Drizzle ORM configuration
β”œβ”€β”€ next.config.ts        # Next.js configuration
β”œβ”€β”€ package.json          # Dependencies and scripts
β”œβ”€β”€ docker-compose.yml    # Docker services (likely PostgreSQL)
└── tsconfig.json         # TypeScript configuration

Source Directory (src/)

src/
β”œβ”€β”€ app/                  # Next.js App Router - pages and layouts
β”‚   β”œβ”€β”€ api/              # API routes
β”‚   β”‚   β”œβ”€β”€ auth/         # Authentication endpoints (Better Auth)
β”‚   β”‚   └── trpc/         # tRPC API endpoints
β”‚   β”œβ”€β”€ demo-trpc/        # tRPC demonstration pages
β”‚   β”œβ”€β”€ demo-trpc-protected/ # Protected tRPC demo pages
β”‚   β”œβ”€β”€ login/            # Login page
β”‚   β”œβ”€β”€ signup/           # Signup page
β”‚   β”œβ”€β”€ layout.tsx        # Root layout component
β”‚   β”œβ”€β”€ page.tsx          # Home page
β”‚   └── globals.css       # Global styles
β”œβ”€β”€ components/           # Reusable React components
β”‚   β”œβ”€β”€ login.tsx         # Login form component
β”‚   β”œβ”€β”€ logout.tsx        # Logout component
β”‚   └── signup.tsx        # Signup form component
β”œβ”€β”€ db/                   # Database configuration and schema
β”‚   β”œβ”€β”€ index.ts          # Database connection
β”‚   β”œβ”€β”€ schema.ts         # Drizzle schema definitions
β”‚   └── clear.ts          # Database utilities
β”œβ”€β”€ lib/                  # Utility functions and configurations
β”‚   β”œβ”€β”€ auth.ts           # Better Auth configuration
β”‚   β”œβ”€β”€ auth-client.ts    # Client-side auth utilities
β”‚   └── s3.ts             # AWS S3 configuration
└── trpc/                 # tRPC setup and configuration
    β”œβ”€β”€ client.tsx        # tRPC client setup
    β”œβ”€β”€ init.ts           # tRPC initialization
    β”œβ”€β”€ query-client.ts   # React Query client
    β”œβ”€β”€ server.ts         # tRPC server setup
    └── routers/          # tRPC API route definitions
        └── _app.ts       # Main tRPC router

Key Patterns

  • App Router: Uses Next.js 15 App Router for file-based routing
  • API Routes: Located in src/app/api/ for server-side endpoints
  • Components: Reusable UI components in src/components/
  • Database: Drizzle ORM with schema in src/db/schema.ts
  • Authentication: Better Auth setup in src/lib/auth.ts
  • tRPC: Type-safe API with routers in src/trpc/routers/
  • File Storage: AWS S3 integration in src/lib/s3.ts