Skip to content

Commit eaee82c

Browse files
authored
Merge pull request #24 from wootsbot/feat/better-auth
Feat/better auth
2 parents 1c6017b + 1db2cec commit eaee82c

File tree

36 files changed

+1237
-160
lines changed

36 files changed

+1237
-160
lines changed

.changeset/spicy-words-allow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"x-boilerplate": minor
3+
---
4+
5+
Add `drizzle` ORM and config `better-auth` remplce `next-auth`

.env

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

.env.development

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
SITE_NAME="X Boilerplate"
22
TWITTER_CREATOR="@wootsbot"
33
SITE_URL="https://x.openkit.run"
4+
5+
# RESEND API
6+
RESEND_DOMAIN=[email protected]
7+
8+
# STRIPE
49
STRIPE_CURRENCY="mxn"
10+
11+
# BETTER AUTH
12+
BETTER_AUTH_URL=https://x.openkit.run #Base URL of your app
13+
GITHUB_CLIENT_ID=4841bedd49e9fa26ecf5

.github/workflows/playwright.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ jobs:
3636
env:
3737
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
3838
RESEND_DOMAIN: ${{ secrets.RESEND_DOMAIN }}
39-
GITHUB_CLIENT_ID: ${{ secrets.AUTH_GITHUB_CLIENT_ID }}
40-
GITHUB_CLIENT_SECRET: ${{ secrets.AUTH_GITHUB_CLIENT_SECRET }}
41-
AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
4239
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
4340
STRIPE_PUBLISHABLE_KEY: ${{ secrets.STRIPE_PUBLISHABLE_KEY }}
4441
PERSONAL_GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
42+
BETTER_AUTH_SECRET: ${{ secrets.BETTER_AUTH_SECRET }}
43+
GITHUB_CLIENT_SECRET: ${{ secrets.AUTH_GITHUB_CLIENT_SECRET }}
44+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
4545
run: |
4646
cp .env.development .env
4747
chmod +x ./scripts/setEnv.sh && ./scripts/setEnv.sh
@@ -61,7 +61,7 @@ jobs:
6161
# - name: Run Playwright tests
6262
# run: pnpm exec playwright test
6363

64-
- uses: actions/upload-artifact@v3
64+
- uses: actions/upload-artifact@v4
6565
if: always()
6666
with:
6767
name: playwright-report

.github/workflows/pull_request_stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ jobs:
4646
env:
4747
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
4848
RESEND_DOMAIN: ${{ secrets.RESEND_DOMAIN }}
49-
GITHUB_CLIENT_ID: ${{ secrets.AUTH_GITHUB_CLIENT_ID }}
50-
GITHUB_CLIENT_SECRET: ${{ secrets.AUTH_GITHUB_CLIENT_SECRET }}
51-
AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
5249
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
5350
STRIPE_PUBLISHABLE_KEY: ${{ secrets.STRIPE_PUBLISHABLE_KEY }}
5451
PERSONAL_GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
52+
BETTER_AUTH_SECRET: ${{ secrets.BETTER_AUTH_SECRET }}
53+
GITHUB_CLIENT_SECRET: ${{ secrets.AUTH_GITHUB_CLIENT_SECRET }}
54+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
5555
run: |
5656
cp .env.development .env
5757
chmod +x ./scripts/setEnv.sh && ./scripts/setEnv.sh

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ jobs:
4444
env:
4545
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
4646
RESEND_DOMAIN: ${{ secrets.RESEND_DOMAIN }}
47-
GITHUB_CLIENT_ID: ${{ secrets.AUTH_GITHUB_CLIENT_ID }}
48-
GITHUB_CLIENT_SECRET: ${{ secrets.AUTH_GITHUB_CLIENT_SECRET }}
49-
AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
5047
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
5148
STRIPE_PUBLISHABLE_KEY: ${{ secrets.STRIPE_PUBLISHABLE_KEY }}
5249
PERSONAL_GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
50+
BETTER_AUTH_SECRET: ${{ secrets.BETTER_AUTH_SECRET }}
51+
GITHUB_CLIENT_SECRET: ${{ secrets.AUTH_GITHUB_CLIENT_SECRET }}
52+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
5353
run: |
5454
cp .env.development .env
5555
chmod +x ./scripts/setEnv.sh && ./scripts/setEnv.sh

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ yarn-error.log*
3131
.pnpm-debug.log*
3232

3333
# local env files
34+
.env
3435
.env*.local
3536

3637
# vercel

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
- 🍍 [Asynchronous state management - TanStack Query](https://tanstack.com/query) and [State Management zustand](https://zustand-demo.pmnd.rs/)
4343

44-
- 🛡️ Authentication [authjs](https://authjs.dev/)
44+
- 🛡️ Authentication [better-auth](https://www.better-auth.com)
4545

4646
- 💸 Payments [stripe](https://stripe.com)
4747

@@ -67,7 +67,7 @@ Many of this boilerplate features are based on the philosophy of being optional.
6767
- [x] ~Integrate State Management TanStack Query~
6868
- [x] ~Integrate react-hook-form~
6969
- [x] ~Integrate Zod to schema validation~
70-
- [x] ~Authentication (next-auth)~
70+
- [x] ~Authentication (better-auth)~
7171
- [x] ~Integrate linters, hooks to DX~
7272
- [x] ~Integrate resend~
7373
- [x] ~Integrate @react-email~

biome.jsonc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"!.next",
1919
"!public",
2020
"!playwright-report/**",
21-
"!.changeset/**"
21+
"!.changeset/**",
22+
"!drizzle"
2223
]
2324
},
2425
"formatter": {

drizzle.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import "dotenv/config";
2+
import { defineConfig } from "drizzle-kit";
3+
4+
export default defineConfig({
5+
schema: "./src/db/schema.ts",
6+
out: "./migrations",
7+
dialect: "postgresql",
8+
dbCredentials: {
9+
url: process.env.DATABASE_URL as string,
10+
},
11+
});

0 commit comments

Comments
 (0)