-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from CS3219-AY2425S1/development
Milestone D7
- Loading branch information
Showing
256 changed files
with
40,131 additions
and
951 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ node_modules | |
dist | ||
dist-ssr | ||
*.local | ||
*.tsbuildinfo | ||
|
||
# Coverage | ||
coverage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
coverage | ||
node_modules | ||
tests | ||
.env* | ||
*.md | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
NODE_ENV=development | ||
SERVICE_PORT=3004 | ||
|
||
# Origins for cors | ||
ORIGINS=http://localhost:5173,http://127.0.0.1:5173 | ||
|
||
# Other service APIs | ||
QUESTION_SERVICE_URL=http://question-service:3000/api/questions | ||
|
||
# One Compiler configuration | ||
ONE_COMPILER_URL=https://onecompiler-apis.p.rapidapi.com/api/v1/run | ||
ONE_COMPILER_KEY=<ONE_COMPILER_KEY> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM node:20-alpine AS base | ||
|
||
WORKDIR /code-execution-service | ||
|
||
COPY package*.json . | ||
|
||
RUN npm ci | ||
|
||
COPY . . | ||
|
||
EXPOSE 3004 | ||
|
||
# DEV | ||
|
||
FROM base AS dev | ||
|
||
CMD ["npm", "run", "dev"] | ||
|
||
# PROD | ||
|
||
FROM base AS prod | ||
|
||
RUN npm run build | ||
|
||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Code Execution Service Guide | ||
|
||
## Setting-up Code Execution Service | ||
|
||
1. In the `code-execution-service` directory, create a copy of the `.env.sample` file and name it `.env`. | ||
|
||
2. Sign up for a free OneCompiler API [here](https://rapidapi.com/onecompiler-onecompiler-default/api/onecompiler-apis). | ||
|
||
3. Update `ONE_COMPILER_KEY` in the `.env` file with the value of `x-rapidapi-key`. | ||
|
||
## Running Code Execution Service Locally | ||
|
||
1. Open Command Line/Terminal and navigate into the `code-execution-service` directory. | ||
|
||
2. Run the command: `npm install`. This will install all the necessary dependencies. | ||
|
||
3. Run the command `npm start` to start the Code Execution Service in production mode, or use `npm run dev` for development mode, which includes features like automatic server restart when you make code changes. | ||
|
||
## Running Code Execution Service with Docker | ||
|
||
1. Open the Command Line/Terminal. | ||
|
||
2. Run the command `docker compose run code-execution-service` to start up the Code Execution Service and its dependencies. | ||
|
||
## After running | ||
|
||
1. To view Code Execution Service documentation, go to http://localhost:3004/docs. | ||
|
||
2. Using applications like Postman, you can interact with the Code Execution Service on port 3004. If you wish to change this, please update the `.env` file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import globals from "globals"; | ||
import pluginJs from "@eslint/js"; | ||
import tseslint from "typescript-eslint"; | ||
|
||
export default [ | ||
{ files: ["**/*.{js,mjs,cjs,ts}"] }, | ||
{ languageOptions: { globals: globals.node } }, | ||
pluginJs.configs.recommended, | ||
...tseslint.configs.recommended, | ||
]; |
Oops, something went wrong.