Skip to content

Commit

Permalink
Add app package
Browse files Browse the repository at this point in the history
Ref: #7
  • Loading branch information
projkov committed Sep 10, 2024
1 parent 0e81966 commit 8af6e57
Show file tree
Hide file tree
Showing 40 changed files with 124 additions and 108 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ COPY . .

RUN yarn install

WORKDIR /app/packages/app

EXPOSE 8080
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pull:
$(compose) $(dev_env) $(dev_profile) pull

build:
$(compose) $(dev_env) $(dev_profile) build
$(compose) $(dev_env) $(dev_profile) build --no-cache

up:
$(compose) $(dev_env) $(dev_profile) up
Expand Down
66 changes: 0 additions & 66 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,73 +16,7 @@
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest --testPathIgnorePatterns='/suites/'",
"test:watch": "jest --testPathIgnorePatterns='/suites/' --watch",
"test:cov": "jest --testPathIgnorePatterns='/suites/' --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --testPathIgnorePatterns='/suites/' --config ./test/jest-e2e.json",
"typecheck": "tsc --noEmit",
"prepare": "npm run prepare --workspaces"
},
"dependencies": {
"@medplum/core": "^3.2.4",
"@nestjs/common": "^10.0.0",
"@nestjs/config": "^3.2.3",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/swagger": "^7.4.0",
"@nestjs/typeorm": "^10.0.2",
"@types/fhir": "^0.0.41",
"axios": "^1.7.4",
"dotenv": "^16.4.5",
"flatted": "^3.3.1",
"http-proxy": "^1.18.1",
"http-proxy-middleware": "^3.0.0",
"pg": "^8.12.0",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1",
"swagger-ui-express": "^5.0.1",
"typeorm": "^0.3.20"
},
"devDependencies": {
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.2",
"@types/node": "^20.3.1",
"@types/supertest": "^6.0.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.5.0",
"prettier": "^3.0.0",
"source-map-support": "^0.5.21",
"supertest": "^7.0.0",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.3",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.1.3"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"testTimeout": 30000,
"rootDir": "./",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
File renamed without changes.
File renamed without changes.
85 changes: 85 additions & 0 deletions packages/app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"name": "backend",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest --testPathIgnorePatterns='/suites/'",
"test:watch": "jest --testPathIgnorePatterns='/suites/' --watch",
"test:cov": "jest --testPathIgnorePatterns='/suites/' --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --testPathIgnorePatterns='/suites/' --config ./test/jest-e2e.json",
"typecheck": "tsc --noEmit",
"prepare": "tsc"
},
"dependencies": {
"@medplum/core": "^3.2.4",
"@nestjs/common": "^10.0.0",
"@nestjs/config": "^3.2.3",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/swagger": "^7.4.0",
"@nestjs/typeorm": "^10.0.2",
"@types/fhir": "^0.0.41",
"axios": "^1.7.4",
"dotenv": "^16.4.5",
"flatted": "^3.3.1",
"http-proxy": "^1.18.1",
"http-proxy-middleware": "^3.0.0",
"pg": "^8.12.0",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1",
"swagger-ui-express": "^5.0.1",
"typeorm": "^0.3.20"
},
"devDependencies": {
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.2",
"@types/node": "^20.3.1",
"@types/supertest": "^6.0.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.5.0",
"prettier": "^3.0.0",
"source-map-support": "^0.5.21",
"supertest": "^7.0.0",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.3",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.1.3"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"testTimeout": 30000,
"rootDir": "./",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { All, Controller, Param, Req, Res } from '@nestjs/common';
import { ApiTags, ApiOperation, ApiParam } from '@nestjs/swagger';
import { createRequestObject } from 'src/utils/data';
import { captureResponseBody } from '@beda.software/client-testing-proxy-helpers';
import { RequestService } from '../requests/request.service';
import { SessionService } from '../sessions/session.service';
import { Request, Response } from 'express';
import { createRequestObject } from '../../utils/data';

@ApiTags('proxy')
@Controller('proxy')
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ApiProperty } from '@nestjs/swagger';
import { Request as RequestType, Response } from 'express';
import { Session } from '../sessions/session.entity';
import { jsonbType } from 'src/utils/types';
import { jsonbType } from '../../utils/types';

export class CreateRequestDto {
@ApiProperty({ description: 'Session associated with the request' })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Response, Request as RequestType } from 'express';
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, ManyToOne } from 'typeorm';
import { Session } from '../sessions/session.entity';
import { jsonbType } from 'src/utils/types';
import { jsonbType } from '../../utils/types';

@Entity()
export class Request {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { runCLI } from '@jest/core';
import { TestRunService } from './testRun.service';
import { SessionService } from '../sessions/session.service';
import { TestRun } from './testRun.entity';
import { createTestListObject } from 'src/utils/data';
import { createTestListObject } from '../../utils/data';

const testOptions = {
globalSetup: './src/utils/setup/jest.setup.ts',
globalTeardown: './src/utils/setup/jest.teardown.ts',
globalSetup: './../../utils/setup/jest.setup.ts',
globalTeardown: './../../utils/setup/jest.teardown.ts',
rootDir: './',
testEnvironment: 'node',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
import { json } from 'node:stream/consumers';
import { jsonbType } from 'src/utils/types';
import { jsonbType } from '../../utils/types';
import { Session } from '../sessions/session.entity';

export class CreateTestRunDto {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Column, CreateDateColumn, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { Session } from '../sessions/session.entity';
import { jsonbType } from 'src/utils/types';
import { jsonbType } from '../../utils/types';

export enum TestRunStatus {
NOT_STARTED = 'not-started',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request } from 'src/modules/requests/request.entity';
import { Request } from '../modules/requests/request.entity';
import { Repository } from 'typeorm';

/**
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/utils/data.ts → packages/app/src/utils/data.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { parseSearchRequest } from '@medplum/core';
import { Request, Response } from 'express';
import { CreateRequestDto } from 'src/modules/requests/request.dto';
import { Session } from 'src/modules/sessions/session.entity';
import { CreateRequestDto } from '../modules/requests/request.dto';
import { Session } from '../modules/sessions/session.entity';
import { getFHIRAction } from '@beda.software/client-testing-helpers';

export function createRequestObject(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions packages/app/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
}
21 changes: 21 additions & 0 deletions packages/app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "ES2021",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"skipLibCheck": true,
"strictNullChecks": false,
"noImplicitAny": false,
"strictBindCallApply": false,
"forceConsistentCasingInFileNames": false,
"noFallthroughCasesInSwitch": false
}
}
21 changes: 0 additions & 21 deletions test/app.e2e-spec.ts

This file was deleted.

9 changes: 0 additions & 9 deletions test/jest-e2e.json

This file was deleted.

0 comments on commit 8af6e57

Please sign in to comment.