Giter Club home page Giter Club logo

jar-oj-backend's Introduction

Jar OJ 题目评测系统

技术栈:

前端: Vue3 + Vuex + Arco Design + TypeScript + ESLint + Prettier + OpenAPI + Monaco Editor + ByteMD

前端仓库:https://github.com/Jarvlis/Jar-OJ-frontend

后端:Java8 + SpringBoot2.7 + MyBatis-Plus + Docker + MySQL5.7 + Redis

自主搭建的在线判题系统。系统可根据管理员发布的题目和预设的判题用例,将用户提交的代码执行与评测,并且系统提供了单独调用自主实现的代码沙箱的接口。

工具类

  • Easy Excel 表格处理
  • Hutool 工具库
  • Gson 解析库
  • Apache Commons Lang3 工具类
  • Lombok 注解

后端功能

  • Spring Session Redis 分布式登录
  • 全局请求响应拦截器(记录日志)
  • 全局异常处理器
  • 自定义错误码
  • 封装通用响应类
  • Swagger + Knife4j 接口文档
  • 自定义权限注解 + 全局校验
  • 全局跨域处理
  • 多环境配置

系统功能

单元测试

  • JUnit5 单元测试
  • 示例单元测试类

MySQL 数据库

1)修改 application.yml 的数据库配置为你自己的:

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/my_db
    username: root
    password: 123456

2)执行 sql/create_table.sql 中的数据库语句,自动创建库表

3)启动项目,访问 http://localhost:8101/api/doc.html 即可打开接口文档,不需要写前端就能在线调试接口了~

Redis 分布式登录

1)修改 application.yml 的 Redis 配置为你自己的:

spring:
  redis:
    database: 1
    host: localhost
    port: 6379
    timeout: 5000
    password: 123456

2)修改 application.yml 中的 session 存储方式:

spring:
  session:
    store-type: redis

3)移除 MainApplication 类开头 @SpringBootApplication 注解内的 exclude 参数:

修改前:

@SpringBootApplication(exclude = {RedisAutoConfiguration.class})

修改后:

@SpringBootApplication 

项目时序图

(消息队列暂时未加入项目中, 过阵子会将RabbitMQ加入, 并且增设C++ 、 Python 、 JavaScript语言支持, 最后将项目改造为微服务)

yuque_diagram (1)

项目展示

登录页面

image

注册页面

image

题目页面

image

做题页面

image

题目提交页面

image

管理题目页面

image

创建题目页面

image

项目待扩展点

  • 消息队列暂时未加入项目中, 过阵子会将RabbitMQ加入
  • 并且增设C++ 、 Python 、 JavaScript语言支持
  • 最后将项目改造为微服务
  • 增设更多用户友好型提示(如在做题页面即可浏览到做题结果)
  • 根据输入的题目分析判题数据图
  • 我的注销和个人做题分析页面
  • 做题目前仅支持args模式,可以扩展acm模式和力扣模式

jar-oj-backend's People

Contributors

jarvlis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.