Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion auth-svc/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
.env.keys
dist
.git
.git
.github
10 changes: 5 additions & 5 deletions auth-svc/.env.production
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
DOTENV_PUBLIC_KEY_PRODUCTION="03a00202ae7b3ad87b4f856c7281db20733d192d5e426a619225782b49b7aeb34c"

BEARER_TOKEN_PRIVATEKEY=encrypted:BDubX/DKx0CBKuHa0LCvClaLM2bzk5MOU4TB49rkS9WBdMWUXPcNwC6G9mTkf2J9Vv+ALXF6O8gOOPWzktagCyAS8e1Bf2bnl0d5ChggG+Tn6IKo3wFYvpIgWlyJYTSgWznujxqMVb9pYazjQLkEgJSyYb/TtHX+Vl6pFLitwNd34wS5uA==
PORT=encrypted:BN2Tywizb9JVjOPO7dDlWPYoPaDDu5MUuijV1VcGkt89h9zZtb8R0pjsvyXUE7AwtMr5RpGqGyN6DLayKsLW3/w9YUyLRLsql0dLPXvlDb64hL0wTXhQFoEebXaUoQ4BPwHe2S8=
APIKEY_USER=encrypted:BBPh/BO/FrhLCzGdnlLXUVioaXfmj26jy2El7w9rwr+nhqbWMkViPwAm1PWgjvH4rCMiuXlOSGQJxCe3qWOQ9q5hAEC7j+eOYd9gR9o0sUpmtnXFIZDGZivQ2LTfiTclCERrLho1UkU4J8B6PRIjomkq2uBQUvITeb3FQk1ExlwY5pBbeg==
APIKEY_PASSWORD=encrypted:BMTHTMZX87T8KcHLbC82fcLzCvsKNmWbR35yZyZasR/QkqPEzo0dCsmEjLkjSs4HhSAG4Xp6PH2fvf6GSek/8u76FhhvHb2DfUhHy/W+XJuBzQuES++FX/Fp5j4ZktlmSU/HYDtBOqBjvW4XpNWNw43h6EEHpiYilzfFg3hn373Lv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9Th6tObK/+AYShWVqonpaR3pWJ"
DATABASE_URL="encrypted:BEOzuuJS67PKMSqlS8vZkbclGkT8TdMVHuoN5yAQQtI8NStsGnvAIqAlq9/ws6F84FAYwdaSxhRPkb5vVyKndpKFfZWuk8IIONMf1FFiaDqlHX5bIfW1cup4Oa39FA8FG78CHYs8NcPOjpSVTz1McO3iZkaulH9fAMRozrhctEmLPhFyBMnEsJ52pt/8ukvvQ5wUjylwVJOrYgGNALiumTQ5+/M1ufa64/SPaVFCf++xcThqoWYoYkZyG9r4nBzlWCDHuRIEjSX6ObyZHzMLhR8T78zIqhZk6shze5hDEl/+9Gr2NkTrd+eIEozvD0E6Cz5BFZs1VJ0R"
269 changes: 107 additions & 162 deletions auth-svc/bun.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion auth-svc/compose.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
build:
context: .
target: prerelease
command: ["bun", "run", "prisma-dev", "migrate", "dev"]
command: ["bun", "run", "drizzlekit-dev", "migrate"]
environment:
- DOTENV_PRIVATE_KEY_DEVELOPMENT
networks:
Expand Down
10 changes: 5 additions & 5 deletions auth-svc/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ RUN mkdir /auth-svc
WORKDIR /auth-svc
COPY --from=install /temp/dev/node_modules node_modules
COPY . .
RUN bunx --bun prisma --config=./src/prisma.config.ts generate
RUN bun run build
EXPOSE 5859
CMD [ "bun", "run", "dev" ]

FROM base AS release
RUN apk update && apk add curl && curl -sfS https://dotenvx.sh | sh
WORKDIR /usr/auth-svc
COPY --from=install /temp/prod/node_modules /usr/auth-svc/node_modules
COPY . .
RUN bun run build

COPY ./package.json .
COPY ./.env.production .
COPY --from=install /temp/prod/node_modules ./node_modules
COPY --from=prerelease /auth-svc/dist ./dist
EXPOSE 5858
CMD [ "dotenvx", "run" , "-f", ".env.production", "--", "bun", "./dist/app.mjs" ]
11 changes: 11 additions & 0 deletions auth-svc/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import '@dotenvx/dotenvx/config';
import { defineConfig } from 'drizzle-kit';

export default defineConfig({
schema: './src/db/schema.ts',
out: "./drizzle",
dialect: "postgresql",
dbCredentials: {
url: process.env.DATABASE_URL!,
}
})
36 changes: 36 additions & 0 deletions auth-svc/drizzle/20260711043012_harsh_quicksilver/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
-- =========================================================================
-- PRISMA TO DRIZZLE MIGRATION
-- =========================================================================
-- This file was auto-generated by introspecting the existing Prisma database.
--
-- ⚠️ IMPORTANT RUNTIME WARNING:
-- • DO NOT force execution of this raw SQL file on an existing, populated database.
-- Doing so will trigger "Table already exists" errors and risks breaking your schema.
-- • If you must execute this raw SQL file, it should ONLY be run on a completely empty database.
--
-- 🛡️ THE SAFE APPROACH (NO DATA LOSS):
-- • To safely sync the Drizzle schema with your existing Prisma database in development
-- or production without losing data, "do NOT run this SQL file manually".
-- • ✔ Instead, simply run: npx drizzle-kit pull --init
/*
CREATE TABLE "Users" (
"id" uuid PRIMARY KEY,
"username" varchar(255) NOT NULL,
"password_hash" varchar(2040) NOT NULL,
"provider" varchar(255) DEFAULT 'Local' NOT NULL,
"pid" text,
"displayName" varchar(255),
"fullName" varchar(255) NOT NULL,
"firstName" varchar(255) NOT NULL,
"lastName" varchar(255),
"email" varchar(255) NOT NULL,
"photoURL" varchar(2024),
"photo" bytea,
"photoType" varchar(255),
"created_at" timestamp(6) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
"updated_at" timestamp(6) with time zone NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX "Users_email_key" ON "Users" ("email");--> statement-breakpoint
CREATE UNIQUE INDEX "Users_pid_key" ON "Users" ("pid");--> statement-breakpoint
CREATE UNIQUE INDEX "Users_username_key" ON "Users" ("username");
285 changes: 285 additions & 0 deletions auth-svc/drizzle/20260711043012_harsh_quicksilver/snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
{
"dialect": "postgres",
"id": "b0e2ad12-cfef-423c-b8eb-cd988038e56d",
"prevIds": [
"00000000-0000-0000-0000-000000000000"
],
"version": "8",
"ddl": [
{
"isRlsEnabled": false,
"name": "Users",
"entityType": "tables",
"schema": "public"
},
{
"type": "uuid",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "id",
"entityType": "columns",
"schema": "public",
"table": "Users"
},
{
"type": "varchar(255)",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "username",
"entityType": "columns",
"schema": "public",
"table": "Users"
},
{
"type": "varchar(2040)",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "password_hash",
"entityType": "columns",
"schema": "public",
"table": "Users"
},
{
"type": "varchar(255)",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": "'Local'",
"generated": null,
"identity": null,
"name": "provider",
"entityType": "columns",
"schema": "public",
"table": "Users"
},
{
"type": "text",
"typeSchema": null,
"notNull": false,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "pid",
"entityType": "columns",
"schema": "public",
"table": "Users"
},
{
"type": "varchar(255)",
"typeSchema": null,
"notNull": false,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "displayName",
"entityType": "columns",
"schema": "public",
"table": "Users"
},
{
"type": "varchar(255)",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "fullName",
"entityType": "columns",
"schema": "public",
"table": "Users"
},
{
"type": "varchar(255)",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "firstName",
"entityType": "columns",
"schema": "public",
"table": "Users"
},
{
"type": "varchar(255)",
"typeSchema": null,
"notNull": false,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "lastName",
"entityType": "columns",
"schema": "public",
"table": "Users"
},
{
"type": "varchar(255)",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "email",
"entityType": "columns",
"schema": "public",
"table": "Users"
},
{
"type": "varchar(2024)",
"typeSchema": null,
"notNull": false,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "photoURL",
"entityType": "columns",
"schema": "public",
"table": "Users"
},
{
"type": "bytea",
"typeSchema": null,
"notNull": false,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "photo",
"entityType": "columns",
"schema": "public",
"table": "Users"
},
{
"type": "varchar(255)",
"typeSchema": null,
"notNull": false,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "photoType",
"entityType": "columns",
"schema": "public",
"table": "Users"
},
{
"type": "timestamp(6) with time zone",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": "CURRENT_TIMESTAMP",
"generated": null,
"identity": null,
"name": "created_at",
"entityType": "columns",
"schema": "public",
"table": "Users"
},
{
"type": "timestamp(6) with time zone",
"typeSchema": null,
"notNull": true,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
"name": "updated_at",
"entityType": "columns",
"schema": "public",
"table": "Users"
},
{
"nameExplicit": true,
"columns": [
{
"asc": true,
"nullsFirst": false,
"opclass": null,
"isExpression": false,
"value": "email"
}
],
"isUnique": true,
"where": null,
"with": "",
"method": "btree",
"concurrently": false,
"name": "Users_email_key",
"entityType": "indexes",
"schema": "public",
"table": "Users"
},
{
"nameExplicit": true,
"columns": [
{
"asc": true,
"nullsFirst": false,
"opclass": null,
"isExpression": false,
"value": "pid"
}
],
"isUnique": true,
"where": null,
"with": "",
"method": "btree",
"concurrently": false,
"name": "Users_pid_key",
"entityType": "indexes",
"schema": "public",
"table": "Users"
},
{
"nameExplicit": true,
"columns": [
{
"asc": true,
"nullsFirst": false,
"opclass": null,
"isExpression": false,
"value": "username"
}
],
"isUnique": true,
"where": null,
"with": "",
"method": "btree",
"concurrently": false,
"name": "Users_username_key",
"entityType": "indexes",
"schema": "public",
"table": "Users"
},
{
"columns": [
"id"
],
"nameExplicit": true,
"name": "Users_pkey",
"entityType": "pks",
"schema": "public",
"table": "Users"
}
],
"renames": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "Users" ALTER COLUMN "updated_at" SET DEFAULT now();
Loading
Loading