COMP 636: Web App

COMP 636: Web App Assessment – Summer School 2024

Milestone submission due: 5pm Friday 24 January 2025 via Learn

Final submission due: 5pm Monday 10 February 2025 via Learn

Worth: 50% of COMP636 grade

Submit via Akoraka | Learn, with files set up and available on GitHub and PythonAnywhere.

Introduction

Aotearoa Tours Ltd (ATL) is a New Zealand based tourism company that runs international tours for customers from all over the world.

ATL would like to keep a record of Customers, Tours and Tour Groups (groups of Customers that have been on a particular Tour). Some Tours have age restrictions on them (i.e., adults only).

Information is stored about each Customer, and they are assigned a unique ID number.

Tours have a name and an itinerary which is a list of Destinations that a Tour visits.

A Tour Group is a group of Customers that goes on a particular Tour starting on a specified date.

You have been asked to help develop this system for ATL by undertaking the tasks described below.

Note: The requirements presented here are not exhaustive, you are expected to apply critical thought to them, and best practices taught in the course, as a key part of the software development process. Ask clarifying questions in the in-person or online support sessions.

Download the web application files from the Assessment block on Learn. These will get you started, including for the Milestone. You will add more routes and templates as you develop your app.

Important

This is an individual assessment. You may not collaborate or confer with others. You may help others by verbally explaining concepts and making suggestions in general terms, but without directly showing or sharing your own code. You must develop the logical structure and the detail of your code on your own. No use of generative AI is permitted for any part of this assessment.

Code or content that is copied, shares a similar logic to others or is produced by generative AI will receive zero marks for all parties involved.

The university guidelines and policy on academic integrity can be found here.

 1

Milestone Submission (5 marks, due 24 January)

This milestone is to ensure that your app is correctly configured, and any set-up issues are resolved early. The milestone does not require any changes to the code and templates provided.

By this date you only need to sync and share the provided files on GitHub, provide us teacher access to your PythonAnywhere, and host the provided code on PythonAnywhere so that the web app and provided routes run correctly.

Milestone Requirements

1) 2)

3)

For this

• • • • • • •

Create a private GitHub repository called atl.

a. Your web application (app.py, etc.) must be in the main folder of your repository

(not in a subfolder)

Host your web app on PythonAnywhere.

a. Use files cloned/pulled from your GitHub repository – don’t manually upload files (except connect.py).

b. Your atl web app folder must be in your PythonAnywhere home directory (which should happen automatically when cloning the files from GitHub).

c. Your MySQL database must be called atl and contain the required tables and data.

The provided web application pages must load correctly in PythonAnywhere:

a. Home page: / route; home.html template page.

b. Tours page: /tours route; tours.html template page.

c. These pages require no modification of app.py or their HTML files to work.

submission you must have:

Your GitHub repository set up correctly.

The provided files loaded in GitHub and in PythonAnywhere.

Your database set up on PythonAnywhere.

Your app hosted successfully on PythonAnywhere.

The / and /tours routes working (as provided in the files).

Granted access to your PythonAnywhere account (set lincolnmac as teacher).

Granted access to your GitHub repository (invite lincolnmac or computing@lincoln.ac.nz as collaborator).

Submit the following via the link on the Learn COMP636 page:

• Your PythonAnywhere URL (e.g., yourname1234567.PythonAnywhere.com/ )

• Your GitHub username and repository name (e.g., yourname1234567/atl)

• Just copy the link text and the repository name. Don’t add any other text.

 Set-up Requirement

GitHub Repository set up and shared

PythonAnywhere web app hosting correctly configured, including home URL and database setup, and teacher access granted

/ and /tours routes and pages (as provided) running on PythonAnywhere

TOTAL

Marks Available

1 mark 3 marks

1 mark

5 marks

     IMPORTANT: Do not pull further changes to your PythonAnywhere files until after you have received your Milestone marks. You may continue to work in the local copy on your computer in the meantime and you should also commit and push to your GitHub repository, but do not pull changes to PythonAnywhere or make any other changes there until the Milestone is marked.

2

Final Submission (95 marks, due 10 February)

Web application requirements

1) Page header: On every page, include a page header which includes: the name of the app and a navigation bar with links to the pages.

2) Image and text: Add an appropriate picture with some (brief) introductory text to the home page.

3) Customer list: Complete the tourlist.html template to display a list of customers who are in a particular tour group.

a. The tour name and start date must be shown clearly at the top of the list

b. A list of customers on the tour must be shown in alphabetical order by family name

c. Customers with the same family name should be ordered by date of birth (youngest

first)

d. A customer must be clickable to display a customer booking overview (see 8 below)

4) Add booking: Complete the /booking/add route to insert a customer booking for a future tour into the database. Age restrictions must be enforced. (You do not need to edit any bookings for this assessment.)

5) Customer search: Create templates and routes to allow customers to be searched for and for the results to be displayed.

a. Search results must show customer family name and first name along with contact details.

b. Results must be clickable to display a customer booking overview (see 8 below)

6) Add customer: Create templates and routes to allow customers to be added to the system,

and ensure appropriate validation is in place.

7) Edit customer: Create or modify templates and routes to allow customer information to be

edited.

8) Customer booking overview: Create templates and routes to display a customer booking

overview page that shows all the bookings that a customer has made.

a. The page must show the name of the customer and the total number of tour

destinations that customer has booked overall (any destination visited multiple times should be counted multiple times). Include all tour groups (past, present and future) in the tour destination total.

b. For each booking display the tour name, departure date and number of tour destinations.

c. The overview must show past, current and future bookings.

9) Project Report: Create a report as described in the Report section below in the README.md

file in your GitHub repository.

General requirements

1) The application should follow the best practices mentioned in class, even where not specifically requested.

2) Data that is entered should be validated and errors from inappropriate data handled without crashing the web application.

3) Information should be presented in a manner appropriate for a professional web application, such as appropriate headings, labels, and date and number formatting.

4) General presentation and user interface should be tidy and professional making use of Bootstrap CSS for formatting, but it does not need to be ‘fancy’. Clean and functional is sufficient.

3

Report

Your report must be created using GitHub Markdown format and saved in the README.md file of your GitHub repository. It does not need to be a formal report – a tidy document using the following headings will be sufficient. Write a brief project report that includes:

• Design decisions:

Discuss the design decisions you made when designing and developing your app: why you created one set of pages, routes and functions to connect and interact in this way, and not in some other way. Discuss the structural and logical options you considered.

For example, , does the edit open a different template for editing or does it use the same template with IF statements to enable the editing? What GET or POST choices to request and send data did you make and why? (These are just examples; you do not have to include them in your own discussion.) You will have considered many design possibilities; write personally in plain language about your development decisions.

Make notes about your decisions as you work, so you do not forget them!

• Image sources: Reference external image sources in your report.

• Database questions: Refer to the supplied atl-local.sql file to answer the following questions. Do not implement these changes in your app, just write your answers in your report:

1. What SQL statement creates the tours table and defines its fields/columns? (Copy and paste only the relevant lines of SQL.)

2. Which lines of SQL script set up the relationship between the tours and tourgroups tables?

3. The current ATL only works for individual travellers. Write SQL script to create a new table called families, which includes a unique family ID, the family name, an optional short description. The ID must be added automatically by the database. (Relationships to other tables not required.)

4. Write an SQL statement that adds a row for a new family to your new families table. Make up some values for a fictional family.

5. What changes would you need to make to other tables in the database to fully incorporate the new families table into the data model below? (Describe the changes. SQL script not required.)

4

Data Model

 Model Notes:

intineraries.tourid intineraries.destinationid tourgroups.tourid tourbookings.tourgroupid tourbookings.customerid * the ‘Foreign Key’

tours.tourid destinations.destinationid tours.tourid tourgroups.tourgroupid customers.customerid

 Child table.field *

  (refers to)

  Parent table.field

           5

Project Constraints

You must:

• Use only the COMP636 technologies (Python & Flask, Bootstrap CSS, MySQL). Do not use SQLAlchemy or ReactJS (or other similar technologies or libraries) in your solution.

o Do not use any scripts, including JavaScript and do not write your own CSS (use Bootstrap). o Exceptions: You may use:

▪ The Bootstrap <script> at the bottom of base.html.

▪ The supplied form validation javascript.

• Use the provided SQL files to create a database within your local MySQL and in

PythonAnywhere. Each script also populates the database with initial data.

o You can re-run the appropriate SQL script at any time to reset your data back to the original version and remove any changes you made to it (if it starts to get messy during testing).

o You may modify data in your database for testing purposes and may add new data, but you must not modify the schema – do not add any new tables or columns.

o When marking, we will not change the structure of the data, but we will modify or add alternative data to your database as part of the marking process. You can rely on table names and columns staying the same, but the data in the rows in the tables may change.

• Use the provided files to develop a Flask web app that:

o Must be in a top-level folder called ‘atl’ (locally and on PythonAnywhere). o Meets the functional requirements.

o Is appropriately commented.

o Connects to your database.

o Uses %s to insert values into SQL statements.

o Provides appropriate routes for the different functions.

o Provides templates and incorporates HTML forms to take input data.

o Uses Bootstrap CSS to provide styling and formatting.

• Include your report in your GitHub README.md file as outlined earlier.

o This report must be created using GitHub Markdown and saved in the README.md file of

your GitHub repository.

• Create a private GitHub repository called atl that contains:

o All Python, HTML, images and any other required files for the web app.

o Your repository must have a .gitignore file and therefore not have a copy of your virtual

environment.

o A requirements.txt file showing the required pip packages.

o Your project report as the README.md document.

o Add lincolnmac (computing@lincoln.ac.nz) as a collaborator to your GitHub repository.

o Your repository must show a minimum of two commits per week after the milestone submission (but do not pull to PythonAnywhere until after your Milestone has been marked).

• Host your system (including database) using PythonAnywhere.

o Add lincolnmac as your “teacher” via Account > Education.

o The webapp must be in a directory called ‘atl’ in the home directory.

6

Project Hints

Create your GitHub repository first then create all your required code and files in your local folder, then push to GitHub.com and clone/pull changes through to PythonAnywhere.

IMPORTANT: We will mark the PythonAnywhere version of your app. Even if your web app works locally on your computer, it may not work on PythonAnywhere. PythonAnywhere is case sensitive in ways that your local web application is not and can have other small differences. So, frequently test your app in PythonAnywhere, as you develop it (pull to PythonAnywhere, reload, test). This makes it easier to debug issues as they arise and to ask for help. You won’t get marks if your local version works but your PythonAnywhere version doesn’t. So, test in PythonAnywhere well before the due date!

Spend some time sketching and planning the structure of your application before you start developing. Think about which features could share the same (or nearly the same) templates. You can also nest templates (templates within templates).

Make notes of your design decisions, compromises, workarounds, etc. as you develop your web app. Otherwise afterwards you may struggle to remember all of the issues you worked through, when it comes time to discuss those design decisions in your report. Do not include masses of insignificant decisions in your report though.

The requirements in this project brief are not exhaustive, you are expected to apply critical thought and think about the user experience of the web application.

7

Final Submission (95 marks, due 10 February)

Submit your URLs again via the final submission link on the Learn COMP636 page:

• Your PythonAnywhere URL (e.g., yourname1234567.PythonAnywhere.com/ )

• Your GitHub username and repository name (e.g., yourname1234567/atl)

• Just copy the link text and the repository name. Don’t add any other text.

This confirms where your work is and tells us that your final submission is ready for marking.

Report and General Project Aspects (25 marks):

 Project Element

Marks Available

  Project Report – Part 1:

• Discuss your design decisions (aim for

discussion of 7-15 decisions). Also detail

assumptions that you made, if any.

• Report created using GitHub Markdown

and saved in the README.md file of your GitHub repository.

Project Report – Part 2:

• Report Database Questions sufficiently

answered. Spelling, presentation, etc.

   8 marks

• 7 marks for appropriate personal

discussion, in your own words.

• 1 mark for .md being in the right place and

a reasonable length. (Just a heading, or a couple of sentences, is not a reasonable length.)

10 marks

2 marks

Spelling, punctuation, grammar, and presentation, and appropriate referencing of external images.

   Consistent ‘look and feel’ (interface, Bootstrap styling & templates, ease of use, etc). No additional CSS or scripts. COMP636 technologies only.

  5 marks

 TOTAL

25 marks

 8

Functional Project Aspects (70 marks):

Within each of the functional areas (see table below with indicative marks) we are looking for:

• Functionality working as specified in the requirements and demonstrating critical thought about the implementation and user experience.

• Well commented and formatted HTML, SQL, and Python code throughout.

• A user interface that looks and functions to a professional standard, including Bootstrap

colour and styling choices, sensible navigation and appropriate sorting of lists.

• ID numbers for table rows are mainly for internal system use only and should be made visible

to system users when only mentioned in the requirements.

• Data validation on forms. Wise choice of form elements.

• Well-structured SQL queries.

• Appropriate naming, both of variables and labels.

An indication of marks (may be adjusted when marking) :

  Item

Access Navigation Customer List Customer Search Add booking

Add customer Edit customer

Customer Booking overview

TOTAL

Functionality

Approx. marks

  Home page exists via ‘/’ route, with appropriate layout and no 3 broken links. Picture and text added to home page.

Appropriate use of extending templates. Sensible, well laid-out 3 navigation throughout.

Appropriate display of customer information, click through to 6 booking overview and sorting applied

Appropriate routes created, search by first and/or last name with 7 appropriate display and linking of results

Appropriate interface to select the customer, tour and tour 16 group. Only future tour groups are available to book. Age

restrictions are enforced.

Add Customer – a customer can be added with good validation 9 and error messages in place.

Customer can easily be selected for editing with appropriate 11 validation and error messages in place.

Customer name and summary information shown along with 15 breakdown of the details.

内容概要:本文围绕“考虑隐私保护的分布式联邦学习电力负荷预测研究”展开,提出了一种融合联邦学习框架与隐私保护机制的电力负荷预测方法,旨在解决传统集中式数据处理中潜在的用户隐私泄露问题。通过构建分布式模型训练体系,各参与方在本地完成模型训练,仅向中心服务器上传模型参数或梯度信息,实现“数据不动模型动”的协同建模模式,确保数据“可用不可见”。研究采用Python语言实现了完整的联邦学习流程,涵盖客户端本地训练、全局模型聚合、隐私保护策略(如差分隐私或同态加密)集成、通信机制设计及预测性能评估等核心模块,显著提升了电力负荷预测在隐私安全与模型精度之间的平衡能力。; 适合人群:具备Python编程基础和机器学习基础知识,从事电力系统、智能电网、能源大数据分析、数据隐私保护等相关领域研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①应用于居民或工业级电力负荷预测任务,在保障用户用电数据隐私的前提下实现高精度预测;②为构建符合数据合规要求的智慧能源管理系统提供技术支撑;③推动联邦学习在能源互联网、跨企业数据协作等场景中的落地应用,促进多方协同建模与数据价值释放。; 阅读建议:建议读者结合文中提供的Python代码进行实践操作,重点关注联邦学习的通信轮次设置、本地训练迭代策略、模型聚合算法设计以及隐私噪声添加机制的实现细节,并可根据实际需求替换底层预测模型(如LSTM、XGBoost、Transformer等)以进一步优化预测性能。
内容概要:本文介绍了一种基于噪声抑制半监督学习的锂离子电池SOH(State of Health,健康状态)估计方法的Python代码实现,旨在通过结合半监督学习框架与噪声抑制技术,提升电池健康状态预测的准确性与鲁棒性。该方法充分利用少量有标签样本和大量无标签数据进行模型训练,有效缓解了实际应用中电池老化数据标注成本高、获取困难的问题。文中详细阐述了模型的整体架构设计、关键特征提取策略、噪声处理机制以及半监督学习中的损失函数构建,并提供了完整的可复现代码,便于研究人员理解和二次开发。; 适合人群:具备一定机器学习理论基础和Python编程能力,从事电池管理系统(BMS)、新能源汽车、储能系统等领域的科研人员或工程师,尤其适用于关注电池寿命预测、状态估计及数据驱动建模的研究生与青年学者。; 使用场景及目标:①实现锂离子电池健康状态的高精度估计,服务于电池管理系统的优化与安全预警;②为工业场景下标注数据稀缺的退化建模问题提供一种高效的半监督解决方案;③推动复杂噪声环境下电池性能退化预测的研究进展,增强模型在真实工况中的泛化能力和稳定性; 阅读建议:建议读者结合所提供的Python代码逐模块深入学习,重点理解数据预处理流程、噪声抑制模块的设计原理以及半监督损失函数的实现细节,同时可在不同公开电池数据集上进行迁移实验与对比分析,以全面掌握该方法的有效性与适用边界。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值