Compare commits

..

No commits in common. "5dbc66ae4755dc4c607ebaf6b0d988721c16aab9" and "6a60d5f8c096159b1c48a43dc646956958b8fbd1" have entirely different histories.

9 changed files with 5 additions and 112 deletions

View File

@ -1,17 +0,0 @@
FROM node:22.19.0 AS builder
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install
COPY . .
RUN yarn prisma generate
RUN yarn build
FROM node:22.19.0 AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY package.json yarn.lock prisma.config.ts ./
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/prisma ./prisma
CMD ["node", "dist/src/main"]

View File

@ -1,18 +0,0 @@
name: teacinema
services:
auth-service:
container_name: teacinema-auth-service
build:
context: .
dockerfile: Dockerfile
restart: always
env_file:
- .env.production.local
networks:
- teacinema
networks:
teacinema:
external: true

View File

@ -9,9 +9,9 @@
"build": "nest build", "build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start", "start": "nest start",
"start:dev": "cross-env NODE_ENV=development nest start --watch", "start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch", "start:debug": "nest start --debug --watch",
"start:prod": "cross-env NODE_ENV=production node dist/main", "start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest", "test": "jest",
"test:watch": "jest --watch", "test:watch": "jest --watch",
@ -56,7 +56,6 @@
"@types/jest": "^30.0.0", "@types/jest": "^30.0.0",
"@types/node": "^22.10.7", "@types/node": "^22.10.7",
"@types/supertest": "^6.0.2", "@types/supertest": "^6.0.2",
"cross-env": "^10.1.0",
"eslint": "^9.18.0", "eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1", "eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.2", "eslint-plugin-prettier": "^5.2.2",

View File

@ -1,10 +1,6 @@
import dotenv from 'dotenv' import 'dotenv-expand/config'
import dotenvExpand from 'dotenv-expand'
import { defineConfig } from 'prisma/config' import { defineConfig } from 'prisma/config'
const env = dotenv.config({ path: '.env.development.local' })
dotenvExpand.expand(env)
export default defineConfig({ export default defineConfig({
schema: 'prisma/schema.prisma', schema: 'prisma/schema.prisma',
migrations: { migrations: {

View File

@ -1,46 +0,0 @@
-- CreateEnum
CREATE TYPE "roles" AS ENUM ('ADMIN', 'USER');
-- CreateTable
CREATE TABLE "accounts" (
"id" TEXT NOT NULL,
"phone" TEXT,
"email" TEXT,
"is_phone_verified" BOOLEAN NOT NULL DEFAULT false,
"is_email_verified" BOOLEAN NOT NULL DEFAULT false,
"role" "roles" NOT NULL DEFAULT 'USER',
"telegram_id" TEXT,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
CONSTRAINT "accounts_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "pending_contact_changes" (
"id" TEXT NOT NULL,
"type" TEXT NOT NULL,
"value" TEXT NOT NULL,
"code_hash" TEXT NOT NULL,
"expires_at" TIMESTAMP(3) NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
"account_id" TEXT NOT NULL,
CONSTRAINT "pending_contact_changes_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "accounts_phone_key" ON "accounts"("phone");
-- CreateIndex
CREATE UNIQUE INDEX "accounts_email_key" ON "accounts"("email");
-- CreateIndex
CREATE UNIQUE INDEX "accounts_telegram_id_key" ON "accounts"("telegram_id");
-- CreateIndex
CREATE UNIQUE INDEX "pending_contact_changes_account_id_type_key" ON "pending_contact_changes"("account_id", "type");
-- AddForeignKey
ALTER TABLE "pending_contact_changes" ADD CONSTRAINT "pending_contact_changes_account_id_fkey" FOREIGN KEY ("account_id") REFERENCES "accounts"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -1,3 +0,0 @@
# Please do not edit this file manually
# It should be added in your version-control system (e.g., Git)
provider = "postgresql"

View File

@ -23,11 +23,6 @@ import { UsersModule } from './modules/users/users.module'
imports: [ imports: [
ConfigModule.forRoot({ ConfigModule.forRoot({
isGlobal: true, isGlobal: true,
envFilePath: [
`.env.${process.env.NODE_ENV}.local`,
`.env.${process.env.NODE_ENV}`,
'.env'
],
load: [dabataseEnv, grpcEnv, redisEnv, passportEnv, telegramEnv, rmqEnv] load: [dabataseEnv, grpcEnv, redisEnv, passportEnv, telegramEnv, rmqEnv]
}), }),
PrismaModule, PrismaModule,
@ -38,7 +33,7 @@ import { UsersModule } from './modules/users/users.module'
AccountModule, AccountModule,
TelegramModule, TelegramModule,
TokenModule, TokenModule,
MessagingModule MessagingModule,
] ]
}) })
export class AppModule {} export class AppModule {}

View File

@ -1,4 +1,4 @@
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"exclude": ["node_modules", "test", "dist", "prisma", "**/*spec.ts"] "exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
} }

View File

@ -414,11 +414,6 @@
dependencies: dependencies:
tslib "^2.4.0" tslib "^2.4.0"
"@epic-web/invariant@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@epic-web/invariant/-/invariant-1.0.0.tgz#1073e5dee6dd540410784990eb73e4acd25c9813"
integrity sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==
"@eslint-community/eslint-utils@^4.8.0", "@eslint-community/eslint-utils@^4.9.1": "@eslint-community/eslint-utils@^4.8.0", "@eslint-community/eslint-utils@^4.9.1":
version "4.9.1" version "4.9.1"
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz#4e90af67bc51ddee6cdef5284edf572ec376b595" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz#4e90af67bc51ddee6cdef5284edf572ec376b595"
@ -2728,14 +2723,6 @@ create-require@^1.1.0:
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==
cross-env@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-10.1.0.tgz#cfd2a6200df9ed75bfb9cb3d7ce609c13ea21783"
integrity sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==
dependencies:
"@epic-web/invariant" "^1.0.0"
cross-spawn "^7.0.6"
cross-spawn@^7.0.3, cross-spawn@^7.0.6: cross-spawn@^7.0.3, cross-spawn@^7.0.6:
version "7.0.6" version "7.0.6"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f"