Git Product home page Git Product logo

wisp's Introduction

WISP

This project is developed by Competitive Programming McGill.

WISP is a project aimed at creating a fluid and fun experience for members of Compete McGill to learn competitive programming.

You can find WISP hosted here.

And you can find our documentation here.

Components

The repositories that make up this application can be found at these repositories:

Documentation

This repository contains documentation using mkdocs and hosts the documentation to Github Pages at this URL.

Install mkdocs and the material theme with:

pip install mkdocs mkdocs-material

Then run a local development server for the docs by navigating to the root of this repo and running:

mkdocs serve

Then, when you're done making your changes, merge changes to master and checkout master, and then deploy these changes by running mkdocs gh-deploy locally.

wisp's People

Contributors

aehwany avatar mohamedbeydoun avatar valerianclerc avatar idodin avatar cherryman avatar

Stargazers

Rihards Mantejs avatar Kareem Assad avatar Alois Clerc avatar liam avatar Max Brodeur-Urbas avatar William BenEmbarek avatar  avatar Hassan Haidar avatar  avatar  avatar  avatar

Watchers

Andre Kaba avatar liam avatar  avatar

wisp's Issues

Fix long log-in time after lastSubmission reset

Currently, when lastSubmission is reset for all users, the first login can be very slow in the case where a user has a lot of codeforces submissions, or simply if the codeforces API is being slow. We don't want to be so tightly dependant on their API's load time for our basic flow.

Ideas for fixing this:

  • Separate log-in and update-user-submissions into two separate routes
    • Currently, both of these functionalities are done in a single route, so the UI can't continue with the user data until the submissions are updated and the request has returned

Custom Online Judge

Allow admins to create custom problems in WISP, and these problems would be run on our own Online Judge against a custom test suite.

Could be implemented with a separate microservice that spins up a thread to run the test in a sandbox (using something like this library to sandbox?)

Research mailing options

Research how to setup a mailing server to know if we need a full mailing microservice or if it can just be a feature in the users microservice.

Check how HackMcGill does it, could be a good inspiration.

Automated submission

Similarly to vJudge, look into a system that submits to codeforces without the user having to manually navigate to the submission.

E2E Testing

Testing the entire functionality of the application.

@ahmed-elehwany 's specialty.

Husky pre-commit linting doesn't work as intended

When committing code that can not automatically be fixed by npm run format, husky should cancel the commit in a pre-commit hook. However, currently the commit is still allowed to go through.

This has been observed in wisp-problems-microservice, but probably applies to all services using husky.

[STORY] Semantic versioning

Look into and implement a package to manage our versioning/releases for each repo.

Something like this package. Although do some more research, there may be better options.

Dockerize e2e tests

Need to dockerize the e2e tests environment, before we can support CI test step.

CI/CD Improvements: Add linting to git pre-commit hook

Commits are being pushed without being linted, and it's annoying for the developers to have to run lint every time. We should add lint commands to the git precommit hooks on each repo.

Currently:

  • wisp-ui linting step both checks linting and makes linting changes?
  • wisp-problems-microservice and wisp-problems-microservice linters aren't fully set up and configured?

What we want:

  • pre-lint hook before each commit to check linting + make linting changes.
  • CI action to ONLY check linting (don't make linting changes), and fail the build if linting isn't good.

Documentation for Problems microservice

The problems microservice docs are incomplete as routes such as DELETE problems/problemSets aren't shown. Style them as we did with the users section of the docs.

[STORY] Allow users to hard refresh their problem tracking

In cases where something breaks with an individual user's problem tracking (as has happened a few times already), we want an easy way to fix this. This comes in the form of allowing users to reset their lastSubmission value, forcing the API to refresh their information from codeforces.

Two parts to this:

  • users-microservice: add a route that allows a user to reset only their own lastSubmission
  • UI: add a button (on the user's profile? or on the dashboard?) that calls this route

[STORY] Event messaging system (pub-sub, etc.)

We're starting to have a lot of events that require contacting other microservices. Currently, we're writing custom endpoints for this. Eventually we might want to set up an event system to handle these, rather than making direct calls.

Todo:

  • Research whether we want to use pub-sub, or continue direct calls to a defined interface (gRPC-like)

Interactions that would require pub-sub (please keep this up to date):

  • resetLastSubmission in the users' microservice when a new problemset is created
  • deleting problemset => also delete ID in user model
  • the mailing microservice?

Add resource quotas

The current config for our pods doesn't request any resources (cpu/ram) nor does it set any limits. This can be dangerous as some pods can use up more resources than anticipated and deprive others. Resource requests will ensure all our pods have the resources they need while resource limits will terminate pods when they consume more than they should.

Update central WISP repo README

Flesh out the central repo's README with infos such as:

  • links to other repos
  • mkdocs command to update the deployed docs website

[STORY] Unit Testing

Backend repositories need unit testing.

TODO:

  • Set up unit testing framework/environment on:
    • wisp-users-microservice
    • wisp-problems-microservice
  • Write full unit tests on:
    • wisp-users-microservice
    • wisp-problems-microservice

[STORY] Refactor 400/422 errors, standardize across repos

Currently, 422 errors are thrown in validators, and 400 errors in controllers. However, we might want to factor out 400 errors to a separate middleware, or include it in the existing validators.

Furthermore, in the user's microservice we check for existence of a conflicting username in the controller, with a 400 error. However, in the problems microservice, we check for the existence of problems/problemsets in the validators, returning 422 responses. These are similar validation checks, but they occur in different parts of the code and return different responses. This should be standardized/refactored.

MongoDB Timeout

Describe the bug
Mongo connection times out when attempting to run the docker compose under build

To Reproduce
Steps to reproduce the behavior:

  1. Open build in terminal
  2. Run docker-compose up
  3. Wait 30 seconds
  4. See error

Fix incoming - this happens because no path is specified after the database path (i.e. we need to specify mongodb://mongo:27017/wisp or something as opposed to mongodb://mongo:27017/)

[STORY] Swagger specs

Need to create swagger specs to more explicitly and clearly define API endpoints.

Swagger needed for:

  • wisp-problems-microservice
  • wisp-users-microservice

[STORY] Complete E2E tests

E2E framework has been set up (thank you @ahmed-elehwany ). Now we just need to actually write the tests!

Should wait until #23 is done

[STORY] Switch to Helm

Currently, we store our kubernetes config in the wisp-kube repo. This causes a few issues:

  • K8s config changes have to be added in a separate PR to a different repo than the project that the dev is working on
  • Repeated config for different environments (currently, dev and prod have nearly the same configuration except for the namespace)

It would be helpful to move our kubernetes config into charts within their respective repo to solve these issues.

Profile pictures

Add support for profile pictures for users. Backend User model already has the profilePhoto string.

TODO:

  • Profile photo upload and display on the frontend
  • Set up some sort of GCP storage or S3 bucket to hold and serve the profile photos

PDBs for prod namespace

In order to improve resilience when updating our services, we can make use of the kubernetes resource "Pod Disruption Budget" oe PDB (https://kubernetes.io/docs/tasks/run-application/configure-pdb/) to limit the number of downed pods in cases of voluntary disruptions (updates, accidentally deleting pods and deployments, ...).

We want to be able to toggle PDBs for production deployments only so make use of the logic helm offers in our charts (we don't want them for dev since they're useless when we only have one pod running per deployment).

Lifecycle preStop hooks

Add lifecycle prestop hooks to our pods in order for them to better handle being terminated e.g. nginx doesn't gracefully shutdown when the pod is terminating, so requests that were sent before the termination signal will fail -> a prestop hook would belp gracefully shutdown nginx before stopping the container so the remaining requests can be properly handled.

[EPIC] CMS/Blog

A new service to manage news and announcements.

Stories:

  • Microservice
  • UI

Make READMEs prettier

Clean up central wisp repo as a summary of the whole project, make it look nicer. Maybe with this.

Also can improve the other microservice READMEs to show things like code coverage, etc.

Dependabot

Add dependabot to all our projects to keep our packages up to date.

[STORY] Contests

New feature: similar to problemSets, but these are only active for a defined period of time. Once that time is over, a leaderboard is visible to see how users performed.

Once they're done, these contests will be publicly archived, and will be completable by users on their own time, similarly to problemSets

[STORY] Leaderboard

Add a leaderboard to see all users and their progress.

This requires:

  • modifying the user model to store user scores
  • adding a page to the UI to see the leaderboards

Note: this issue also goes well with the addition of viewing other users' profile pages, so that you can click on them in the leaderboard and see their page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.