FocusFlow α Sprint Blog Series (Part 1) - Login and Personal Center Module Report
目录
- Project Overview
- 1. Sprint Burndown Chart
- 2. Function realization demonstration
- 2.1 User Login Module
- 2.2 Personal Center Module
- 3. Code Check-in Records (GitHub Commits)
- 4. Core code analysis
- 4.1 Login Verification Logic (app.py)
- 4.2 Personal Information Update Logic (app.py)
- 5. Sprint Summary
- Completed tasks:
- Problems Encountered and Solutions:
- Problems:
- Solution:
Project Overview
| Course | 2501_MU_SE_FZU |
|---|---|
| Assignment Requirement | Fifth Assignment - Alpha Sprint |
| Team Name | Focus_2025 |
| Goal of this assignment | Clarify Code Standards, Sprint Tasks, and Plans for the team Alpha Sprint |
| Other references | IEEE Std 830-1998, GB/T 8567-2006 |
Author: He Jiazhuo
Completion Date: December 13, 2025
1. Sprint Burndown Chart

2. Function realization demonstration
This sprint, I was mainly responsible for implementing the two core modules: user login and personal center. Below are screenshots showing the operation of the functions.
2.1 User Login Module
This module implements the identity verification process based on mobile phone number, password and dynamic verification code.
login interface

Login success/failure prompt:


2.2 Personal Center Module
This module offers users the core functions of information viewing and management, including personal information modification and account security settings.
·Personal Center Homepage:



Explanation: The page clearly displays the user's profile picture (generated dynamically from the initial letter of the name), basic information, educational background, this month's check-in data, and the check-in calendar for the past 30 days.
·Modify personal information:


Explanation: Clicking the "Edit" button will open a modal box, allowing users to modify information such as name, phone number, email, gender, birthday, school, educational level and grade. The username/login name (mobile phone number) is the key credential and cannot be directly modified here.
·Password modification functionInstruction:


Click the "Change Password" button to open the password modification panel. To ensure security, the new password must be verified against the current password, and it is also required that the new password be the same as the confirmed password.
3. Code Check-in Records (GitHub Commits)
Explanation: As the person in charge of the "Login and Personal Center" module, I completed the entire development of this module from the front-end interface to the back-end logic. The main code changes were concentrated in the following files, and these changes have been integrated into the main branch of the project.
Core backend logic (app.py): It implements core routing functions such as login(), profile(), update_profile(), and change_password().
Front-end page templates (templates/login.html, templates/profile.html): These templates have constructed the user interaction interface.
Database and Models (models.py, database.py): Supports the storage and validation of user data.
Due to the reasons of the development process and local environment configuration, the detailed commit hashes could not be listed one by one in this report. All the code contributions for this sprint can be viewed and traced through the Commits history page of the project repository.
4. Core code analysis
4.1 Login Verification Logic (app.py)
@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'POST':
phone = request.form.get('phone')
password = request.form.get('password')
user_captcha = request.form.get('captcha')
correct_answer = session.get('captcha_answer', '')
# 1. 验证码校验
if user_captcha != correct_answer:
flash(‘Captcha answer WRONG!’)
return render_template(‘login.html’, ...)
conn = get_db_connection()
user = conn.execute(‘SELECT * FROM users WHERE phone = ?’, (phone,)).fetchone()
# 2. 用户存在性及密码校验 (使用flask_bcrypt)
if user and bcrypt.check_password_hash(user[‘password’], password):
session[‘user_id’] = user[‘id’] # 设置会话
flash(‘Login SUCCESS!’)
return redirect(url_for(‘dashboard’))
else:
flash(‘User NOT FOUND or Password WRONG!’)
conn.close()
4.2 Personal Information Update Logic (app.py)
# 示例代码摘录自 app.py 的 update_profile() 路由函数
@app.route(‘/update_profile‘, methods=[’POST‘])
@login_required
def update_profile():
user_id = session[’user_id‘]
# 从表单安全获取数据
first_name = request.form.get(’first_name‘)
last_name = request.form.get(’last_name‘)
email = request.form.get(’email‘)
# ... 获取其他字段
conn = get_db_connection()
# 执行数据库更新
conn.execute(’’‘
UPDATE users
SET first_name=?, last_name=?, email=?, ...
WHERE id=?
’’’, (first_name, last_name, email, ..., user_id))
conn.commit()
conn.close()
flash(‘Profile updated successfully!’)
return redirect(url_for(’profile‘))
5. Sprint Summary
Completed tasks:
Login module: Completed the entire login process both on the front end and the back end, including forms with verification codes, secure password verification (using Bcrypt hashing), session management, and friendly prompts. Personal Center Module: It has realized a complete set of functions including displaying personal homepage information, visualizing the sign-in calendar, editing personal information, and modifying the password (requiring verification of the original password). Issue Resolution: The problem of ModuleNotFoundError that occurred during project startup due to the absence of the utils.helpers module has been resolved. A temporary solution was implemented to ensure the project's operability, facilitating team testing.
Problems Encountered and Solutions:
Problems:
- During the initial startup, the errors "ModuleNotFoundError: No module named 'flask_bcrypt'" and "ModuleNotFoundError: No module named 'utils.helpers'" occurred.
Solution:
- Install the missing dependency package by using the command "pip install flask-bcrypt bcrypt".
- Upon inspection, it was found that the project code was incomplete, lacking the utils/helpers.py file. To avoid disrupting the development process, the relevant import lines were temporarily commented out in app.py, and the avatar generation logic was hardcoded to ensure that the core functions (login, personal center) could be demonstrated and tested. This issue has been reported to the team and will be supplemented with the complete file in the future.
相关推荐
【MATLAB例程】基于APF的多无人机动态路径规划与避障仿真 四无人机协同避碰、动态障碍规避及安全性能分析(含公式)
程序基于多无人机二维运动学模型,采用人工势场法(APF)实现四架无人机在固定与动态障碍环境下的路径规划和协同避碰。绘制无人机运动轨迹、障碍物轨迹、安全净间隙、速度与加速度、航程及到达时间等图像,输出目标到达数量、碰撞统计和安全性能指标。无人机数量、障碍物分布、运动约束及APF算法参数均可自行调整。
《智能之门》配套PPT课件
《智能之门》配套PPT课件
chromedriver-win64-156.0.8078.80(Stable).zip
chromedriver-win64-156.0.8078.80(Stable).zip
三相并网逆变器虚拟阻抗+统一有源阻尼策略SVPWM+SPWM调制仿真
内容概要:本文档系统梳理了电力电子与新能源并网领域的核心技术与仿真实践,聚焦三相并网逆变器的先进控制策略与调制技术,涵盖虚拟阻抗、统一有源阻尼、SVPWM与SPWM调制、预测电流控制、中点电位平衡、低电压穿越(LVRT)及孤岛检测等关键技术。文档整合了大量基于Matlab/Simulink的高保真仿真模型,涉及三电平ANPC/T型/Z源逆变器、LCL滤波器、虚拟同步发电机(VSG)、下垂控制、构网型变流器等多种主流拓扑与控制架构,并延伸至风光储联合系统、微电网能量管理、弱电网稳定性分析、序阻抗建模与扫频法等复杂应用场景,特别强调SCI论文成果复现与工程化设计实现,具有极强的科研指导性与实践价值。; 适合人群:面向电力电子、电气工程及其自动化等相关专业的研究生、高校科研人员及从事新能源发电、微电网控制、逆变器研发的工程技术人员,要求具备扎实的电路理论、自动控制原理基础及一定的Matlab/Simulink仿真能力。; 使用场景及目标:①支撑高水平学术论文的仿真实验设计与结果验证,尤其是构网型变流器、虚拟同步技术、主动阻尼机制等前沿方向的研究;②用于毕业设计、科研项目中复杂电力电子系统的建模与控制策略开发;③助力工程师掌握从单机逆变器控制到多能互补系统协同运行的全流程仿真技术体系。; 阅读建议:建议结合文档提供的参考文献与仿真资源,采用“由简入繁、循序渐进”的学习路径,先掌握三相并网逆变器PI控制与SVPWM调制等基础模型,再逐步深入VSG并离网切换、多机并联环流抑制、弱电网阻抗交互等高阶课题,注重理论推导、参数设计与仿真调试的深度融合,提升系统级建模与问题分析能力。
三相四桥臂电压不对称跌落补偿动态电压恢复器DVR(Simulink仿真实现)
内容概要:本文介绍了一种基于三相四桥臂拓扑结构的动态电压恢复器(DVR),用于补偿电网中由电压不对称跌落引起的电能质量问题。通过Simulink平台构建仿真模型,重点研究了在不平衡负载和电网电压跌落工况下,DVR对负载侧电压的快速补偿能力。系统采用多准PR(Proportional Resonant)并联控制策略,实现对各相电压的独立精确控制,有效抑制负序分量,提升系统在复杂工况下的稳定性和响应性能。仿真结果验证了所提控制方法在电压幅值、相位补偿及波形质量改善方面的有效性,适用于对供电连续性和电能质量要求较高的工业场景。; 适合人群:电力电子、电气工程及其自动化等相关专业的研究生、科研人员及从事电能质量治理的工程技术人员。; 使用场景及目标:①研究动态电压恢复器在电压跌落、三相不平衡等典型电能质量问题中的补偿机制;②掌握三相四桥臂逆变器的建模与多准PR控制策略的设计与实现;③为高精度电能质量调节装置的研发提供理论依据和仿真验证手段。; 阅读建议:建议结合提供的参考文献和说明文档,深入理解控制算法的设计原理,并在Simulink环境中动手复现仿真模型,通过调整故障条件和控制器参数,观察系统动态响应,从而全面掌握DVR的工作特性与优化方法。


