Skip to content

Commit b7ad543

Browse files
Merge pull request #4 from codebuilderinc/refactor/remove-graphql-rest-consolidation
Major refactor: remove GraphQL surface and consolidate REST/Swagger architecture
2 parents 71fadf7 + acdf63b commit b7ad543

File tree

75 files changed

+185
-1848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+185
-1848
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,6 @@ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
5757
# Sensitive / secrets (override earlier negation)
5858
.vscode/settings.json
5959
google-service-account-key.json
60+
google-services.json
61+
62+
bak/

default.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,5 @@
8282
"port": 5672,
8383
"username": "admin",
8484
"password": "password"
85-
},
86-
"GRAPHQL_SETTINGS": {
87-
"playground": true,
88-
"debug": true,
89-
"introspection": true,
90-
"installSubscriptionHandlers": true
91-
},
92-
"GRAPHQL_APIS": {
93-
"api_1": "http://localhost:8090/graphql",
94-
"api_2": "http://localhost:8091/graphql"
95-
},
96-
"GRAPHQL_GUARD": {
97-
"username": "admin",
98-
"password": "password"
9985
}
10086
}

docker-entrypoint.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ export NODE_ENV=${NODE_ENV:-production}
1616
DB_HOST=${DATABASE_HOST:-db}
1717
DB_PORT=${DATABASE_PORT:-5432}
1818

19+
# If DATABASE_URL isn't set (some deploys set DB_* vars only), build it here
20+
if [ -z "$DATABASE_URL" ]; then
21+
export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOST}:${DB_PORT}/${POSTGRES_DB}?schema=${DB_SCHEMA:-public}"
22+
echo "[ENTRYPOINT] Built DATABASE_URL from components"
23+
fi
24+
25+
# If SHADOW_DATABASE_URL isn't set, build a shadow DB url next to the main DB
26+
if [ -z "$SHADOW_DATABASE_URL" ]; then
27+
export SHADOW_DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOST}:${DB_PORT}/${POSTGRES_DB}_shadow?schema=${DB_SCHEMA:-public}"
28+
echo "[ENTRYPOINT] Built SHADOW_DATABASE_URL from components"
29+
fi
30+
1931
# Colors for output
2032
RED='\033[0;31m'
2133
GREEN='\033[0;32m'
@@ -38,7 +50,16 @@ echo -e "${GREEN}✅ Database is ready.${NC}"
3850
# 'prisma migrate deploy' is the command intended for production/CI/CD environments.
3951
# It applies pending migrations without generating new ones.
4052
echo -e "${YELLOW}🔄 Running database migrations...${NC}"
41-
npx prisma migrate deploy
53+
echo "[ENTRYPOINT] Working dir: $(pwd)"
54+
echo "[ENTRYPOINT] Prisma schema file: ./prisma/schema.prisma"
55+
echo "[ENTRYPOINT] Database connection (redacted):"
56+
echo " DB_HOST=$DB_HOST"
57+
echo " DB_PORT=$DB_PORT"
58+
echo " POSTGRES_DB=${POSTGRES_DB:-<not set>}"
59+
echo " DB_SCHEMA=${DB_SCHEMA:-public}"
60+
61+
# Explicitly pass the schema path to avoid ambiguity and help debugging
62+
npx prisma migrate deploy --schema=./prisma/schema.prisma
4263

4364
echo -e "${GREEN}✅ Migrations complete.${NC}"
4465

nest-cli.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"deleteOutDir": true,
77
"builder": "swc",
88
"typeCheck": true,
9-
"plugins": ["@nestjs/swagger/plugin", "@nestjs/graphql/plugin"]
9+
"plugins": ["@nestjs/swagger/plugin"]
1010
},
1111
"paths": {
1212
"@/*": ["./src/*"]

package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"private": true,
77
"license": "DWTFYW License.",
88
"scripts": {
9+
"dev": "pnpm start:dev",
910
"build": "nest build",
1011
"docker-build": "docker-compose down api && docker-compose up -d --build api",
1112
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
@@ -21,13 +22,10 @@
2122
"test:e2e": "jest --config ./test/jest-e2e.json"
2223
},
2324
"dependencies": {
24-
"@apollo/server": "^5.2.0",
2525
"@metinseylan/nestjs-opentelemetry": "^3.0.0",
26-
"@nestjs/apollo": "^13.2.3",
2726
"@nestjs/common": "^11.1.12",
2827
"@nestjs/config": "^4.0.2",
2928
"@nestjs/core": "^11.1.12",
30-
"@nestjs/graphql": "^13.2.3",
3129
"@nestjs/jwt": "^11.0.2",
3230
"@nestjs/passport": "^11.0.5",
3331
"@nestjs/platform-express": "^11.1.12",
@@ -55,9 +53,6 @@
5553
"dotenv": "^17.2.3",
5654
"firebase-admin": "^13.6.0",
5755
"google-auth-library": "^10.5.0",
58-
"graphql": "^16.12.0",
59-
"graphql-scalars": "^1.25.0",
60-
"graphql-subscriptions": "^3.0.0",
6156
"helmet": "^8.1.0",
6257
"ioredis": "^5.9.2",
6358
"joi": "^18.0.2",
@@ -69,7 +64,6 @@
6964
"pino": "^10.2.0",
7065
"pino-pretty": "^13.1.3",
7166
"prisma-dbml-generator": "^0.12.0",
72-
"prisma-graphql-type-decimal": "^3.0.1",
7367
"reflect-metadata": "^0.2.2",
7468
"rxjs": "^7.8.2",
7569
"semver": "^7.7.3",

0 commit comments

Comments
 (0)