Skip to content

yuzhanglong/YuJudge

Repository files navigation

快速上手 | 调试与部署 | 版本日志

package-json react typescript

快速上手

点击访问

在线DEMO

测试网站 CodeSandbox(可修改代码实时预览)

调试与部署

项目打包基于webpack,当前分支已经运行了yarn eject,webpack配置需要开发者自行管理。

webpack配置文件位于config/webpack目录之下。

yarn脚本文件位于script目录之下。

安装

yarn install

安装无法运行可以尝试(node-sass安装的问题)

npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
yarn install

开发环境运行

yarn start

生产环境打包

yarn build

带外链的生产环境打包

打开package.json,修改 buildWithPrefix

"scripts": {
    "start": "node scripts/start.js",
    "build": "node scripts/build.js",
    "test": "node scripts/test.js",
    "buildWithPrefix": "node scripts/build.js http://cdn.yuzzl.top(你的外链地址)",
    "upload": "node scripts/upload.js"
}

执行

yarn buildWithPrefix

此时打包出来的所有js、css、图片(public文件夹内的静态文件除外)等依赖,均指向你的外链地址而不是build文件夹的根目录。

集成七牛存储服务

如果你使用七牛的云存储服务来保存静态文件的话,你可以试试:

打开script/upload.js, 找到下面内容,按照注释进行修改

// 上传凭证以及配置
const ACCESS_KEY = 'o4fgM7P2lPEyo3已经作废FZ7s_NGdo_xJVNDdKf55apCubX';
const SECRET_KEY = 'YxRkcS8o-GSLMo1已经作废ajWuLjeFxFsMo1WKnOvyrLjB8';
// bucket
const options = {
  scope: "yzlyz已经作废l123",
};
// 空间对应的机房
config.zone = uploader.zone.Zone_z2;

带外链打包

yarn buildWithPrefix

执行上传脚本

yarn upload

所有css、js等静态文件会被自动上传至七牛服务器,你只需要将index.html、一些图标文件传上服务器进行托管即可。

它是如何工作的?

请参考这篇文章

另请参阅

服务端:https://github.com/yuzhanglong/YuJudge-JudgeServer

判题机:https://github.com/yuzhanglong/YuJudge-JudgeHost

判题核心:https://github.com/yuzhanglong/YuJudge-Core

版本日志

最新版本 1.0.0

1.0.0

发布前后端项目至GitHub

About

💡 An online judge system based on React & TypeScript, with complete secondary development documents

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published