Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

COMPSCI 235 S2 2023

Assignment Phase 2

15% of your grade

Due date: 11:59 pm Thursday 24th  August

Total  35 marks

Objec&ve

To design and implement a Flask web application that allows users to interact with a collection of games. Using the data from the provided 'games.csv' file (accessible in the repository), your task is to create an engaging web application that presents this collection to users in an interactive manner. The application should facilitate displaying and searching of the games.

IMPORTANT: For your code to be eligible for marks on the tasks specified in the funcAonal requirements, it must adhere to the following non-funcAonal requirements.

Non-Func&onal Requirements

1.   Project Structure and Conformance [1 mark]

.    Conformance to established project structure as discussed in the lectures.

.    Ensure vital documentation, like ‘requirements.txt’ and ‘README.md’, is present.

.    The application should run by typing ‘flask run’, from within the virtual environment in a terminal window.

.    The tests should run by typing ‘python –m pytest –v tests’, from within the virtual environment in a terminal window.

.    If the application doesn’t run properly, the remaining steps will NOT be marked.

2.   Use of Blueprints [1 mark]

.    Register blueprints to segregate the applicaDon's components. For example: home, games, genres, search etc.

.    Each blueprint should encapsulate a disDnct set of functionalities adhering to the principle of Single Responsibility.

3.   User Interface & Design [1 mark]

.    Implement CSS for a visually capDvaDng applicaDon.

.    UDlize Jinja templates to ensure a consistent appearance across pages while minimizing repetitive code.

4.   Flask Routes and HTTP Protocol [2 marks]

.    Clearly define routes/URLs for different functionaliDes (e.g., /games, /genres, or /search etc.)

.    Ensure that the application uses the appropriate HTTP methods, query parameters, response codes etc.

5.   Abstract Repository Interface [2 marks]

.    This interface should define the necessary methods for fetching, storing, and manipulating data about games.

.    For this assignment, you’ll be using a memory repository as the data storage mechanism.

Func&onal Requirements

Task 1: Create a Homepage [4 marks]

.    Construct a basic homepage for the web application. You could include a logo, a navigaDon menu, a brief introductory statement about your website, a search bar etc.

Task 2: Browsing the Game Library [4 marks]

.    Display a list of available games organized in a user-friendly manner (say in an alphabeDcal order, or based on release date etc.)

.    Implement pagination. Define a maximum number of games displayed per page and enable navigaDon between pages.

Task 3: Display Details of a Specific Game [5 marks]

.    Upon selecting a game, provide comprehensive informaDon about it. This might include its

Dtle, descripDon, publisher, image, release date, user raDngs/reviews, associated genres, and more.

Task 4: Implement a Genre-based Sidebar [5 marks]

.    Extract and display a list of unique game genres from the dataset in the sidebar.

.    Users should be able to select or click on a genre to filter and view games associated with that genre.

Task 5: Implement Game Search Functionality [5 marks]

.    Implement a search bar allowing users to search for games based on game Dtle, publisher, or other aeributes.

.    Integrate dropdowns or selection options for users to choose genres, publishers, or other filtering criteria.

Task 6: Write Unit Tests for the Earlier Specified tasks [5 marks]

.    Validate the core functionalities of the service layer (i.e. ensure that the business logic operates correctly).

Some example service layer tests -

# Test service layer returns an existing game object

# Test service layer retrieves correct number of game objects

# Test only X games are retrieved from the service layer for the pagination functionality # Test gekng games for a search key genre’

# Test gekng games for a search key  publisher’

# Test inserting non-existing search key throws exception

.    Validate the data operations of the memory repository components.

Some example memory repository tests -

# Test repository can add a game object

# Test repository can retrieve a game object

# Test repository retrieves correct number of game objects

# Test the number of unique genres in the dataset

# Test repository adds a new genre, and the count of genres increases by 1. # Test repository search games by Dtle or publisher etc

# Test repository search games by genre name

.    It is important that the tests are wrieen well and provide good coverage. These should be readable with meaningful names, and include comments detailing the test cases.

Submission:

.    For marking, we will use the latest commit that you have pushed to the GitHub repository    before the submission deadline. Please make sure your submission is pushed to the remote GitHub repository, and not just commieed to your local version of the repository!

.    When assessing your work, markers will expect to:

o Find a README file in the project’s root directory that explains how to set up a virtual environment and install any dependencies via a requirements.txt file

o Run the applicaDon by typing ‘flask run’, from within the virtual environment in a terminal window.

o Run all tests by typing ‘python –m pytest –v tests’, from within the virtual environment in a terminal window.

Failure to meet these requirements will result in a FAIL grade.

 Sharing assignment solutions and source code does not help learning. Consequently, our academic integrity policy does not permit sharing of solutions or source code leading to solutions,   nor does it allow sourcing solutions or source code from any third party. Violation of this will result in your assignment submission attracting no marks, and you may face further disciplinary action.

Therefore, please do not share assignments, assignment solutions and/or source code leading to assignment solutions, or use material from others in your assignments. You must not publish assignments or solutions in any form online at any time. You will be liable if someone copies your solution. There are also copyright and IP issues. Please come talk to us if you have any doubt over what is legitimate and what is not.

You can refer to online tutorials, generative-AI tools (such as ChatGPT) and online resources.

However, please learn from them and implement the solutions yourself based on what you learnt from these sources. You must not copy from these sources.

Don't leave your computers, devices, and belongings unattended — you must secure these at all times to prevent anyone having access to your assignments or solutions. If others are found to have used your solution, you will also face disciplinary action.