Skip to content

A Leetcode-inspired Python practice platform featuring microservices

Notifications You must be signed in to change notification settings

kkatkat/code-capable

Repository files navigation

Logo

CodeCapable

This repository contains a university project for a programming practice/learning platform inspired by Leetcode. It was done for the Advanced Software course at Fontys UAS, Eindhoven.

The project features:

  • A frontend built with Vite + React, using Bootstrap and MUI.
  • A microservice-based backend consisting of 3 microservices, built with NestJS, communicating with each other via RabbitMQ.
  • Sandboxed execution of user-provided code snippets using the Judge0 API.
  • Kubernetes setup which works in Minikube (some adjustments are needed for cloud Kubernetes providers).
  • Docker compose setup (was used primarily for development).
  • A GitLab CI/CD pipeline.
  • End-to-end tests setup with Playwright.
  • Simplistic reverse-proxy API gatewey (used only for development).
  • Sentry integration for error monitoring.

How to run it?

Docker compose

  1. Clone the repository
  2. Copy the contents of .env.compose.example to .env.compose in the root of the repository.
  3. Start Docker
  4. docker compose build
  5. docker compose up and wait up to 1 minute.
  6. Frontend is available at localhost:3333

NOTE: Keep in mind that this will run the project without Judeg0, meaning user-provided code will be executed locally inside the runner-ms microservice. This does not provide any security measures against misuse and any malicious code will be executed as-is. If you want to make use of Judge0, get yourself a Judge0 API key (they offer a free tier) and include the following variables in .env.compose:

  • JUDGE_KEY=yourJudge0KeyHere
  • USE_JUDGE=true

NOTE: GitHub OAuth will not work, as the repository does not contain the OAuth client secret of the GitHub CodeCapable app.

NOTE: Sentry will not work unless SENTRY_DSN_PROBLEM, SENTRY_DSN_RUNNER, SENTRY_DSN_USER environment variables are included in .env.compose.

Kubernetes

Follow the instructions in the README in /k8s.

Sample credentials

On the first run, several problems and users will be seeded in the database. All passwords in the database are hashes of 123qwe123.

To log in with an admin account, use the following credentials

  • Username: kiril
  • Password: 123qwe123

About

A Leetcode-inspired Python practice platform featuring microservices

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published