Skip to content

Commit

Permalink
Merge pull request #30 from CE61-KMITL/dev-express
Browse files Browse the repository at this point in the history
Dev express
  • Loading branch information
khris-xp authored Jun 4, 2023
2 parents 3602627 + ce183c7 commit c23d20d
Show file tree
Hide file tree
Showing 33 changed files with 2,309 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PORT=
ALLOWED_ORIGINS=
JWT_SECRET=
API_URL=
NODE_ENV=
134 changes: 134 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

.scannerwork

temp
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
# CEBUXI-Grader
# CE BoostUp XI - Compiler

CE BoostUp XI Compiler is a RESTful API that compiles C/C++ code and returns the result. It is built with Express and TypeScript.

## Compilation Results

| Result | Description |
|--------|--------------------------------|
| C | Cannot Create File from Source Code |
| L | Banned Library Usage |
| F | Banned Function Usage |
| H | Hacker Attack |
| W | Testcase Error |
| S | Syntax Error |
| T | Timeout |
| O | Buffer Overflow |
| R | Runtime Error |
| E | General Error |
| P | Passed |
| - | Failed |
50 changes: 50 additions & 0 deletions data/banned.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#ifndef BANNED_H
#define BANNED_H
#define BANNED(func) SORRY_##func##_IS_A_BANNED_FUNCTION
#undef system
#define system(...) BANNED(system)
#undef sort
#define sort(...) BANNED(sort)
#undef stable_sort
#define stable_sort(...) BANNED(stable_sort)
#undef partial_sort
#define partial_sort(...) BANNED(partial_sort)
#undef search
#define search(...) BANNED(search)
#undef search_n
#define search_n(...) BANNED(search_n)
#undef reverse
#define reverse(...) BANNED(reverse)
#undef reverse_copy
#define reverse_copy(...) BANNED(reverse_copy)
#undef max
#define max(...) BANNED(max)
#undef min
#define min(...) BANNED(min)
#undef next_permutation
#define next_permutation(...) BANNED(next_permutation)
#undef swap
#define swap(...) BANNED(swap)
#undef qsort
#define qsort(...) BANNED(qsort)
#undef kill
#define kill(...) BANNED(kill)
#undef atexit
#define atexit(...) BANNED(atexit);
#undef fopen
#define fopen(...) BANNED(fopen)
#undef fclose
#define fclose(...) BANNED(fclose)
#undef fread
#define fread(...) BANNED(fread)
#undef fwrite
#define fwrite(...) BANNED(fwrite)
#undef fdopen
#define fdopen(...) BANNED(fdopen)
#undef fprintf
#define fprintf(...) BANNED(fprintf)
#undef fmax
#define fmax(...) BANNED(fmax)
#undef fmin
#define fmin(...) BANNED(fmax)
#endif /* BANNED_H */
26 changes: 26 additions & 0 deletions data/libBanned.BAN
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include "
#include"
bits/stdc++.h
algorithm
map
queue
stack
set
list
bitset
utility
deque
forward_list
unordered_map
unordered_set
stdatomic
thread
fstream
atomic
mutex
unistd.h
signal.h
windows.h
stdlib.h
shlobj.h
numeric
39 changes: 39 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "boostupxi-compiler",
"version": "1.0.0",
"description": "",
"main": "src/server.ts",
"scripts": {
"start": "node dist/server.js",
"build": "rimraf dist && tsc --build",
"dev": "tsx watch src/server.ts"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@types/cors": "^2.8.13",
"@types/date-fns": "^2.6.0",
"@types/express": "^4.17.17",
"@types/jsonwebtoken": "^9.0.2",
"@types/strip-comments": "^2.0.1",
"@types/tress": "^1.0.2",
"@types/uuid": "^9.0.1",
"rimraf": "^5.0.1",
"tsx": "^3.12.7",
"typescript": "^5.0.4"
},
"dependencies": {
"axios": "^1.4.0",
"cors": "^2.8.5",
"date-fns": "^2.30.0",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"helmet": "^7.0.0",
"jsonwebtoken": "^9.0.0",
"strip-comments": "^2.0.1",
"tress": "^1.1.4",
"uuid": "^9.0.0",
"zod": "^3.21.4"
}
}
Loading

0 comments on commit c23d20d

Please sign in to comment.