Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
e1e3152
chore: enhance buildspec and next.config for improved build verificat…
claudfuen Aug 4, 2025
29c82e5
Merge pull request #1258 from trycompai/claudio/fix-file-upload
claudfuen Aug 4, 2025
1a9ef99
chore: clean up buildspec and next.config for improved readability
claudfuen Aug 5, 2025
51162ac
feat: implement comments and attachments functionality in API
claudfuen Aug 5, 2025
bde32c4
feat: update Trust Portal to include HIPAA compliance framework
claudfuen Aug 5, 2025
8fad94d
refactor: enhance comment and task attachment handling with API hooks
claudfuen Aug 5, 2025
7fe5669
feat: implement optimistic updates for comments and task attachments
claudfuen Aug 5, 2025
1b29833
Merge pull request #1260 from trycompai/claudio/fix-file-upload
claudfuen Aug 5, 2025
a126ca5
refactor: improve optimistic updates for comments and task attachments
claudfuen Aug 5, 2025
758cbb2
feat: implement auto-resizing for TaskBody textarea
claudfuen Aug 5, 2025
245fe7e
Merge pull request #1261 from trycompai/claudio/fix-file-upload
claudfuen Aug 5, 2025
f31ee34
feat: add NEXT_PUBLIC_API_URL environment variable
claudfuen Aug 5, 2025
e57170d
refactor: update API client to use environment configuration for base…
claudfuen Aug 5, 2025
66554a8
Merge pull request #1262 from trycompai/claudio/fix-file-upload
claudfuen Aug 5, 2025
aa9618c
chore: remove deprecated comment and attachment API actions
claudfuen Aug 5, 2025
0034f31
Merge pull request #1263 from trycompai/claudio/fix-file-upload
claudfuen Aug 5, 2025
e7d8521
feat: enable cross-subdomain cookies for authentication
claudfuen Aug 5, 2025
72888e0
Merge pull request #1264 from trycompai/claudio/fix-file-upload
claudfuen Aug 5, 2025
1d95394
feat: update API client and auth utility to use Bearer token authenti…
claudfuen Aug 5, 2025
2786ef6
feat: implement JWT authentication and update related components
claudfuen Aug 5, 2025
bdfe41c
Merge pull request #1265 from trycompai/claudio/fix-file-upload
claudfuen Aug 5, 2025
9cc1f88
feat: add migration for JWKS table to support JWT authentication
claudfuen Aug 5, 2025
e849534
Merge pull request #1266 from trycompai/claudio/fix-file-upload
claudfuen Aug 5, 2025
6c102ee
chore: update @trycompai/db package version to 1.3.2 in bun.lock and …
claudfuen Aug 5, 2025
81c4c3a
feat: integrate Prisma client and update database schema handling
claudfuen Aug 5, 2025
aa48952
Merge pull request #1267 from trycompai/claudio/fix-file-upload
claudfuen Aug 5, 2025
347e47f
chore: enhance buildspec.yml for improved NestJS application build pr…
claudfuen Aug 5, 2025
8115c98
Merge pull request #1268 from trycompai/claudio/fix-file-upload
claudfuen Aug 5, 2025
41a42a9
chore: update bun.lock and buildspec.yml for dependency management im…
claudfuen Aug 5, 2025
3ace934
Merge pull request #1270 from trycompai/claudio/fix-file-upload
claudfuen Aug 5, 2025
430e601
chore: refine buildspec.yml comments for clarity
claudfuen Aug 5, 2025
810c59f
chore: update dependencies in package.json and bun.lock for AWS SDK i…
claudfuen Aug 5, 2025
6848da2
Merge pull request #1271 from trycompai/claudio/fix-file-upload
claudfuen Aug 5, 2025
8c3469e
chore: update buildspec.yml and Dockerfile for NestJS application str…
claudfuen Aug 5, 2025
ccf78d0
Merge pull request #1273 from trycompai/claudio/fix-file-upload
claudfuen Aug 5, 2025
fb648ef
chore: update package version to 1.3.2 in db package
Marfuen Aug 5, 2025
a43b9bc
chore: update buildspec.yml and tsconfig.json for Prisma integration
claudfuen Aug 5, 2025
485634e
Merge pull request #1275 from trycompai/claudio/fix-file-upload
claudfuen Aug 5, 2025
19e2a66
chore: update buildspec.yml for direct S3 asset access
claudfuen Aug 5, 2025
3487041
fix: update assetPrefix configuration to ensure proper URL handling i…
Marfuen Aug 5, 2025
2775fa8
Merge pull request #1274 from trycompai/mariano/bump-db-version
Marfuen Aug 5, 2025
7f683ad
Merge branch 'main' of https://github.com/trycompai/comp into claudio…
claudfuen Aug 5, 2025
3e7c4cb
Merge branch 'release' of https://github.com/trycompai/comp into clau…
claudfuen Aug 5, 2025
74a7ff8
Merge branch 'claudio/fix-file-upload' of https://github.com/trycompa…
claudfuen Aug 5, 2025
2268b24
Merge pull request #1282 from trycompai/claudio/fix-portal
claudfuen Aug 5, 2025
9d0437e
feat: add TipTap content validation utilities for AI-generated content
Marfuen Aug 6, 2025
a767884
feat: add BETTER_AUTH_URL to environment variables and buildspec vali…
claudfuen Aug 6, 2025
6de3905
Merge pull request #1290 from trycompai/claudio/fix-portal
claudfuen Aug 6, 2025
23d4f16
Merge pull request #1289 from trycompai/mariano/empty-policies-releas…
Marfuen Aug 6, 2025
170c084
chore: remove buildspec.yml files for app and portal
claudfuen Aug 6, 2025
3868a3e
feat: enhance HybridAuthGuard and update authentication interfaces
claudfuen Aug 6, 2025
e61a94b
refactor: remove legacy authentication interfaces and streamline API …
claudfuen Aug 6, 2025
f85027f
Merge pull request #1291 from trycompai/claudio/fix-portal
claudfuen Aug 6, 2025
33af882
feat: implement session-based JWT retrieval in ApiClient
claudfuen Aug 6, 2025
1da0db8
refactor: implement JWT management for improved token handling
claudfuen Aug 6, 2025
fd7adb0
Merge pull request #1292 from trycompai/claudio/fix-portal
claudfuen Aug 6, 2025
5efbfb5
refactor: remove unused head elements from layout component
claudfuen Aug 6, 2025
6ebc824
refactor: remove unused quality attribute from Avatar component
claudfuen Aug 6, 2025
99e826d
Merge pull request #1294 from trycompai/claudio/fix-portal
claudfuen Aug 6, 2025
b944f48
refactor: replace BETTER_AUTH_URL with NEXT_PUBLIC_BETTER_AUTH_URL in…
claudfuen Aug 6, 2025
79c4bc8
Merge pull request #1295 from trycompai/claudio/fix-portal
claudfuen Aug 6, 2025
a3f0679
refactor: streamline comments handling across various components
claudfuen Aug 6, 2025
7972318
Merge pull request #1296 from trycompai/claudio/fix-portal
claudfuen Aug 6, 2025
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: 3 additions & 0 deletions apps/api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ pids

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json


prisma/schema.prisma
2 changes: 1 addition & 1 deletion apps/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3333/v1/health || exit 1

# Start the application
CMD ["node", "main.js"]
CMD ["node", "src/main.js"]
52 changes: 34 additions & 18 deletions apps/api/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,52 @@ phases:
- echo "Validating environment variables..."
- '[ -n "$DATABASE_URL" ] || { echo "❌ DATABASE_URL is not set"; exit 1; }'
- '[ -n "$BASE_URL" ] || { echo "❌ BASE_URL is not set"; exit 1; }'
- '[ -n "$BETTER_AUTH_URL" ] || { echo "❌ BETTER_AUTH_URL is not set"; exit 1; }'

# Install dependencies
- echo "Installing dependencies..."
- bun install --frozen-lockfile

# Generate Prisma client
- echo "Generating Prisma client..."
- cd packages/db && bun x prisma generate && cd ../../
# Install only API workspace dependencies
- echo "Installing API dependencies only..."
- bun install --filter=@comp/api --frozen-lockfile

# Build NestJS application
# Build NestJS application (prebuild automatically handles Prisma)
- echo "Building NestJS application..."
- cd apps/$APP_NAME && bun run build && cd ../../
- echo "APP_NAME is set to $APP_NAME"
- echo "Current directory $(pwd)"
- echo "Available apps $(ls -la apps/)"
- cd apps/api
- echo "Changed to $(pwd)"
- echo "Running build (includes automatic prebuild db:generate)..."
- bun run build

# Verify build output exists
- echo "Checking build output..."
- ls -la dist/
- ls -la dist/src/
- '[ -f "dist/src/main.js" ] || { echo "❌ main.js not found in dist/src"; exit 1; }'

# Create self-contained bundle for Docker
# Create self-contained bundle for Docker (stay in apps/api)
- echo "Creating self-contained bundle..."
- cd apps/$APP_NAME
- mkdir -p ../docker-build

# Copy built application
# Copy built application (preserves NestJS structure)
- echo "Copying built application..."
- cp -r dist/* ../docker-build/

# Copy entire node_modules for runtime (simpler and comprehensive)
# Copy prisma folder (needed for runtime imports)
- echo "Copying prisma folder..."
- cp -r prisma ../docker-build/

# Verify files were copied correctly
- echo "Verifying copied files..."
- ls -la ../docker-build/
- ls -la ../docker-build/src/
- '[ -f "../docker-build/src/main.js" ] || { echo "❌ main.js not found in docker-build/src"; exit 1; }'

# Copy entire node_modules for runtime (includes @trycompai/db from npm)
- echo "Bundling all runtime dependencies..."
- cp -r ../../node_modules ../docker-build/

# Copy @trycompai/db package
- mkdir -p ../docker-build/node_modules/@trycompai
- cp -r ../../packages/db ../docker-build/node_modules/@trycompai/

# Copy Dockerfile
- echo "Copying Dockerfile..."
- cp Dockerfile ../docker-build/

# Build Docker image
Expand All @@ -69,7 +85,7 @@ phases:
- docker push $ECR_REPOSITORY_URI:latest
- echo "Updating ECS service..."
- aws ecs update-service --cluster $ECS_CLUSTER_NAME --service $ECS_SERVICE_NAME --force-new-deployment
- 'printf "[{\"name\":\"%s-container\",\"imageUri\":\"%s\"}]" $APP_NAME $ECR_REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json'
- 'printf "[{\"name\":\"%s-container\",\"imageUri\":\"%s\"}]" api $ECR_REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json'

cache:
paths:
Expand Down
9 changes: 7 additions & 2 deletions apps/api/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ export default tseslint.config(
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn'
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
},
},
);
);
12 changes: 10 additions & 2 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,24 @@
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"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:e2e": "jest --config ./test/jest-e2e.json",
"typecheck": "tsc --noEmit",
"db:generate": "bun run db:getschema && prisma generate",
"db:getschema": "cp ../../node_modules/@trycompai/db/dist/schema.prisma prisma/schema.prisma",
"prebuild": "bun run db:generate"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.859.0",
"@aws-sdk/s3-request-presigner": "^3.859.0",
"@nestjs/common": "^11.0.1",
"@nestjs/config": "^4.0.2",
"@nestjs/core": "^11.0.1",
"@nestjs/platform-express": "^11.1.5",
"@nestjs/swagger": "^11.2.0",
"@trycompai/db": "file:../../packages/db",
"@trycompai/db": "^1.3.2",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.2",
"jose": "^6.0.12",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1",
"swagger-ui-express": "^5.0.1",
Expand Down
7 changes: 7 additions & 0 deletions apps/api/prisma/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { PrismaClient } from '@prisma/client';

const globalForPrisma = global as unknown as { prisma: PrismaClient };

export const db = globalForPrisma.prisma || new PrismaClient();

if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = db;
2 changes: 2 additions & 0 deletions apps/api/prisma/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from '@prisma/client';
export { db } from './client';
21 changes: 20 additions & 1 deletion apps/api/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AttachmentsModule } from './attachments/attachments.module';
import { AuthModule } from './auth/auth.module';
import { CommentsModule } from './comments/comments.module';
import { awsConfig } from './config/aws.config';
import { HealthModule } from './health/health.module';
import { OrganizationModule } from './organization/organization.module';
import { TasksModule } from './tasks/tasks.module';

@Module({
imports: [AuthModule, OrganizationModule, TasksModule, HealthModule],
imports: [
ConfigModule.forRoot({
isGlobal: true,
load: [awsConfig],
validationOptions: {
allowUnknown: true,
abortEarly: true,
},
}),
AuthModule,
OrganizationModule,
AttachmentsModule,
TasksModule,
CommentsModule,
HealthModule,
],
controllers: [AppController],
providers: [AppService],
})
Expand Down
8 changes: 8 additions & 0 deletions apps/api/src/attachments/attachments.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Module } from '@nestjs/common';
import { AttachmentsService } from './attachments.service';

@Module({
providers: [AttachmentsService],
exports: [AttachmentsService],
})
export class AttachmentsModule {}
Loading
Loading