From 5233c60da8f9826acb91ebb5058ebf2150503339 Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Wed, 6 Dec 2023 17:13:51 +0530 Subject: [PATCH] feat: creating segway setup --- packages/tsconfig/express.json | 17 ++++++++++++++++ segway/.env.example | 2 ++ segway/Dockerfile | 21 +++++++++++++++++++ segway/README.md | 3 +++ segway/package.json | 36 +++++++++++++++++++++++++++++++++ segway/src/controllers/index.ts | 0 segway/src/middlewares/index.ts | 0 segway/src/server.ts | 0 segway/src/start.ts | 0 segway/tsconfig.json | 8 ++++++++ 10 files changed, 87 insertions(+) create mode 100644 packages/tsconfig/express.json create mode 100644 segway/.env.example create mode 100644 segway/Dockerfile create mode 100644 segway/README.md create mode 100644 segway/package.json create mode 100644 segway/src/controllers/index.ts create mode 100644 segway/src/middlewares/index.ts create mode 100644 segway/src/server.ts create mode 100644 segway/src/start.ts create mode 100644 segway/tsconfig.json diff --git a/packages/tsconfig/express.json b/packages/tsconfig/express.json new file mode 100644 index 000000000..6955f87bc --- /dev/null +++ b/packages/tsconfig/express.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "es2016", + "module": "commonjs", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "outDir": "./dist", + "baseUrl": "./src", + "moduleResolution": "node", + "experimentalDecorators": true, + "emitDecoratorMetadata": true + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules"] +} diff --git a/segway/.env.example b/segway/.env.example new file mode 100644 index 000000000..2cfe3e12e --- /dev/null +++ b/segway/.env.example @@ -0,0 +1,2 @@ +APP_ENV=local +SERVER_PORT=9000 diff --git a/segway/Dockerfile b/segway/Dockerfile new file mode 100644 index 000000000..0d1ef582a --- /dev/null +++ b/segway/Dockerfile @@ -0,0 +1,21 @@ +# Use the official Node.js 18-alpine image as the base image +FROM node:18-alpine + +# Set the working directory inside the container +WORKDIR /usr/src/app + +# Copy package.json and package-lock.json to the working directory +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the rest of the application code to the working directory +COPY . . + +# Build the TypeScript code +RUN npm run build + +# Expose the port that your application will run on +EXPOSE 9000 + diff --git a/segway/README.md b/segway/README.md new file mode 100644 index 000000000..0dbd6bce8 --- /dev/null +++ b/segway/README.md @@ -0,0 +1,3 @@ +# Plane Segway + +A node process that take care of external integration with plane. diff --git a/segway/package.json b/segway/package.json new file mode 100644 index 000000000..c8cc3e2e5 --- /dev/null +++ b/segway/package.json @@ -0,0 +1,36 @@ +{ + "name": "segway", + "version": "0.0.1", + "description": "An integration service syncs plane data with external sources.", + "author": "plane team", + "license": "ISC", + "private": true, + "scripts": { + "build": "npx tsc", + "start": "node dist/start.js", + "dev": "concurrently \"npx tsc --watch\" \"nodemon -q dist/start.js\"" + }, + "dependencies": { + "@overnightjs/core": "^1.7.6", + "@sentry/node": "^7.73.0", + "@sentry/tracing": "^7.73.0", + "cors": "^2.8.5", + "dotenv": "^16.3.1", + "drizzle-orm": "^0.28.6", + "express": "^4.18.2", + "postgres": "^3.4.1", + "stripe": "^14.1.0", + "winston": "^3.10.0", + "zod": "^3.22.4" + }, + "devDependencies": { + "@types/cors": "^2.8.14", + "@types/express": "^4.17.18", + "@types/node": "^20.8.3", + "@types/pg": "^8.10.7", + "concurrently": "^8.2.1", + "drizzle-kit": "^0.19.13", + "nodemon": "^3.0.1", + "typescript": "^5.2.2" + } +} diff --git a/segway/src/controllers/index.ts b/segway/src/controllers/index.ts new file mode 100644 index 000000000..e69de29bb diff --git a/segway/src/middlewares/index.ts b/segway/src/middlewares/index.ts new file mode 100644 index 000000000..e69de29bb diff --git a/segway/src/server.ts b/segway/src/server.ts new file mode 100644 index 000000000..e69de29bb diff --git a/segway/src/start.ts b/segway/src/start.ts new file mode 100644 index 000000000..e69de29bb diff --git a/segway/tsconfig.json b/segway/tsconfig.json new file mode 100644 index 000000000..34195b1db --- /dev/null +++ b/segway/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "tsconfig/express.json", + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "additional.d.ts"], + "exclude": ["node_modules"], + "compilerOptions": { + "baseUrl": "src/" + } +}