Extreme Programming - Adress Book - 832402220 王昭衍 | 832402216 刘鉴浩
Assignment Overview
| Item | Content |
|---|---|
| Course for This Assignment | Software Engineering (FZU–MU) |
| Team Name | StarBook Duo |
| Assignment Requirements | Extreme Programming |
| Objectives of This Assignment | Build a web-based Address Book application supporting contact bookmarking, multiple contact methods, Excel import/export, and Alibaba Cloud deployment, while practicing modular design, Git Fork/PR collaboration, Release publishing, and PSP tracking |
| Other References | Code Style Guide, Project README, Alibaba Cloud Deployment Guide |
Table of Contents
- Project Links and Runtime Instructions
- Module Division and Team Collaboration
- Functional Implementation Ideas
- Program Screenshots and Complete Running Video
- GitHub Commit History and Release
- Evaluation of Members' Contribution Ratios
- Difficulties Encountered During Cooperation and Solutions
- Personal Software Process (PSP) Tables
1. Project Links and Runtime Instructions
| Resource | Link / Description |
|---|---|
| GitHub Repository | https://github.com/w1457344108-coder/832402220_832402216_EE308FZ_ExtremeProgramming |
| Code Standard Link | https://github.com/w1457344108-coder/832402220_832402216_EE308FZ_ExtremeProgramming/blob/main/docs/CODE_STYLE.md |
| Pull Request | https://github.com/w1457344108-coder/832402220_832402216_EE308FZ_ExtremeProgramming/pull/1 |
| Release Version | https://github.com/w1457344108-coder/832402220_832402216_EE308FZ_ExtremeProgramming/releases/tag/v1.0.0 |
| Live Public URL (Alibaba Cloud) | http://8.163.36.172/ |
Technology Stack and Local Build / Run Steps
Backend: Python 3, Flask, SQLite, openpyxl
Frontend: HTML5, CSS3, Vanilla JavaScript (single-page interactive UI with multi-theme and EN / 中文 switching)
Testing: pytest (14 automated test cases passing)
Deployment: Alibaba Cloud Lightweight Application Server + Gunicorn + systemd + Nginx
Local setup and execution:
git clone https://github.com/w1457344108-coder/832402220_832402216_EE308FZ_ExtremeProgramming.git
cd 832402220_832402216_EE308FZ_ExtremeProgramming
pip install -r requirements.txt
pytest -v
python3 app.py
Once started, open http://127.0.0.1:5000 in your browser, or visit the live cloud deployment directly at http://8.163.36.172/.
2. Module Division and Team Collaboration
Before coding, we designed a layered modular architecture separating database persistence, Excel serialization, REST API routes, frontend presentation, and automated tests to minimize merge conflicts during parallel work:
832402220_832402216_EE308FZ_ExtremeProgramming/
├── app.py # Application entry point
├── requirements.txt # Python dependencies
├── pyproject.toml # pytest configuration
├── address_book/
│ ├── __init__.py # Flask app factory, SQLite initialization, upload size limit
│ ├── db.py # contacts / contact_methods schema, CRUD & bookmark operations
│ ├── excel_service.py # Excel export, template generation, header aliases & duplicate handling
│ └── routes.py # REST API (/api/contacts, /favorite, /export, /import, etc.)
├── templates/index.html # Main UI, add/edit modal, and Excel import modal
├── static/css/style.css # Responsive card grid, 4 CSS-variable themes & highlight styles
├── static/js/app.js # Dynamic contact method rows, bookmark filter, i18n & shortcuts
├── samples/demo_contacts.xlsx # Sample Excel file for import testing
├── deploy/setup_server.sh # One-step Alibaba Cloud deployment script (Gunicorn + systemd + Nginx)
├── tests/ # Automated API, persistence, and Excel round-trip tests (14 cases)
└── docs/ # Code standards, collaboration guide, deployment guide & blog draft
| Student ID (GitHub Account) | Assigned Modules & Responsibilities | Deliverables / Files |
|---|---|---|
832402220 (w1457344108-coder) | Repository initialization, SQLite schema design, core backend APIs, multiple contact methods, Excel import/export with duplicate handling, multi-theme & bilingual UI, Alibaba Cloud deployment, PR #1 review/merge, and Release v1.0.0 | address_book/*.py, templates/index.html, static/*, deploy/setup_server.sh, tests/*, docs/* |
832402216 (LiuJianhao7) | Fork workflow development, keyboard shortcuts (/ to focus search, Esc to close modals), bilingual search-clear button, and boundary tests for Chinese Excel headers, partial search, and sorting (PR #1) | templates/index.html, static/css/style.css, static/js/app.js, tests/test_contacts_api.py, tests/test_excel.py |
3. Functional Implementation Ideas
3.1 Page Style and Interactive Experience (10 points)
The frontend uses a top action bar, view filter tabs, and a responsive contact card grid (templates/index.html, static/css/style.css, static/js/app.js):
Multi-Theme & Bilingual Switching: The top-right bar provides 4 CSS-variable themes (Light, Dark, Ocean Breeze, Warm Paper), a quick Light/Dark toggle, and an instant English / 中文 switcher persisted via localStorage.
Shortcuts & Quick Actions: Toolbar buttons support Load Demo, Template, Import Excel, Export Excel, and + New Contact. Keyboard shortcuts allow pressing / to focus search (guarded against IME composition and open dialogs/inputs) and Esc to close modals, alongside one-click search clearing, tel: / mailto: / URL links, and one-click copy buttons on every contact method.
Instant Feedback: Toast notifications confirm create, update, delete, bookmark toggle, copy, and Excel import/export actions.
3.2 Bookmark Contacts (25 points)
Persistence: Added an is_favorite column (0 / 1) and a composite (is_favorite, name) index to the contacts table (address_book/db.py).
Dedicated Endpoint & Filtering: Exposed PATCH /api/contacts/<id>/favorite to toggle or explicitly set bookmark status, while GET /api/contacts?favorite=1 returns bookmarked contacts together with total_count and favorite_count.
Convenient Access: Each contact card has a ★ / ☆ toggle button in the top-right corner with gold border highlighting when bookmarked. Switching to the ★ Bookmarked tab filters important contacts immediately and dynamically switches the export button to Export Bookmarked.
3.3 Add Multiple Contact Methods (10 points)
One-to-Many Relational Schema: contacts and contact_methods are linked via foreign key (ON DELETE CASCADE). Each method records method_type (phone, email, social, address, other), a custom label (such as Mobile, Work, WeChat, Home), and value.
Dynamic Modal Rows: Users can click + Add Method to add or remove any number of contact details for a single contact, with dynamic input placeholders per method type and server-side validation preserving sort_order.
3.4 Import and Export (25 points)
Export (export_contacts_to_xlsx): Uses openpyxl to generate .xlsx workbooks where each contact occupies a separate row and each type of information occupies a separate column (Name, Favorite, Company, Title, Phone Numbers, Emails, Social Media, Addresses, Other Contacts, Notes). Multiple items of the same category are serialized as Label: Value; ... with cell number_format = "@" so leading-zero phone numbers (e.g., 0591-..., 0086...) are preserved as text.
Import & Validation (import_contacts_from_xlsx): Validates .xlsx format and requires a Name column (supporting both English and Chinese header aliases such as 姓名, 电话, 邮箱, 收藏), offers configurable duplicate-name handling (skip, update, allow), avoids mis-splitting URL colons like https://, skips empty or nameless rows cleanly, and returns detailed imported_count, updated_count, skipped_count, and errors.
3.5 Cloud Web Deployment (Optional, 15 points)
The application is deployed on an Alibaba Cloud Lightweight Application Server and accessible publicly at http://8.163.36.172/:
Automated Provisioning: Configured via deploy/setup_server.sh with an isolated Python virtual environment and persistent SQLite storage at /opt/address-book/instance/address_book.db.
Process Management: Managed by systemd running Gunicorn (1 worker with 4 threads to avoid multi-process SQLite write-lock contention).
Reverse Proxy: Served through Nginx on port 80 (127.0.0.1:5000) with client_max_body_size 12M to support Excel file uploads up to 10 MB.
4. Program Screenshots and Complete Running Video
Main Interface, Themes & Multiple Contact Methods

Add / Edit Contact Modal with Multiple Methods

Bookmark Toggle & ★ Bookmarked Filtered View

Exported Excel Spreadsheet & Import Result Summary


Complete Running Video
5. GitHub Commit History and Release
GitHub Commits History & Insights Contributors Screenshots


Pull Request #1 & Release v1.0.0 Screenshots

| Contributor (GitHub ID / Student ID) | Commits (Contributors View / Including Merge Commit) | Description / PR Link |
|---|---|---|
w1457344108-coder (832402220) | 13 (14 including PR #1 merge commit) | Repo setup, backend & SQLite, Excel import/export, multi-theme bilingual UI, Alibaba Cloud deployment, tests & PR #1 merge |
LiuJianhao7 (832402216) | 2 | PR #1: 4bac2df (keyboard shortcuts & search clear) and 92d3153 (Chinese Excel alias & search/sort boundary tests) |
Note: GitHub's Insights → Contributors page excludes merge commits by default, displaying
13 + 2 = 15commits; including the PR #1 merge commit (014dd3b) and subsequent UI polish, themainbranch has16total commits.
6. Evaluation of Members' Contribution Ratios
As agreed by both team members, the contribution ratio is 50% : 50% (totaling 100%):
| Member | Contribution Ratio | Evaluation Basis |
|---|---|---|
832402220 (w1457344108-coder) | 50% | Repository setup, SQLite & core backend APIs, Excel import/export, multi-theme & bilingual UI, Alibaba Cloud deployment, PR #1 review/merge, and Release v1.0.0 |
LiuJianhao7 (832402216) | 50% | Fork workflow development, keyboard shortcuts & bilingual search-clear UI, Chinese header & sorting boundary tests (PR #1), collaborative testing, and blog preparation |
| Total | 100% | — |
7. Difficulties Encountered During Cooperation and Solutions
| Difficulty | Discoverer / Context | Solution | Verification Result |
|---|---|---|---|
Teammate could not find the Sync fork button when preparing to sync upstream changes | 832402220 & 832402216 / GitHub Fork workflow | Checked repository state via GitHub API and found forks_count was 0 (no fork existed yet). Created a Fork from the main repository, branched feat/teammate-enhancements, and opened PR #1 | Fork established cleanly and PR #1 merged with both contributors' commit histories preserved |
Leading zeros in phone numbers could be stripped in Excel, and https:// URLs under Other Contacts could be mis-parsed as Label: Value | 832402220 / Excel import/export module | Set cell format to text (@) during export; updated _parse_methods_cell to split on : only when the right-hand side does not start with // | pytest -v round-trip tests confirmed leading-zero numbers (0591-12345678, 0086...) and URLs remain intact |
Adding the / search shortcut risked interfering with typing inside forms, modals, or Chinese IME composition | 832402216 / PR #1 frontend shortcuts | Guarded the keydown handler against event.isComposing, modifier keys, open modals, and editable controls (input, textarea, select) | Verified across 24 browser checks covering all themes, languages, and modals |
Nginx on Alibaba Cloud defaulted to a 1 MB upload cap, rejecting larger .xlsx uploads allowed by Flask's 10 MB limit | 832402220 / Alibaba Cloud deployment | Configured client_max_body_size 12M in the Nginx server block generated by deploy/setup_server.sh alongside single-worker Gunicorn + SQLite | Public endpoints http://8.163.36.172 and /api/health verified with HTTP 200 |
8. Personal Software Process (PSP) Tables
Unit: minutes.
Member A: 832402220
| Personal Software Process Stages | Planned Time (min) | Actual Time (min) |
|---|---|---|
| Planning | 15 | 15 |
| · Estimate | 15 | 15 |
| Development | 130 | 135 |
| · Analysis | 15 | 15 |
| · Design Spec | 15 | 15 |
| · Design Review | 10 | 10 |
| · Coding Standard | 10 | 10 |
| · Design | 15 | 15 |
| · Coding | 35 | 40 |
| · Code Review | 15 | 15 |
| · Test | 15 | 15 |
| Reporting | 40 | 40 |
| · Test Report | 15 | 15 |
| · Size Measurement | 10 | 10 |
| · Postmortem & Process Improvement Plan | 15 | 15 |
| Total | 185 | 190 |
Member B: 832402216
| Personal Software Process Stages | Planned Time (min) | Actual Time (min) |
|---|---|---|
| Planning | 10 | 10 |
| · Estimate | 10 | 10 |
| Development | 65 | 70 |
| · Analysis | 10 | 10 |
| · Design Spec | 5 | 5 |
| · Design Review | 5 | 5 |
| · Coding Standard | 5 | 5 |
| · Design | 5 | 5 |
| · Coding | 20 | 20 |
| · Code Review | 5 | 5 |
| · Test | 10 | 15 |
| Reporting | 25 | 25 |
| · Test Report | 10 | 10 |
| · Size Measurement | 5 | 5 |
| · Postmortem & Process Improvement Plan | 10 | 10 |
| Total | 100 | 105 |
相关推荐
企业数字化转型AI大模型赋能智能体平台及AI场景应用规划方案(生态合作版).pptx
企业数字化转型AI大模型赋能智能体平台及AI场景应用规划方案(生态合作版).pptx
MCGS的Http协议驱动,支持http协议
硬件配置 参数设置 设备属性 设备命令 通讯状态 附录 #HTTP 1、 设备简介 驱动类型 该驱动为独立设备,直接添加构件即可,不需要挂载到父设备下 通讯协议 采用标准HTTP1.1协议 通讯方式 驱动构件为客户端。 2、 硬件连接 本软件在通讯之前,请保证通讯连接正确。通讯连接方式:采用标准的RJ45接口的以太网接线(对调网线或使用HUB交换)。 3、 设备通讯参数 本设备为独立设备,无父设备参数 4、 设备构件参数设置 “HTTP设备”参数设置如下: <1> 内部属性: 构建url信息。 <2> 最小采集周期:本软件对设备进行操作的时间周期,单位为ms,默认为100ms。 <3> 通讯等待时间:通讯数据接收等待时间,默认设置为200ms,当采集速度要求较高或数据量较大时,设置值可适当减小或增大。 <4> HttpHead:http head添加需要的字段,不需要添加http head时值为空,默认不添加。 5、 设备命令 本设备构件提供设备命令,用于进行相应的操作,设备命令的格式如下: 设备命令 命令介绍 GetHttpHead 格式1 GetHttpHead(headStr) 用途 获取http head参数 参数 headStr 参数可以为字符型变量、字符串常量 例1 !SetDevice(设备0,6,"GetHttpHead(headStr)") 获取http head数据保存到headStr中 SetHttpHead 格式1 SetHttpHead(headStr) 用途 设置http head参数 参数 headStr 参数可以为字符型变量、字符串常量
印尼稻米收成与粮食安全数据集2026年
本数据集收录印度尼西亚2026年水稻收成与粮食安全遥测数据,包含10000条稻米农业收成产量与粮食安全监测记录,围绕印尼国家粮食安全体系中的核心作物水稻展开。稻米是印尼逾两亿人口的主粮,其收成波动直接影响国家粮食安全与进口政策,本数据集将种植区域、收成产量、气候与土壤相关遥测指标整合为结构化表格,可支撑粮食产量预测、收成影响因素分析、区域粮食安全评估与农业政策模拟等研究任务。典型应用场景包括:农业时间序列产量预测模型构建、气候因子与水稻收成的关联分析、省份与地区层面的粮食自给率测算、粮食安全风险预警指标设计,也可作为农业经济、粮食政策与数据科学交叉课程的教学素材。数据为2026年最新版,规模约1.2MB、单CSV结构规整,字段命名清晰,适合Python、Pandas、Scikit-learn等主流工具链直接使用,便于开展探索性分析、可视化与机器学习全流程练习。重要说明:本数据为遥测整理数据,分析结论以数据集文档口径为准,农业决策请结合官方统计综合研判。许可:CC0公有领域,可自由使用与二次分发。
智慧环保生态保护行业可信数据空间应用规划方案(技术方案版).pptx
智慧环保生态保护行业可信数据空间应用规划方案(技术方案版).pptx
气象服务行业可信数据空间应用规划方案(技术方案版).pptx
气象服务行业可信数据空间应用规划方案(技术方案版).pptx


