Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## What has been done?

- [ ]
- [ ]

## Sceenshots/Videos

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- 'executioner/**/rust/**'
golang_executioner:
- 'executioner/**/golang/**'

senatus:
name: Senatus
needs: find_modified_files
Expand Down Expand Up @@ -180,7 +180,6 @@ jobs:
docker-context: ./executioner/runtimes/languages/rust/
docker-file-path: ./executioner/runtimes/languages/rust/Dockerfile
docker-tags: ghcr.io/42dotmk/colosseum-executioner-rust:latest


golang_executioner:
name: Golang executioner
Expand All @@ -191,4 +190,3 @@ jobs:
docker-context: ./executioner/runtimes/languages/golang/
docker-file-path: ./executioner/runtimes/languages/golang/Dockerfile
docker-tags: ghcr.io/42dotmk/colosseum-executioner-golang:latest

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
*.sln
*.sw?
node_modules
*.tsbuildinfo
30 changes: 30 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Dependencies
**/node_modules/**

# Build output
**/dist/**
**/build/**

# Tool caches
**/.cache/**
**/.tmp/**
**/.strapi/**
**/coverage/**

# Generated GraphQL code
**/src/__generated__/**

# Generated Strapi code
senatus/types/generated/**
senatus/.strapi-updater.json

# Generated Strapi documentation
senatus/src/extensions/documentation/documentation/**
senatus/src/extensions/documentation/public/**

# Package manager generated files
**/package-lock.json

# Minified/generated assets
**/*.min.js
**/*.min.css
3 changes: 2 additions & 1 deletion DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Documentation
# Documentation

You can set up husky in 2 ways - automagical, or manual, pick your poision and follow the steps.

Expand All @@ -17,6 +17,7 @@ It will install husky and set up the pre-commit hooks automagically.
`npm i -g husky`

> **Notes:**
>
> - **IMPORTANT**: Make sure the `Git` version is 2.9 or above
> - Currently ESLint and TypeScript checks are enabled for the client, should also setup for caesar and senatus as well

Expand Down
50 changes: 29 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,50 @@
# Colosseum: Organize Competitive Programming and Interview Events

Join us every Tuesday at 5:30 PM in Base42 as we embark on the journey of crafting the colossal masterpiece Colosseum, our open-source web solution tailored for organizing competitive programming and interview events.

## Core Applications:

* **Client (Front-end)**: Crafted with React, our frontend provides an intuitive and seamless user experience.
* **Senatus (Back-end)**: Powered by Strapi, our backend handles the core functionalities of our platform.
* **Caesar (Code Execution)**: Currently in the prototyping phase, Caesar will be the engine behind code testing and execution, ensuring accuracy and efficiency.
- **Client (Front-end)**: Crafted with React, our frontend provides an intuitive and seamless user experience.
- **Senatus (Back-end)**: Powered by Strapi, our backend handles the core functionalities of our platform.
- **Caesar (Code Execution)**: Currently in the prototyping phase, Caesar will be the engine behind code testing and execution, ensuring accuracy and efficiency.

## Event Details:
* **Date**: Every Tuesday
* **Time**: 5:30 PM
* **Location**: Base42

- **Date**: Every Tuesday
- **Time**: 5:30 PM
- **Location**: Base42

> Besides app implementation, our community plans to organize competitive programming knowledge-sharing events and many competitions. Drop by if you're interested in participating in these activities!

## Quicklinks
* [Wiki](https://wiki.42.mk/en/projects/colosseum-competitive-programming-engine)
* [Source code](https://github.com/42dotmk/colosseum)
* [Task management board](https://plane.42.mk/colosseum)
* [Front-end DEV URL](https://colosseum.dev)
* [Back-end DEV URL](https://senatus.colosseum.dev/)

- [Wiki](https://wiki.42.mk/en/projects/colosseum-competitive-programming-engine)
- [Source code](https://github.com/42dotmk/colosseum)
- [Task management board](https://plane.42.mk/colosseum)
- [Front-end DEV URL](https://colosseum.dev)
- [Back-end DEV URL](https://senatus.colosseum.dev/)

## List of Contributors

### Development
* Veronika Gjoreva [@vergjor](https://github.com/vergjor)
* Ilija Boshkov [@iboshkov](https://github.com/iboshkov)
* Mario Stojchevski [@MarioStojcevski](https://github.com/MarioStojcevski)
* Vasilaki Tocili [@VasilakiG](https://github.com/VasilakiG)
* Gjorgi Krenkov [@gjorgi-krenkov](https://github.com/gjorgi-krenkov)
* Jovan Mihov [@jovanmihov](https://github.com/jovanmihov)

- Veronika Gjoreva [@vergjor](https://github.com/vergjor)
- Ilija Boshkov [@iboshkov](https://github.com/iboshkov)
- Mario Stojchevski [@MarioStojcevski](https://github.com/MarioStojcevski)
- Vasilaki Tocili [@VasilakiG](https://github.com/VasilakiG)
- Gjorgi Krenkov [@gjorgi-krenkov](https://github.com/gjorgi-krenkov)
- Jovan Mihov [@jovanmihov](https://github.com/jovanmihov)

### Design
* Bojana Dimitrova
* Tereza Lozanovska

- Bojana Dimitrova
- Tereza Lozanovska

### Organization
* Martin Dinev [@martin-dinev](https://github.com/martin-dinev)
* Pavlina Buchevska

- Martin Dinev [@martin-dinev](https://github.com/martin-dinev)
- Pavlina Buchevska

## License

Colosseum is [MIT Licensed](https://github.com/42dotmk/colosseum/blob/main/LICENSE)
121 changes: 90 additions & 31 deletions SETUP.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,123 @@
# Colosseum Local Setup

## Prerequisites

Create a `.env` file in the root of the repository by following the example file: `.env.example`
Install:

- Node.js 20+
- npm
- Docker
- Docker Compose
- Git

Create the root environment file:

```bash
cp .env.example .env
```

Create and configure:

```text
senatus/.env
```

For Senatus running directly on the host:

```env
DATABASE_HOST=localhost
DATABASE_PORT=15432
```

## First-Time Setup

From the repository root:

```bash
npm run setup
```

### RabbitMQ
This will:

> Required to run the Executioner/code execution engine.
- install dependencies
- start PostgreSQL and RabbitMQ
- pull execution runtime images
- build the project

To run the RabbitMQ and PostgreSQL in Docker for development, just run:
## Start Development

```bash
docker compose -f docker-compose.q.yml up -d
npm run dev
```

### Queue Library
Main local services:

Build the queue library before continuing.
```text
Web: http://localhost:1338
Senatus: http://localhost:1337
Strapi Admin: http://localhost:1337/admin
RabbitMQ UI: http://localhost:15672
```

## Execution Runtime Images

Pull the available runtime images:

```bash
cd lib/queue;
npm install;
npm run build;
npm run runtimes:pull
```

### Client / Frontend
Rebuild them when modifying runtime Dockerfiles:

To start the frontend
```bash
npm run runtimes:build
```

## Infrastructure

Start:

```bash
cd client;
npm install;
npm run dev;
npm run dev:infra
```

### Executioner
Check status:

> Note: Node version should be v20
```bash
npm run dev:infra:status
```

There's no additional setup required, it will automatically connect to `amqp://localhost` (RabbitMQ on port `5672`).
View logs:

```bash
cd executioner;
npm install;
npm start;
npm run dev:infra:logs
```

### Execution Environments
Stop:

The execution environments are defined in `./executioner/runtimes/languages` there are 2 scripts:
```bash
npm run dev:down
```

Reset local infrastructure and volumes:

```bash
npm run dev:infra:reset
```

- `build.sh` Will build all available languages (all directories contain a language defined by the directory name (ex: `csharp` is C#))
- `pull.sh` Will pull all of the readily available images so that there's no pulling when a code execution is requested.
## Development Checks

Usually you just need to run `pull.sh` to get the images available locally.
Before pushing:

### Senatus
```bash
npm run check
```

You initially would need to setup the `.env` file by following the example file: `.env.example`
Individual checks:

```bash
cd senatus;
npm install;
npm run develop;
npm run lint
npm run format:check
npm run typecheck
npm run build
```
7 changes: 2 additions & 5 deletions client/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
},
}
};
24 changes: 11 additions & 13 deletions client/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parser: '@typescript-eslint/parser'
parserOptions:
project:
project:
- './**/client/tsconfig.json'
- './**/client/tsconfig.node.json'
plugins:
Expand All @@ -19,18 +19,16 @@ settings:
import/resolver:
typescript: true
node: true
rules: {
'react/jsx-filename-extension': 'off',
'react/react-in-jsx-scope': 'off',
'react/function-component-definition': 'off',
'import/extensions': 'off',
'react/require-default-props': 'off',
"no-restricted-syntax": [
"error",
"FunctionExpression",
"FunctionDeclaration"
]
}
rules:
react/jsx-filename-extension: off
react/react-in-jsx-scope: off
react/function-component-definition: off
import/extensions: off
react/require-default-props: off
no-restricted-syntax:
- error
- FunctionExpression
- FunctionDeclaration
overrides:
- files: vite.config.ts
rules:
Expand Down
1 change: 0 additions & 1 deletion client/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# Colosseum

8 changes: 4 additions & 4 deletions client/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'dotenv/config'
import 'dotenv/config';

import { CodegenConfig } from '@graphql-codegen/cli';
import { GQL_URL } from './src/config';
Expand All @@ -12,10 +12,10 @@ const config: CodegenConfig = {
plugins: [],
presetConfig: {
gqlTagName: 'gql',
}
}
},
},
},
ignoreNoDocuments: true,
};

export default config;
export default config;
Loading
Loading