├── bad-code ├── backend │ ├── .gitignore │ ├── .env.example │ ├── src │ │ ├── index.ts │ │ ├── http.ts │ │ ├── pty.ts │ │ ├── fs.ts │ │ ├── ws.ts │ │ └── aws.ts │ ├── package.json │ └── tsconfig.json └── frontend │ ├── src │ ├── vite-env.d.ts │ ├── config.ts │ ├── index.css │ ├── main.tsx │ ├── components │ │ ├── Output.tsx │ │ ├── external │ │ │ └── editor │ │ │ │ ├── components │ │ │ │ ├── sidebar.tsx │ │ │ │ ├── icon.tsx │ │ │ │ └── file-tree.tsx │ │ │ │ ├── utils │ │ │ │ ├── index.tsx │ │ │ │ └── file-manager.tsx │ │ │ │ └── editor │ │ │ │ └── code.tsx │ │ ├── Editor.tsx │ │ ├── Terminal.tsx │ │ ├── Landing.tsx │ │ └── CodingPage.tsx │ ├── App.tsx │ ├── assets │ │ └── react.svg │ └── App.css │ ├── vite.config.ts │ ├── tsconfig.node.json │ ├── .gitignore │ ├── index.html │ ├── .eslintrc.cjs │ ├── tsconfig.json │ ├── package.json │ ├── README.md │ └── public │ └── vite.svg ├── good-code ├── runner │ ├── .gitignore │ ├── .DS_Store │ ├── .env.example │ ├── src │ │ ├── index.ts │ │ ├── pty.ts │ │ ├── fs.ts │ │ ├── ws.ts │ │ └── aws.ts │ ├── Dockerfile │ ├── package.json │ └── tsconfig.json ├── init-service │ ├── .gitignore │ ├── src │ │ ├── .env.example │ │ ├── index.ts │ │ └── aws.ts │ ├── package.json │ └── tsconfig.json ├── orchestrator-simple │ ├── .gitignore │ ├── src │ │ ├── .env.example │ │ ├── index.ts │ │ └── aws.ts │ ├── package.json │ ├── service.yaml │ └── tsconfig.json ├── frontend │ ├── src │ │ ├── vite-env.d.ts │ │ ├── index.css │ │ ├── main.tsx │ │ ├── components │ │ │ ├── Output.tsx │ │ │ ├── external │ │ │ │ └── editor │ │ │ │ │ ├── components │ │ │ │ │ ├── sidebar.tsx │ │ │ │ │ ├── icon.tsx │ │ │ │ │ └── file-tree.tsx │ │ │ │ │ ├── utils │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── file-manager.tsx │ │ │ │ │ └── editor │ │ │ │ │ └── code.tsx │ │ │ ├── Editor.tsx │ │ │ ├── Terminal.tsx │ │ │ ├── Landing.tsx │ │ │ └── CodingPage.tsx │ │ ├── App.tsx │ │ ├── assets │ │ │ └── react.svg │ │ └── App.css │ ├── vite.config.ts │ ├── tsconfig.node.json │ ├── .gitignore │ ├── index.html │ ├── .eslintrc.cjs │ ├── tsconfig.json │ ├── package.json │ ├── README.md │ └── public │ │ └── vite.svg └── k8s │ └── ingress-controller.yaml └── README.md /bad-code/backend/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | tmp -------------------------------------------------------------------------------- /good-code/runner/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /good-code/init-service/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /good-code/orchestrator-simple/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /bad-code/frontend/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /good-code/frontend/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /bad-code/frontend/src/config.ts: -------------------------------------------------------------------------------- 1 | 2 | export const EXECUTION_ENGINE_URI = "ws://localhost:3001"; -------------------------------------------------------------------------------- /good-code/runner/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hkirat/repl/HEAD/good-code/runner/.DS_Store -------------------------------------------------------------------------------- /bad-code/backend/.env.example: -------------------------------------------------------------------------------- 1 | S3_BUCKET= 2 | AWS_ACCESS_KEY_ID= 3 | AWS_SECRET_ACCESS_KEY= 4 | S3_ENDPOINT= -------------------------------------------------------------------------------- /good-code/runner/.env.example: -------------------------------------------------------------------------------- 1 | S3_BUCKET= 2 | AWS_ACCESS_KEY_ID= 3 | AWS_SECRET_ACCESS_KEY= 4 | S3_ENDPOINT= -------------------------------------------------------------------------------- /good-code/init-service/src/.env.example: -------------------------------------------------------------------------------- 1 | S3_BUCKET= 2 | AWS_ACCESS_KEY_ID= 3 | AWS_SECRET_ACCESS_KEY= 4 | S3_ENDPOINT= -------------------------------------------------------------------------------- /good-code/orchestrator-simple/src/.env.example: -------------------------------------------------------------------------------- 1 | S3_BUCKET= 2 | AWS_ACCESS_KEY_ID= 3 | AWS_SECRET_ACCESS_KEY= 4 | S3_ENDPOINT= -------------------------------------------------------------------------------- /bad-code/frontend/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: 'Inter', sans-serif; 3 | font-size: 14px; 4 | 5 | background-color: #151515; 6 | color: white; 7 | zoom: 1; 8 | margin: 0; 9 | } 10 | -------------------------------------------------------------------------------- /good-code/frontend/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: 'Inter', sans-serif; 3 | font-size: 14px; 4 | 5 | background-color: #151515; 6 | color: white; 7 | zoom: 1; 8 | margin: 0; 9 | } 10 | -------------------------------------------------------------------------------- /bad-code/frontend/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /good-code/frontend/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /bad-code/frontend/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.tsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')!).render( 7 | , 8 | ) 9 | -------------------------------------------------------------------------------- /good-code/frontend/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.tsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')!).render( 7 | , 8 | ) 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Repl.it implementation 2 | Implementation of an online code editor in Node.js 3 | 4 | ## Stack 5 | Node.js 6 | K8s 7 | Express 8 | socket.io 9 | 10 | ## TODOs 11 | There are a bunch of TODOs that you can go through, there are bounties associated with all of them 12 | -------------------------------------------------------------------------------- /bad-code/frontend/src/components/Output.tsx: -------------------------------------------------------------------------------- 1 | 2 | const INSTANCE_URI = "http://localhost:3000"; 3 | 4 | export const Output = () => { 5 | return
6 |