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
62 changes: 0 additions & 62 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,62 +0,0 @@
{
"name": "tradeflow-api",
"version": "0.0.1",
"description": "TradeFlow RWA Backend",
"scripts": {
"build": "nest build",
"start": "nest start",
"start:dev": "nest start --watch",
"test": "jest",
"test:risk": "ts-node src/test-risk.ts",
"migration:generate": "typeorm-ts-node-commonjs migration:generate -d src/datasource.ts",
"migration:run": "typeorm-ts-node-commonjs migration:run -d src/datasource.ts",
"migration:revert": "typeorm-ts-node-commonjs migration:revert -d src/datasource.ts",
"migration:manual": "ts-node src/migration-runner.ts"
},
"dependencies": {
"@nestjs/common": "^10.4.22",
"@nestjs/config": "^3.2.3",
"@nestjs/core": "^10.4.22",
"@nestjs/platform-express": "^10.4.22",
"@nestjs/swagger": "^7.1.1",
"@nestjs/typeorm": "^10.0.2",
"@stellar/stellar-sdk": "^11.0.0",
"@types/jsonwebtoken": "^9.0.10",
"jsonwebtoken": "^9.0.3",
"pg": "^8.11.0",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.2",
"swagger-ui-express": "^5.0.0",
"typeorm": "^0.3.20",
"xss-clean": "^0.1.1"
},
"devDependencies": {
"@nestjs/cli": "^11.0.16",
"@nestjs/testing": "^10.4.22",
"@types/express": "^5.0.6",
"@types/jest": "^30.0.0",
"@types/node": "^25.2.3",
"jest": "^30.2.0",
"ts-jest": "^29.4.6",
"@types/pdf-parse": "^1.1.5",
"ts-node": "^10.9.2",
"typescript": "^5.9.3"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
35 changes: 0 additions & 35 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,35 +0,0 @@
import { NestFactory } from '@nestjs/core';
import { ValidationPipe } from '@nestjs/common';
import { AppModule } from './app.module';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import * as xssClean from 'xss-clean';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
// Configure CORS for secure cross-origin communication
app.enableCors({
origin: [
'http://localhost:3000', // Local development environment
'https://tradeflow-web.vercel.app', // Production environment
],
methods: ['GET', 'POST', 'PUT', 'PATCH'],
credentials: true,
});

// Apply XSS protection middleware globally
app.use(xssClean());

// Enable validation pipes
app.useGlobalPipes(new ValidationPipe());

const config = new DocumentBuilder()
.setTitle('TradeFlow API')
.setDescription('API documentation for the TradeFlow application')
.setVersion('1.0')
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('api/docs', app, document);

await app.listen(3000);
}
bootstrap();
Loading