Skip to content

Commit 51ab1cf

Browse files
committed
refactor: remove better-auth integration and related code
- Deleted better-auth client, server, and related middleware files. - Removed auth-related routes and contracts. - Updated package.json to remove better-auth dependencies and adjusted typecheck script. - Refactored database client to improve logging and connection handling. - Cleaned up environment variables and removed unused env-helper utility. - Adjusted route tree and router to remove auth-related routes. - Updated instrumentation and server files for improved logging. - Added public environment type definitions and adjusted TypeScript configurations.
1 parent 6b9c2ad commit 51ab1cf

38 files changed

Lines changed: 493 additions & 829 deletions

.env.example

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
DATABASE_URL=
22

3-
# Better Auth
4-
BETTER_AUTH_SECRET=forExampleAuthSecretMin32CharacetersRequired
5-
63
# Like: CF_CONNECTING_IP
74
X_FORWARDED_FOR=
85

README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 🚀 React Template
22

3-
A modern, high-performance full-stack React template powered by **Bun**, **TanStack Start**, and **oRPC**. Designed for developer experience, type-safety, and modularity.
3+
A modern, high-performance full-stack React template powered by **Bun** and **TanStack Start**. Designed for developer experience, type-safety, and modularity.
44

55
## 📋 Overview
66

@@ -11,9 +11,7 @@ This template provides a solid foundation for building full-stack applications w
1111
- ⚛️ **React 19**: Leveraging the latest React features and improvements.
1212
- 🚀 **TanStack Start**: Full-stack React framework with type-safe routing and SSR.
1313
-**Bun**: Ultra-fast runtime, package manager, and test runner.
14-
- 🛡️ **oRPC**: End-to-end type-safe API without the need for code generation.
1514
- 🗄️ **Drizzle ORM**: Type-safe TypeScript ORM for PostgreSQL.
16-
- 🔐 **Better Auth**: Comprehensive and extensible authentication solution.
1715
- 🎨 **Tailwind CSS v4**: Utility-first styling with the latest engine.
1816
- 🧩 **Shadcn UI**: 50+ accessible UI components built on `@base-ui/react`.
1917
- 📦 **Modular Design**: Clean separation of concerns within `src/core`.
@@ -63,8 +61,6 @@ Open [http://localhost:3000](http://localhost:3000) to see the application.
6361
| [TanStack Start](https://tanstack.com/start) | Framework | Full-stack React framework |
6462
| [Tailwind CSS v4](https://tailwindcss.com) | Styling | Utility-first CSS framework |
6563
| [Drizzle ORM](https://orm.drizzle.team) | Database | TypeScript ORM for SQL databases |
66-
| [Better Auth](https://better-auth.com) | Auth | The most comprehensive auth library |
67-
| [oRPC](https://orpc.sh) | API | Type-safe RPC for TypeScript |
6864
| [Vite](https://vitejs.dev) | Bundler | Next generation frontend tooling (Rolldown) |
6965

7066
## 📂 Project Structure
@@ -73,7 +69,6 @@ Open [http://localhost:3000](http://localhost:3000) to see the application.
7369
├── src/
7470
│ ├── components/ # UI components, layouts, and providers
7571
│ ├── core/ # Core business logic & infrastructure
76-
│ │ ├── api/ # oRPC router, middleware, and auth server
7772
│ │ ├── database/ # Drizzle client and schema definitions
7873
│ │ ├── schema/ # Shared Zod validation schemas
7974
│ │ └── shared/ # Shared utilities and constants
@@ -100,8 +95,6 @@ Open [http://localhost:3000](http://localhost:3000) to see the application.
10095
| `bun test` | Run tests with Vitest |
10196
| `bun db:generate` | Generate Drizzle migrations |
10297
| `bun db:migrate` | Apply Drizzle migrations |
103-
| `bun auth:generate` | Generate Better Auth schema |
104-
| `bun auth:migrate` | Run Better Auth migrations |
10598
| `bun up` | Update dependencies to latest versions |
10699

107100
## 🔐 Environment Variables
@@ -110,7 +103,6 @@ Create a `.env.local` file in the root directory:
110103

111104
```env
112105
DATABASE_URL=postgresql://user:pass@localhost:5432/db
113-
BETTER_AUTH_SECRET=your-secret-key
114106
```
115107

116108
## 📄 License

bun.lock

Lines changed: 311 additions & 223 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
"scripts": {
66
"dev": "vite dev --port 3000 | bun pino-pretty",
77
"build": "vite build",
8-
"typecheck": "tsgo --noEmit",
8+
"typecheck": "tsgo --noEmit -p tsconfig.json && tsgo --noEmit -p tsconfig.node.json",
99
"lint": "oxlint --fix",
1010
"format": "oxfmt",
1111
"db:generate": "drizzle-kit generate",
1212
"db:migrate": "drizzle-kit migrate",
13-
"auth:generate": "bunx @better-auth/cli generate --config src/core/api/auth/server.ts --output src/core/database/schema/better-auth.ts -y",
14-
"auth:migrate": "bunx @better-auth/cli migrate --config src/core/api/auth/server.ts -y",
1513
"test": "vitest",
1614
"up": "bunx -b taze major -w"
1715
},
@@ -25,18 +23,12 @@
2523
"@opentelemetry/sdk-node": "^0.212.0",
2624
"@opentelemetry/sdk-trace-node": "^2.5.1",
2725
"@opentelemetry/semantic-conventions": "^1.40.0",
28-
"@orpc/client": "^1.13.5",
29-
"@orpc/contract": "^1.13.5",
30-
"@orpc/otel": "^1.13.5",
31-
"@orpc/server": "^1.13.5",
32-
"@orpc/tanstack-query": "^1.13.5",
3326
"@tanstack/react-query": "^5.90.21",
3427
"@tanstack/react-query-devtools": "^5.91.3",
3528
"@tanstack/react-router": "^1.163.3",
3629
"@tanstack/react-router-devtools": "^1.163.3",
3730
"@tanstack/react-router-with-query": "^1.130.17",
3831
"@tanstack/react-start": "^1.163.3",
39-
"better-auth": "^1.4.20",
4032
"class-variance-authority": "^0.7.1",
4133
"clsx": "^2.1.1",
4234
"cmdk": "^1.1.1",

src/core/api/auth/client.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/core/api/auth/index.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/core/api/auth/server.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/core/api/client.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/core/api/context.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/core/api/contracts/auth.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)