-
Notifications
You must be signed in to change notification settings - Fork 0
Drizzle/BetterAuth/Storage rework #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
9e72cf9
63e2671
11f1aee
5cf4962
00791b0
2afc512
ab0c3e3
ab302da
21ec206
884b355
a143714
a26fda9
18d90de
ebf0ed6
5f231d6
067315b
413fec4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,23 @@ | ||
| # app | ||
| PORT=8000 | ||
| BASE_URL=http://localhost:8000 | ||
| NODE_ENV=development | ||
| APP_NAME=SojuStack | ||
| APP_PORT=8000 | ||
| APP_URL=http://localhost:8000 | ||
| APP_WEB_URL=http://localhost:3000 | ||
|
|
||
| # better-auth | ||
| # auth | ||
| AUTH_SECRET=CHANGE_THIS_FOR_PROD | ||
|
|
||
| # databases | ||
| POSTGRES_URL=postgres://postgres:postgres@localhost:5432/postgres | ||
| REDIS_URL=redis://localhost:6379 | ||
| # database | ||
| DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres | ||
|
|
||
| # cache | ||
| CACHE_URL=redis://localhost:6379 | ||
|
|
||
| EMAIL_DOMAIN=example.com | ||
| MAIL_DOMAIN=example.com | ||
|
|
||
| # storage | ||
| STORAGE_HOST=localhost | ||
| STORAGE_PORT=9000 | ||
| STORAGE_ACCESS_KEY=user | ||
| STORAGE_SECRET_KEY=password | ||
| STORAGE_URL=http://localhost:9000 | ||
| STORAGE_REGION=us-east-1 | ||
| STORAGE_ACCESS_KEY=admin | ||
| STORAGE_SECRET_KEY=admin |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| $(AppService).getHello() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // @ts-nocheck | ||
| import 'dotenv/config'; | ||
| import { defineConfig } from 'drizzle-kit'; | ||
|
|
||
| export default defineConfig({ | ||
| dialect: 'postgresql', | ||
| schema: './src/databases/database.schema.ts', | ||
cursor[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| out: './src/databases/migrations', | ||
| dbCredentials: { | ||
| url: process.env['DATABASE_URL']!, | ||
| }, | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,13 +7,15 @@ | |
| "private": true, | ||
| "scripts": { | ||
| "build": "nest build", | ||
| "db:generate": "prisma generate", | ||
| "db:migrate:generate": "prisma migrate dev", | ||
| "db:migrate:deploy": "prisma migrate deploy", | ||
| "db:push": "prisma db push", | ||
| "db:reset": "prisma migrate reset", | ||
| "db:studio": "prisma studio", | ||
| "db:push": "drizzle-kit push", | ||
| "db:pull": "drizzle-kit pull", | ||
| "db:generate": "drizzle-kit generate", | ||
| "db:migrate": "drizzle-kit migrate", | ||
| "db:reset": "drizzle-kit reset", | ||
| "db:studio": "drizzle-kit studio", | ||
| "seed:users": "tsx src/cli.ts seed-users", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "dev": "nest start --watch", | ||
| "repl": "nest start --watch --entryFile repl", | ||
| "email:dev": "email dev --dir ./src/notifications/emails --port 3030", | ||
| "nuke": "docker compose down -v --remove-orphans && docker compose up -d", | ||
| "start": "nest start", | ||
|
|
@@ -23,17 +25,18 @@ | |
| "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", | ||
| "test:e2e": "jest --config ./test/jest-e2e.json", | ||
| "test:watch": "jest --watch", | ||
| "typecheck": "tsc --noEmit" | ||
| "typecheck": "tsc --noEmit", | ||
| "depcheck": "depcheck" | ||
| }, | ||
| "dependencies": { | ||
| "@aws-sdk/client-s3": "^3.940.0", | ||
| "@aws-sdk/s3-request-presigner": "^3.940.0", | ||
| "@faker-js/faker": "^10.1.0", | ||
| "@itgorillaz/configify": "^4.0.1", | ||
| "@keyv/redis": "^5.1.4", | ||
| "@keyv/redis": "^5.1.5", | ||
| "@keyv/valkey": "^1.0.11", | ||
| "@nest-lab/throttler-storage-redis": "^1.1.0", | ||
| "@nestjs-cls/transactional": "^3.1.1", | ||
| "@nestjs-cls/transactional-adapter-prisma": "^1.3.1", | ||
| "@nestjs-cls/transactional-adapter-drizzle-orm": "^1.2.1", | ||
| "@nestjs/cache-manager": "^3.0.1", | ||
| "@nestjs/common": "^11.1.9", | ||
| "@nestjs/config": "^4.0.2", | ||
|
|
@@ -43,30 +46,26 @@ | |
| "@nestjs/swagger": "^11.2.3", | ||
| "@nestjs/throttler": "^6.4.0", | ||
| "@paralleldrive/cuid2": "^3.0.4", | ||
| "@prisma/adapter-pg": "^7.0.1", | ||
| "@prisma/client": "^7.0.1", | ||
| "@prisma/client-runtime-utils": "^7.0.1", | ||
| "@react-email/components": "^1.0.1", | ||
| "@react-email/render": "2.0.0", | ||
| "@scalar/nestjs-api-reference": "^1.0.13", | ||
| "better-auth": "^1.4.1", | ||
| "cache-manager": "^7.2.5", | ||
| "cacheable": "^2.2.0", | ||
| "chalk": "^5.6.2", | ||
| "class-transformer": "^0.5.1", | ||
| "class-validator": "^0.14.3", | ||
| "cookie-parser": "^1.4.7", | ||
| "cors": "^2.8.5", | ||
| "date-fns": "^4.1.0", | ||
| "dotenv": "^17.2.3", | ||
| "drizzle-orm": "1.0.0-beta.6-4414a19", | ||
| "keyv": "^5.5.4", | ||
| "minio": "^8.0.6", | ||
| "nestjs-cls": "^6.1.0", | ||
| "pg": "^8.16.3", | ||
| "react": "^19.2.0", | ||
| "react-dom": "^19.2.0", | ||
| "reflect-metadata": "^0.2.2", | ||
| "rxjs": "^7.8.2", | ||
| "set-cookie-parser": "^2.7.2", | ||
| "sharp": "^0.34.5", | ||
| "tsx": "^4.20.6" | ||
| }, | ||
|
|
@@ -87,6 +86,8 @@ | |
| "@types/pg": "^8.15.6", | ||
| "@types/react": "^19.2.7", | ||
| "@types/supertest": "^6.0.3", | ||
| "depcheck": "^1.4.7", | ||
| "drizzle-kit": "1.0.0-beta.6-4414a19", | ||
| "globals": "^16.5.0", | ||
| "install": "^0.13.0", | ||
| "jest": "^30.2.0", | ||
|
|
@@ -121,9 +122,5 @@ | |
| "moduleNameMapper": { | ||
| "^src/(.*)$": "<rootDir>/$1" | ||
| } | ||
| }, | ||
| "packageManager": "pnpm@10.13.1", | ||
| "engines": { | ||
| "node": ">=22.17.1" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,8 +18,8 @@ import { ClsPluginTransactional } from '@nestjs-cls/transactional'; | |
| import { ClsModule } from 'nestjs-cls'; | ||
| import { ConfigifyModule } from '@itgorillaz/configify'; | ||
| import { CacheConfig } from './common/config/cache.config'; | ||
| import { TransactionalAdapterPrisma } from '@nestjs-cls/transactional-adapter-prisma'; | ||
| import { PrismaService } from './databases/prisma.service'; | ||
| import { TransactionalAdapterDrizzleOrm } from '@nestjs-cls/transactional-adapter-drizzle-orm'; | ||
| import { DRIZZLE_PROVIDER } from './databases/drizzle.provider'; | ||
|
|
||
| @Module({ | ||
| imports: [ | ||
|
|
@@ -35,13 +35,11 @@ import { PrismaService } from './databases/prisma.service'; | |
| }, | ||
| }), | ||
| ClsModule.forRoot({ | ||
| global: true, | ||
| plugins: [ | ||
| new ClsPluginTransactional({ | ||
| imports: [DatabasesModule], | ||
| adapter: new TransactionalAdapterPrisma({ | ||
| prismaInjectionToken: PrismaService, | ||
| sqlFlavor: 'postgresql', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ClsModule missing global flag breaks cross-module accessThe |
||
| adapter: new TransactionalAdapterDrizzleOrm({ | ||
| drizzleInstanceToken: DRIZZLE_PROVIDER, | ||
| }), | ||
| }), | ||
| ], | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REPL history file accidentally committed to repository
The
.nestjs_repl_historyfile is a local development artifact containing REPL command history. While it was added to.gitignore, the file itself was also committed to the repository. This file should be removed from tracking since it's user-specific development data and not intended to be shared.