English docs | 中文文档
Emmm, this is my final homework for Fundamentals of Computer Network Technology. (Maybe a little scribble)
This project is a web python editor and compiler, which is based on CodeMirror6 and WebSocket.
Frontend: Typescript + Vue3 + Vite + MDUI + CodeMirror6
Communication: WebSocket
Backend: Node.js (CommonJS) + Python3
- Node.js (required)
- Python3 (run python scripts, required)
- PyPy (run python scripts, optional)
nginx (optional)Docker and docker-compose (optional)
# pnpm and yarn are also recommended
git clone git@github.com:chillcicada/codemirror4hw.git
cd codemirror4hw
npm i
Refer to Online Python Tutor.
There are many ways to run this project.
The project uses vite-plugin-eslint to lint the code, if you run npm run build
you may meet an error caused by the conflict between vite-plugin-eslint and new current typescript. Below is the solution:
Add the "type": "index.d.ts"
to the "exports"
of vite-plugin-eslint's package.json.
// node_modules/vite-plugin-eslint/package.json
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts" // add this line
}
}
# start the websocket server
npm run start
# start the preview web
npm run dev
Or, you can build it and set proxy server.
npm run build
The dist/
folder is under the project's root directory.
Some features have not yet been implemented, so stay tuned :)
- refine Nginx.conf
- add Dockerfile
- add debug mode
- ......
All other mentioned dependencies are also appreciated.
Except for the following situations:
If you are a student of THU and you are doing the same or similar final homework, you can use this project as a reference without limitation, but you should not copy the code directly. Well, if you make your homework based on this project, you should shoot me an email, and don't forget to invite me for a fruit tea.
:)