Requirements - bounswe/bounswe2024group1 GitHub Wiki

Requirements Specification

The Requirements Changelog is available here Source of truth for this requirements document is in Google docs. This markdown document is generated using an Apps Script that converts the Google Doc into proper markdown.

Glossary

  • Platform: The operating System of the device through which the User accesses the System.

  • User: Anybody using the System via web or mobile interfaces. Also referred to as "All Users" to make things clearer.

  • Registered User: Users who have registered to the System or logged in through Google and whose authentication tokens have not expired.

  • Guest: Users who aren't Registered Users.

  • Programming Language: Entities as defined in Wikidata: Language for communicating instructions to a machine. (Q9143)

  • Programming Paradigm: Entities as defined in Wikidata: category of programming languages according to what methodology of designing and implementing programs their features support (Q188267)

  • Computer Science Term: Entities as defined in Wikidata: technical term; word or phrase that is part of computer science terminology (Q66747126)

  • Software Library: Entities as defined in Wikidata: a collection of non-volatile resources used by computer programs, often for software development (Q188860)

  • User Defined Tag: A User-created Tag that contains a name, and a description.

  • Tag: A classification for Questions including Programming Languages, Software Frameworks that is added by Users.

  • Tag Page: A System-generated page that has information about a tag and the Questions linked to that tag.

  • Question Page: A User-created page that contains a title, a Question, and optionally some photos.

  • Rating: A number indicating how popular a Question is. It is defined as the number of upvotes minus the number of downvotes.

  • Reputation Points: Reputation Points is a number associated with a Profile, defined as the sum of Ratings of the Profile Owner’s Questions and Answers.

  • Profile Page: A page showing basic information about a Registered User.

  • Profile Owner: The Registered User that is associated with the Profile that a User is currently viewing.

  • “Recent” Questions: A list of Questions generated by querying in descending chronological order.

  • “Top-Rated” Questions: A list of Questions generated by querying by descending Rating with a filter of a minimum of 10 Ratings.

  • Code Snippets: Snippets of executable code included in Questions and Answers.

  • Supported Languages: The programming languages that are supported for execution inside a code snippet.

  • Difficulty Level: A property of a question that is set when the question is being created. Possible values are Easy, Medium, and Hard.

  • Experience Level: A property of a Registered User. Possible values are Beginner, Intermediate, and Advanced.

1. Functional Requirements

  • 1.1. User Registration and Authentication

    • 1.1.1. Registration

      • 1.1.1.1. Guests shall be able to register with a Username, email, password, name, surname, country, and Experience Level (required).
    • 1.1.2. E-Mail Verification

      • 1.1.2.1. Upon registration, a Registered User shall receive a verification email.
      • 1.1.2.2. A Registered User shall be able to verify their email through the aforementioned verification email.
      • 1.1.2.3. A User must verify their email before signing in.
      • 1.1.2.4. The Registered User shall be able to resend the verification email when trying to sign in before verification.
    • 1.1.3. Personal Information

      • 1.1.3.1. Registered Users shall be able to add a short Bio of at most 200 characters, specify their gender (male, female, or neither), and add the labels for the Tag(s) they are following.
    • 1.1.4. Sign In

      • 1.1.4.1. Guests shall be able to log in with an email and password.
    • 1.1.5. Password Recovery

      • 1.1.5.1. A Registered User shall be able to create a password recovery request.
      • 1.1.5.2. A Registered User shall receive a password recovery email upon their request.
      • 1.1.5.3. A Registered User shall be able to reset their password using the password recovery email.
    • 1.1.6. Logout

      • 1.1.6.1. Registered Users shall be able to log out from their accounts, thereby becoming a Guest.
  • 1.2. Profile Page

    • 1.2.1. Basics

      • 1.2.1.1. Registered Users shall have a personalized Profile Page.
      • 1.2.1.2. All Users shall be able to see the following information for any Registered User:
        • 1.2.1.2.1. Reputation Points
        • 1.2.1.2.2. Follower count
        • 1.2.1.2.3. Following count
        • 1.2.1.2.4. Question count
        • 1.2.1.2.5. Answer count.
      • 1.2.1.3. If a Registered User does not have a profile picture uploaded, the System shall display a default placeholder profile picture.
      • 1.2.1.4. Reputation Points shall be calculated as the sum of the Ratings of a Registered User's Questions and Answers. Reputation Points shall be updated in real time as Questions and Answers are rated.
    • 1.2.2. Editing

      • 1.2.2.1. Profile Owners shall be able to edit their profile pictures by uploading profile pictures.
      • 1.2.2.2. Profile Owners shall be able to edit their personal information including bio.
    • 1.2.3. Content Listing

      • 1.2.3.1. All Users shall be able to view the Questions and Answers by the Profile Owner in reverse chronological order.
      • 1.2.3.2. Registered Users shall be able to view the respective pages of the Questions and Answers by the Profile Owner.
      • 1.2.3.3. The System shall provide an API endpoint that returns all Questions and Answers created by a specific Registered User.
    • 1.2.4. Interaction

      • 1.2.4.1. Registered Users shall be able to follow and unfollow the Profile Owner.
  • 1.3. Search

    • 1.3.1. Search Types

      • 1.3.1.1. All Users shall be able to search for Tags, Questions or Profiles. They can choose which entity they want to search.
    • 1.3.2. Tag Search

      • 1.3.2.1. All Users shall be able to search tags matching on the name.
      • 1.3.2.2. All Users shall see the following information about the Tags:
        • 1.3.2.2.1. Name
        • 1.3.2.2.2. Photo (fetched from Wikidata) if any
    • 1.3.3. Question Search

      • 1.3.3.1. All Users shall be able to search with keywords that match on:
        • 1.3.3.1.1. Questions associated with tags that have the keyword in their name
        • 1.3.3.1.2. Questions that have the keyword in the title or the description
      • 1.3.3.2. All Users shall be able to filter the results of their search to retrieve questions with different Difficulty Levels.
      • 1.3.3.3. All Users shall be able to filter the results of their search to retrieve Questions with different Difficulty Levels. The Difficulty Levels available are 'Easy', 'Medium', and 'Hard'.
    • 1.3.4. Profile Search

      • 1.3.4.1. All Users shall be able to search for Registered Users with keywords that match on:
        • 1.3.4.1.1. Username
        • 1.3.4.1.2. First name
        • 1.3.4.1.3. Last name
      • 1.3.4.2. The search results shall include the following information for each Registered User:
        • 1.3.4.2.1. Username
        • 1.3.4.2.2. Profile picture
        • 1.3.4.2.3. Number of followers
        • 1.3.4.2.4. Number of questions and answers published
        • 1.3.4.2.5. Reputation
        • 1.3.4.2.6. User's biographical information
  • 1.4. Feed

    • 1.4.1. Feed Types

      • 1.4.1.1. The Feed shall be shown to all Users upon entry to the System.
      • 1.4.1.2. Registered Users shall be able to choose between two sections of the Feed: Top Rated, or Recommended.
      • 1.4.1.3. Guests shall only be able to see the Top Rated Feed.
      • 1.4.1.4. All Users shall be able to view Top Rated Questions in reverse Rating order. Additionally, Registered Users shall have the option to sort Questions by 'Recent' or 'Top-Rated' in the Feed.
    • 1.4.2. Recommended

      • 1.4.2.1. Registered Users shall see recommended Questions based on Questions they previously upvoted and Registered Users that they follow.
      • 1.4.2.2. The recommended Questions shall also include Questions from Tags and Users followed by the Registered User, sorted by relevance.
    • 1.4.3. Top Rated

      • 1.4.3.1. Registered Users shall see top rated Questions in reverse Rating order (i.e. most upvoted Question at the top).
    • 1.4.4. Feed Interaction

      • 1.4.4.1. All Users shall be able to go to the Questions page from the Feed.
      • 1.4.4.2. Registered Users shall be able to rate Questions from the Feed.
      • 1.4.4.3. Registered Users shall be able to bookmark Questions from the Feed.
      • 1.4.4.4. All Users shall be able to filter the Questions in their Feed by Tag.
      • 1.4.4.5. The System shall ensure that a Registered User can bookmark each Question only once.
  • 1.5. Tag Page

    • 1.5.1. Tag Types

      • 1.5.1.1. All tags will be one of the following: Programming Language, Programming Paradigm, Computer Science Term, Software Library, or User Defined Tag
      • 1.5.1.2. The tag types will have their own dedicated pages.
      • 1.5.1.3. All Users shall be able to view information about a Tag Type such as:
        • 1.5.1.3.1. its name,
        • 1.5.1.3.2. its description,
        • 1.5.1.3.3. a list of all tags under this category
      • 1.5.1.4. All Users shall be able to view and navigate to these Tag Type Pages.
    • 1.5.2. Programming Language Tag

      • 1.5.2.1. All Users shall be able to view information about a Programming Language Tag such as;
        • 1.5.2.1.1. its description,
        • 1.5.2.1.2. its Author(s) if any,
        • 1.5.2.1.3. inception year if available,
        • 1.5.2.1.4. its file extension if it exists,
        • 1.5.2.1.5. a link to its official website,
        • 1.5.2.1.6. its Stack Exchange tag if it exists
      • 1.5.2.2. All Users shall be able to view an image associated with the Tag.
        • 1.5.2.2.1. The image is the “logo image” in Wikidata.
    • 1.5.3. Programming Paradigm Tag

      • 1.5.3.1. All Users shall be able to view information about a Programming Paradigm Tag such as;
        • 1.5.3.1.1. its description,
        • 1.5.3.1.2. its Stack Exchange tag if it exists
    • 1.5.4. Computer Science Term Tag

      • 1.5.4.1. All Users shall be able to view information about a Programming Language Tag such as;
        • 1.5.4.1.1. its description,
        • 1.5.4.1.2. its Stack Exchange tag if it exists
    • 1.5.5. Software Library Tag

      • 1.5.5.1. All Users shall be able to view information about a Programming Language Tag such as;
        • 1.5.5.1.1. its description,
        • 1.5.5.1.2. a link to its official website,
        • 1.5.5.1.3. its Stack Exchange tag if it exists
      • 1.5.5.2. All Users shall be able to view an image associated with the Tag.
        • 1.5.5.2.1. The image is the “logo image” in Wikidata.
    • 1.5.6. Creation

      • 1.5.6.1. Registered Users shall be able to create Tags with:
        • 1.5.6.1.1. a name
        • 1.5.6.1.2. a description
      • 1.5.6.2. The System shall limit the creation of Tags to ensure that duplicate or unnecessary Tags are not created. The name of the Tag must be unique within the System.
    • 1.5.7. Question Listing

      • 1.5.7.1. All Users shall be able to view “Top Rated” Questions tagged with a given Tag.
      • 1.5.7.2. All Users shall be able to view “Recent” Questions with a given Tag.
        • 1.5.7.2.1. Recent is defined as reverse chronological order.
      • 1.5.7.3. All Users shall be able to filter the listed questions by their Difficulty Levels when viewing tagged questions.
      • 1.5.7.4. If the User viewing the questions is a Guest or a Registered User with Experience Level indicated as “Beginner”, the listed questions with the Difficulty Level “Easy” will be highlighted.
    • 1.5.8. Interaction

      • 1.5.8.1. Registered Users shall be able to follow and unfollow a Tag
      • 1.5.8.2. Registered Users shall be able to create a new Question linked to the Tag from the Tag Page.
      • 1.5.8.3. Users will be redirected to Tag Page upon clicking on Tag Badge.
      • 1.5.8.4. The System shall ensure that the 'following' status for Tags is accurately returned when retrieving Tag details.
      • 1.5.8.5. The System shall correctly calculate and display the follower count for each Tag.
  • 1.6. Question Page

    • 1.6.1. Creation

      • 1.6.1.1. Registered Users shall be able to create Questions with:
        • 1.6.1.1.1. a title
        • 1.6.1.1.2. a description
        • 1.6.1.1.3. a Difficulty Level
        • 1.6.1.1.4. (optional) photos
        • 1.6.1.1.5. (optional) executable or non-executable code snippets
        • 1.6.1.1.6. (optional) multiple tags
      • 1.6.1.2. Registered Users shall be able to link a Tag with their Question.
      • 1.6.1.3. Registered Users shall be able to run snippets in the preview for their questions before posting.
      • 1.6.1.4. Registered Users shall be able to preview their Question content, including Markdown formatting and executable code snippets, before posting.
    • 1.6.2. Deletion

      • 1.6.2.1. Registered Users shall be able to delete their Questions.
    • 1.6.3. Interaction with Questions

      • 1.6.3.1. Registered Users shall be able to interact with questions:
        • 1.6.3.1.1. Registered Users shall be able to either upvote or downvote questions.
        • 1.6.3.1.2. All Users shall be able to see the Rating of a question.
      • 1.6.3.2. All Users shall be able to copy a link to the Question.
      • 1.6.3.3. Registered Users shall be able to add Answers to a Question with the following content:
        • 1.6.3.3.1. Formatted text content
        • 1.6.3.3.2. (optional) executable or non-executable code snippets.
      • 1.6.3.4. Registered Users shall be able to preview their Answer as they write it
    • 1.6.4. Interaction with Answers

      • 1.6.4.1. Registered Users shall be able to upvote an Answer
      • 1.6.4.2. Registered Users shall be able to downvote an Answer
    • 1.6.5. Content

      • 1.6.5.1. All Users shall be able to see the Answers that Registered Users have added.
    • 1.6.6. Code Snippets

      • 1.6.6.1. Registered Users shall be able to write executable code snippets using special tags.
      • 1.6.6.2. Registered Users shall be able to write in the following Supported Languages:
        • 1.6.6.2.1. C
        • 1.6.6.2.2. C#
        • 1.6.6.2.3. C++
        • 1.6.6.2.4. Go
        • 1.6.6.2.5. Java
        • 1.6.6.2.6. JavaScript
        • 1.6.6.2.7. Python 3
      • 1.6.6.3. Registered Users shall be able to run snippets in other answers and through the preview for their own answer.
      • 1.6.6.4. Registered Users shall be able to write executable code snippets in the descriptions of Questions, Answers, and previews.
  • 1.7. Glossary Page

    • 1.7.1. The Glossary Page shall be accessible from the navigation bar for all Users.
    • 1.7.2. The page shall display information about Tag Types.
    • 1.7.3. Each tag type will have the following:
    • 1.7.3.1. Tag Type Name: The name of the tag type (e.g., Programming Language, Programming Paradigm).
    • 1.7.3.2. Short Information: A brief description of the tag type.
    • 1.7.3.3. Tag Count: The total number of tags under this category.

2. System Requirements

  • 2.1. Wikidata API

    • 2.1.1. The System shall periodically pull data from the Wikidata API to create Tag Pages for Q9143 (programming language), Q188267(programming paradigm), Q66747126(computer science term), Q188860 (software library).

    • 2.1.2. The System shall periodically pull photos from the Wikimedia API for Tags.

  • 2.2. Feed

    • 2.2.1. The System shall calculate Top-Rated Questions using a descending upvote order.

  • 2.3. Search

    • 2.3.1. The System shall search Tags and use the graph structure of the relation of Tags to expand the search to all related nodes it can find.

  • 2.4. Communication

    • 2.4.1. Answers

      • 2.4.1.1. The Answers to a Question shall be sorted in descending order from the highest ranked to the lowest.
  • 2.5. Input Validation

    • 2.5.1. Sign-up Validation; the System shall validate the following conditions and reject a sign-up if invalid:

      • 2.5.1.1. The Username is unique in the System.
      • 2.5.1.2. The password has at least 8 characters, one lowercase letter, one uppercase letter, and one digit.
      • 2.5.1.3. E-mail, password, and Username consists of at most 25 characters each.
    • 2.5.2. Tag Validation: the System shall validate the following conditions and reject a Tag create if invalid:

      • 2.5.2.1. The Tag name has at most 200 characters.
      • 2.5.2.2. The Tag name is not empty.
      • 2.5.2.3. The Tag description has at most 100,000 characters.
      • 2.5.2.4. The Tag description is not empty.
    • 2.5.3. Question Validation: the System shall validate the following conditions and reject a Question create or update if invalid:

      • 2.5.3.1. The Question title has at most 200 characters.
      • 2.5.3.2. The Question title is not empty.
      • 2.5.3.3. The Question description has at most 100,000 characters.
      • 2.5.3.4. The Question description is not empty.
      • 2.5.3.5. The Code Snippets in the question are all from Supported Languages.
    • 2.5.4. Answer Validation: the System shall validate the following conditions and reject an Answer create or update if invalid:

      • 2.5.4.1. The Answer has at most 100,000 characters.
      • 2.5.4.2. The Answer is not empty.
    • 2.5.5. General Limitations

      • 2.5.5.1. The System shall validate all User-provided inputs to not exceed 100,000 characters.
      • 2.5.5.2. The System shall limit the size of images that can be uploaded for a Question within 10MB.
      • 2.5.5.3. The System shall limit all uploaded images within 10MB including pictures in the Profile, Question description and Answer.
      • 2.5.5.4. The System shall include predefined mock data for development, testing, and demonstration purposes.
  • 2.6. Personalized Recommendation System

    • 2.6.1. Recommended Content

      • 2.6.1.1. Content recommendation shall be based on:
        • 2.6.1.1.1. Users that a Registered User follows.
        • 2.6.1.1.2. Questions that a Registered User upvoted.
    • 2.6.2. Relation Index

      • 2.6.2.1. Registered Users shall have a relation index ed and 0 for not followed
      • 2.6.2.1. Registered Users, recommended Registered Users shall have relation index close to 1.
      • 2.6.2.1. Questions, recommended Questions shall have a relation index close to 1.

3. Non-Functional Requirements

  • 3.1. Security

    • 3.1.1. The System shall enforce that the e-mail address used in Registration is unique and valid, as it will be used to activate the account.

    • 3.1.2. The System shall enforce that passwords have at least 8 characters, one lowercase letter, one uppercase letter, and one digit.

    • 3.1.3. The System shall use the bcrypt algorithm to store hashes of User passwords.

    • 3.1.4. The System shall enforce TLS encryption.

    • 3.1.5. Password fields shall hide the password as it’s typed in by default

      • 3.1.5.1. The User may choose to make the password visible.
    • 3.1.6. The database used by the System shall reside in a private VPC that restricts access to the public internet.

  • 3.2. Compatibility

    • 3.2.1. The System shall be accessed via an Android application and a web interface

    • 3.2.2. The System shall support all browser versions listed in the “defaults” “browserslist” Query as defined by the “browserslist” npm package.

    • 3.2.3. The Platform language shall be English.

    • 3.2.4. The Platform shall support UTF-8 character encoding.

    • 3.2.5. The System shall provide a Home Page optimized for mobile platforms, displaying personalized content based on the User's preferences and interactions.

  • 3.3. Versioning

    • 3.3.1. The System shall use Semantic Versioning internally to track major, minor, and patch changes.

    • 3.3.2. The System shall have two actively deployed versions: staging and production.

  • 3.4. Accessibility

    • 3.4.1. The web system shall implement the WCAG 2.2 standard to ensure accessibility.

    • 3.4.2. This includes but is not limited to:

      • 3.4.2.1. The System shall provide aria labels for all icon buttons.
      • 3.4.2.2. The System shall provide tabbable inputs and forms.
      • 3.4.2.3. The System shall adopt a reasonable hierarchy for screen reader navigation.
  • 3.5. Performance and Reliability

    • 3.5.1. The System shall support at least 200 Registered Users being online simultaneously.

    • 3.5.2. The System shall support at least 1000 Users actively using it at the same time.

    • 3.5.3. The System shall have at least 99% uptime, i.e. up to 14 minutes of downtime is acceptable in a day.

    • 3.5.4. The System shall back up the database in 24-hour intervals.

  • 3.6. Legal and Ethical Issues

    • 3.6.1. Any usage of personal information shall comply with GDPR and KVKK.

    • 3.6.2. Users must agree to “Terms of Use” and “Privacy Policy” to complete the sign-up.