-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* migrate layout to app * change navlink * up deps * add authentication & authorization * up readme * add planetscale typegen * add KyselyPlanetscaleAdapter * fix read session * move to query/utils * remove comments * refactor auth adapter
- Loading branch information
1 parent
598c02c
commit e639956
Showing
63 changed files
with
1,411 additions
and
886 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,16 @@ | |
# If you are cloning this repo, create a copy of this file named `.env` and populate it with your secrets. | ||
|
||
# When adding additional env variables, the schema in /env/schema.mjs should be updated accordingly | ||
# Prisma | ||
DATABASE_URL=file:./db.sqlite | ||
# Planetscale Node js / generate types from planetscale db | ||
DATABASE_URL= | ||
|
||
# Planetscale PRISMA | ||
DATABASE_URL_PRISMA= | ||
|
||
# Planetscale edge (@planetscale/database) | ||
DATABASE_HOST= | ||
DATABASE_USERNAME= | ||
DATABASE_PASSWORD= | ||
|
||
# Next Auth | ||
# You can generate the secret via 'openssl rand -base64 32' on Linux | ||
|
@@ -16,17 +24,6 @@ NEXTAUTH_SECRET= "m3wNqfuuKXFCOM+G8DprvaXB90S1X9SsML7ZC4JK7ec=" | |
NEXTAUTH_URL=http://localhost:3000 | ||
|
||
# Next Auth Discord Provider | ||
# DISCORD_CLIENT_ID= | ||
# DISCORD_CLIENT_SECRET= | ||
|
||
|
||
# DON'T USE THIS | ||
# Planetscale (Later) | ||
# DATABASE_URL= "mysql://[email protected]:3309/smpn1waru" | ||
|
||
# Next Auth | ||
# You can generate the secret via 'openssl rand -base64 32' on Linux | ||
# More info: https://next-auth.js.org/configuration/options#secret | ||
# NEXTAUTH_SECRET= "" | ||
# NEXTAUTH_URL=http://localhost:3000 | ||
DISCORD_CLIENT_ID= | ||
DISCORD_CLIENT_SECRET= | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Dependency directories | ||
/node_modules | ||
|
||
# NextJS Files | ||
/build | ||
/public/* | ||
/.next | ||
# next-env.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/.pnpm/[email protected]/node_modules/typescript/lib", | ||
"typescript.enablePromptUseWorkspaceTsdk": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,30 @@ | ||
## Learn More | ||
|
||
T3 Stack <strong>tanpa</strong> TRPC dan Prisma Client. | ||
|
||
To learn more about the [T3 Stack](https://create.t3.gg/), take a look at the following resources: | ||
|
||
- [Documentation](https://create.t3.gg/) | ||
- [Learn the T3 Stack](https://create.t3.gg/en/faq#what-learning-resources-are-currently-available) — Check out these awesome tutorials | ||
- [Overview](https://www.youtube.com/watch?v=VJH8dsPtbeU) - Tapi tanpa app dir | ||
- [UUID vs CUID vs NanoId](https://dev.to/harshhhdev/uuidguid-cuid-nanoid-whats-the-difference-5dj1) | ||
|
||
## Flow | ||
|
||
- Database | ||
|
||
1\. Create Model and schema with Prisma\ | ||
2\. Push (don't use migrate!, yet) to planetscale\ | ||
3\. Import type to typescript with `db:type` | ||
|
||
# Important Resources | ||
|
||
- Prisma: | ||
- [Schema Reference](https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference). Pelajari mana yang implemented (keyword: `implemented`) by prisma dan mana yang langsung di db. Jadi kalau diimplementasi oleh prisma maka kita buat sendiri juga. | ||
- [Prisma Mapping to MySql](https://www.prisma.io/docs/concepts/database-connectors/mysql#type-mapping-between-mysql-to-prisma-schema) | ||
- [Data Model](https://www.prisma.io/docs/concepts/components/prisma-schema/data-model#defining-models) | ||
|
||
# TODO | ||
- Auth pake NextAuth + mock database pakai prisma sqlite untuk user saja. Nanti kalau sudah baru migrate ke planetscale | ||
|
||
- Workaround TRPC. atau mungkin di remove aja(?) | ||
- Ganti OAuth discord ke Google |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.