- Author: J-Hoplin
- Team
- J-Hoplin: Backend & Infrastructure
- Oseungkwon: Frontend
Use web scraper to fill problem and problem example datas. You need to run this scraper after you execute Online Judge System
once.
- 📦Diagram
- 📦Github Actions CI flow
- 📊Test Coverage
- 🧰Technical Stack
- ✅Run Application
- 🐳Run Application with Docker
- 🐰Run Application with Rabbit MQ worker locally
- 📄Run E2E Test
- 📄Run Unit Test
- 📝TODO
You can either use AWS Environment or Docker envionment with this single repository
- Author: Oseungkwon
- Repository
- E2E Test: 88.12%
- Unit & Integration Test: 79.13%
- Language
- TypeScript(Node.js v18 Runtime)
- Framework
- Nest.js
- ORM
- Prisma ORM
- Database(Persistence & Caching)
- MySQL 8.0
- Redis
- AWS S3
- Issue Tracking
- Sentry
- Proxy Server
- Nginx
- Infrastructure
- Docker & Docker-Compose
- AWS Elastic Beanstalk(EC2 Instance)
- Node.js Runtime x2 (Worker Server & Web Server)
- Docker Runtime x1
- AWS Worker Communication
- AWS Auto Scaling Group
- AWS SQS: For worker server
- AWS S3: Build Versioning
- Test
- Jest
- Jest-Extended
- CI/CD
- Github Actions
- Code Pipeline & Code Build
- Alert
- Discord
-
Git clone repository
git clone https://github.com/J-Hoplin/Online-Judge-System.git cd Online-Judge-System
-
Install dependencies
yarn install
-
Run/Stop database with docker
# Start yarn db:dev:up
# Stop yarn db:dev:down
-
Sync prisma schema to database
yarn db:push
-
Run application
yarn dev
-
Build docker image
docker build -t online-judge .
-
Run with docker enviornment
yarn docker:up
-
Remove docker environment
yarn docker:down
To use Rabbit MQ worker, you need to set both TYPE
and QUEUE_TYPE
as webserver
and RMQ
each. This is fundamental setting to use Rabbit MQ worker setting.
TYPE="worker"
...
QUEUE_TYPE="RMQ"
RMQ_URL="amqp://root:password@rmq:5672"
RMQ_WORKER_QUEUE_NAME="JUDGE_QUEUE"
...
To modify docker rabbit mq worker's .env
file, modify .docker.worker.env
. And if you want to modify docker webserver application, modify .docker.env
.
-
Build docker image
yarn docker:build
-
Run integrated application docker compose environment
yarn docker:up
- Config: test/jest-e2e.json
- Mock Provider: test/mock.provider.ts
-
Run database
yarn db:dev:up
-
Initialize test database
yarn test:init
-
Run E2E Test
yarn test:e2e
-
Run E2E Coverage Test
yarn test:e2e:cov
- Config: test/jest-unit.json
- Mock Provider: test/mock.provider.ts
-
Run database
yarn db:dev:up
-
Initialize test database
yarn test:init
-
Run E2E Test
yarn test:unit
-
Run E2E Coverage Test
yarn test:unit:cov
- Apply Strategy Pattern to Asynchronous Worker
- Use Nest.js Custom Provider
- Rabbit MQ Strategy & AWS SQS Strategy
- Make Online Judge Server with Golang
- Now using Judge0 based custom server