Git Product home page Git Product logo

rebus's People

Contributors

strazdinsg avatar

Watchers

 avatar

Forkers

barat-sh

rebus's Issues

Set up React Routing

As a user, I want to be able to navigate through all the sections of the page (without authentication).

Auto-generation of the admin user

As a developer I want to see that the admin user is auto-generated, if the database does not contain any admin user.
The pin code must be randomly generated (a 6-integer-digit string).
The pin code must be printed in the console.

Create an empty React project

As a developer I want to see a minimalistic React JS project for the frontend in the folder frontend, with a README.

Set up HTTPS

As a developer I want to see that the backend is secured with HTTPS.

Answer submission

As a regular user I want to be able to submit an answer to the quiz:

  • ✔️ When I open the answer page, I want to see my previously uploaded
    • ✔️ answer
    • ✔️ image
  • ✔️ When I enter new text in the answer, it is stored in a temporary state variable
  • ✔️When I select a new image:
    • ✔️A resized version of the image is created: max 1800x1800 pixels
    • ✔️The resized image is stored in a temporary state variable
    • ✔️The resized image is displayed to the user
  • ✔️ If I start selecting an image and then cancel it:
    • ✔️ If I have submitted an image before, the previously selected image is shown in the preview
    • ✔️ If I have not submitted an image before, nothing is displayed (no error)
  • ✔️ When I press on the "Send" button:
    • ✔️ The submitted answer is sent to the backend
    • ✔️The attached image is sent to the backend, if selected
    • ✔️When text is saved, toast is shown: "Answer saved"
    • ✔️When image is uploaded successfully, toast is shown: "Image saved"

Set up database for the backend

As a developer I want to see a sketch of the whole database structure (on paper?), the entity classes implemented on the backend, and tables auto-generated.

Implement authorization on the frontend

As a user I want to be able to log in with my PIN.
As a developer I want to see:

  • An HTTP POST /authenticate sent when the user signs in with the PIN
  • A valid JWT token returned when a valid PIN is sent in the authentication
  • The JWT token stored in a cookie and included in all consecutive API requests

Image storage

As a developer I want to have an API for storing images on the backend:

  • ✔️POST /pictures/{challengeId}/{userId} - add an image to an answer for a specific challenge
  • ✔️DELETE /pictures/{challengeId}/{userId} - delete an image
  • ✔️GET /pictures/{challengeId}/{userId} - return the image data (usable for src=".." to an img element).

For all the endpoints:

  • They are accessible only with a JWT, authorized user
  • The team (userId) is extracted from the provided JWT token
  • userId in the JWT and URL must match (or the user must be admin)

Style for User dashboard page - challenge listing

As a user I want to see a list of challenges when I log in:

  • Styled components
  • With static challenge data
  • Challenges where an answer has been submitted are marked with a different colour and checkmark

Set up authorization

As a developer I want to see authentication and authorization in place on the backend.
/authenticate takes a json object {pin: number} and returns a JWT token, with role user for the regular user and user+admin roles for the admin.

Implement REST API endpoints on the backend

As a developer I want to see all the necessary REST API endpoints on the backend:
✔️Public endpoints:

  • ✔️ GET /challenges

✔️User endpoints (teamId is received from the JWT):

  • ✔️ GET /answers/my - get all answers for the current user, for all challenges
  • ✔️ POST /answers/{challengeId}/{userId}
    (image endpoints are a separate issue)

✔️Admin endpoints:

  • ✔️GET /teams
  • ✔️ GET /answers - all answers, of all teams
  • ✔️POST /score/{challengeId}/{userId}

Style for login page

As a user I want to see the Login page styled as necessary.
As a developer I want to see the LoginPage implemented using Material UI components.

Scoring page for the admin

As ad administrator user I want to see the scoring page after I have logged in with my PIN.
I want to see a table where the rows are the different teams and the columns are the challenges.
In each cell I want to see the answer submitted by the corresponding team.

Implement REST API calls on frontend side

As a frontend developer I want to see a generic API (function) for sending HTTP GET and POST requests, with data, parsing the response as JSON, specifying a callback function on success and a callback function on error.

Logout

As a user or admin I want to be able to log out by clicking on an exit icon in the app bar (or by accessing /logout link)

Invalidate JWT

As a user I want to get redirected to the login page when my JWT has expired.
As an administrator I want to see that all the cookies are deleted if the JWT is expired.

Add images to scoring table

As an administrator user I want to be able to see the images submitted as answers to the challenges in the admin scoring page.

Make images more effective for admins

As an administrator, I want to see images loaded in an effective way on my dashboard:

  • Loaded every time, not needing to refresh several times
  • Loaded one after another
  • No requests to non-existing images

Implementation steps:

  • Whenever a user uploads an image, a random 64-character imageId is generated for that image. This should be extremely hard to simply guess
  • One API endpoint serves images: /images/{imageId} - a "secret image URL"
  • Before displaying image elements on the admin dashboard, the app sends a request to the server to find out which answers have attached images and what their IDs are. Endpoint URL: /images/get-ids
  • Then the app creates image elements for each team, one by one, with the "secret URLs".
  • x millisecond delay (500ms?) between image element creation of each team.

Uploadable image preview

As a user I want to see a preview of the image I'm going to upload as an answer to a challenge.

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.