GithubHelp home page GithubHelp logo

gdgalgiers / challengesplatform-api Goto Github PK

View Code? Open in Web Editor NEW
3.0 0.0 3.0 1.3 MB

This repository contains the API for GDG Algiers challenges platform built with Laravel&MySQL

PHP 86.66% JavaScript 0.08% Blade 13.25%
devfest22 hackathon laravel php php8 hacktoberfest

challengesplatform-api's Introduction

Laravel Logo

Build Status Total Downloads Latest Stable Version License

About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

Laravel is accessible, powerful, and provides tools required for large, robust applications.

Learning Laravel

Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

If you don't feel like reading, Laracasts can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

Laravel Sponsors

We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Patreon page.

Premium Partners

Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [email protected]. All security vulnerabilities will be promptly addressed.

License

The Laravel framework is open-sourced software licensed under the MIT license.

challengesplatform-api's People

Contributors

brivan-26 avatar

Stargazers

zaineb avatar Khadidja225 avatar Abderaouf Louggani avatar

challengesplatform-api's Issues

Sync submissions judgment

Summary

Add a way to keep track of the submissions that are under judgment

Motivation and context

Let's assume a submission is under pending status, meaning its waiting for judgment, two judges took it at the same time, a double spending problem will occur

Suggested Solution

Extend submission status from only pending to pending, judging

Use Dependency Injection to retreive model instance on the controller handler

Currently, for all controller handlers that require dealing with a record on a database, we're passing the id of the instance and fetching the corresponding instance on the controller and doing the stuff required. It's more clean to make a DI on the controller to retrieve the model instance directly.
Changing from this for example:

public function unlockById($id) {
        $track = Track::find($id);
        // other stuff
}

To this:

public function unlockById(Track $track) {
        // other stuff
}

Challenges solution must be Encrypted on the Database

Summary

Currently, the challenges that don't require judgment(auto validation); their solution are directly exposed on the database.

Suggested Solution

Store Hashed solution inside the Database instead of Plain text.

Add unit tests for all API endpoints

  • Auth endpoints
  • Admin endpoints
    • users management endpoints
      • /user/ endpoint
      • /user/create-participant endpoint
      • /user/create-judge endpoint
      • /user/delete endpoint
    • challenges management endpoints
      • /challenge/get_challenges endpoint
      • /challenge/create endpoint
      • /challenge/lock endpoint
      • /challenge/unlock endpoint
      • /challenge/update endpoint
      • /challenge/delete endopint
    • tracks challenges endpoint
      • /track/get_tracks endpoint
      • /track/create endpoint
      • /track/update endpoint
      • /track/lock-all endpoint
      • /track/unlock-all endpoint
      • /track/lock endpoint
      • /track/unlock endpoint
      • /track/delete endpoint
  • participant endpoints
    • /track/get_tracks endpoint
    • /track/challenges endpoint
    • /challenge/download endpoint
    • /challenge/get_challenge endpoint
    • /challenge/submissions endpoint
    • /challenge/submit endpoint
    • /submissions/get_all_submissions endpoint
    • /submissions/cancel endpoint
  • judge endpoints
    • /submissions endpoint
    • /submission/assign-judge endpoint
    • /submissions/judge endpoint

[CRUCIAL] Fix a participant can submit a solution for unauthorized challenge

The current logic says that each participant is assigned to a specific track, and each track has multiple challenges. When submitting a solution for a given challenge, we're passing the challenge id, on the middleware canSubmit, we are not checking if the given challenge belongs to associated participant's track

Add challenges's reads

Summary

Add the possibility of a challenge providing external resources

Motivation and context

Some challenges may provide external reads(Medium article, Github README...etc) as a hint.

Suggested Solution

Add links column on challenge's table

NOTE: a new table may be created if a challenge may provide multiple external links.

Add `note` field in the judge response

The judge can either approve or reject the participant's submission. A challenge may have x amount of points, but still, the judge approves it and gives less points for a specific reason, the response should include that reason. Same thing for rejecting submissions.

Update challenge's submission to collect more points

Summary

Possibility of having updated submissions for a specific challenge

Motivation and context

Let's imagine the following scenario: a participant submitted for a challenge and got approved by assigning 50% of the total points, then; the participant discovered a way to improve his submission, so he may want to do a re-submission in order to collect more points.

Proposed solution

Not discovered yet

Generate challenges from .yaml files

Currently, the admin is adding the challenges one by one from the dashboard, it would be better to add a possibility to seed the challenges from given .yaml files.

Challenge's submission cancel

Summary

A feature that allows a participant to cancel a specific submission

Motivation and context

Let's consider a scenario in that a participant submitted for a challenge that is under judgment now, so the status of the submission is pending, the participant discovered that his submission needs improvement, meanwhile it's not judged yet, so he can cancel his submission, improves it, and re-submit it.

NOTE: canceling submission mustn't delete it.

Proposed solution

Add a new status for submission (canceled)

Specific challenge locking

Summary

A feature that allows locking a specific challenge from the Admin dashboard.

Background

Motivation and context

If a bug or problem is found with a specific challenge, the challenge must be locked for maintenance

Proposed solution

Adding a boolean value on the challenges table indicates whether the challenge is locked or not, and controls that value from the Admin Dashboard.

Login credentials email

Summary

Sending email containing participant credential

Background

Motivation and context

Since there's no register route, it's better to make auto email sending to the participant after its account creating containing login credential

Proposed solution

Emit Email send event on the create_user method

Download Challenge's Attachment

Summary

Challenge's Attachment download feature.

Background

Motivation and context

Since some challenges' descriptions will not be rendered on the UI because of the large description, the participant will have to download the attachment.

Use Form Requests for data validations

Currently, we're validating the coming request data inside the controller. For modularity and to achieve separation of concerns pattern, we should use the Form Request injection provided by Laravel.

Retrieve all user's submission

Summary

A new endpoint that allows the participant to retrieve all previous submissions

Background

Motivation and context

The participant can retrieve all previous submissions related to a specific challenge, It's suitable if the participant can get all previous submissions no matter what the challenge was.

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.