First assignment--832201206_LiuZhe

832201206刘喆 2024-10-31 22:18:01

Table of Contents

1.Course Assignment Requirements

2.PSP Table

3.Final Product Presentation

3.1Functionality Demonstration

4Design and Implementation Process

4.1System Architecture

4.2Database Design

4.3Functional Implementation

5Code Explanation

Frontend Code

Backend Code

6Personal Journey and Learnings

Course Assignment Requirements

Course NameContact Management System
Assignment RequirementsImplement a contact management system with front-end and back-end separation, including adding, modifying, and deleting contacts
Objectives of This AssignmentMaster front-end and back-end separation development, database operations, and basic web development frameworks
Other Referenceshttps://github.com/BYaoKSYao/Contacts

PSP Table

ModuleEstimated TimeActual TimeRemarks
Frontend Page Development4 hours5 hours 
Backend API Development6 hours7 hoursEncountered database connection issues
Functional Testing2 hours3 hoursTesting covered all features
Documentation Writing1 hour2 hoursIncluding blog and code comments

Final Product Presentation

Functionality Demonstration

Below are the main functionalities of the system, including adding, modifying, and deleting contacts.

Main interface:

Adding a contact:

 

 

Editing a contact

 

 

 

 

 Deleting a contact

 

 

 

Design and Implementation Process

System Architecture

The system adopts a front-end and back-end separation architecture, with the front-end using the Vue.js framework, the back-end using the Express.js framework, and the MySQL database.

Database Design

A table named testout is created in the database, containing ID, name, age, phone fields.

Functional Implementation

  • Add Contact: Store new contact information in the database through POST requests.
  • Modify Contact: Update the contact information of a specified ID through POST requests.
  • Delete Contact: Delete the contact information of a specified ID through DELETE requests.

Code Explanation

Frontend Code

Below is a code snippet from Vue.js for adding a contact:

async data_upload() {
  if (this.available) {
    try {
      const res = await axios.post('http://127.0.0.1:3000/post', {
        ID: '',
        name: this.name,
        age: this.age,
        phone: this.phone
      });
    } catch (error) {
      console.error(error);
    }

    this.name = ''
    this.age = ''
    this.phone = ''
    this.fetch_data()
  }
}

 

Backend Code

Below is a code snippet from Express.js for handling add contact requests:

router.post('/post', (req, res) => {
  res.setHeader('Access-Control-Allow-Origin', '*');
  console.log(req.body);
  sql_function.post_sql((err, results) => {
    if (err) {
      console.error('Error fetching data');
      res.status(500).send('Internal Server Error');
    } else {
      console.log("Storage successful");
      res.send("Storage successful");
      console.log('-------------------------------------');
    }
  }, req.body);
});

 

Personal Journey and Learnings

Through this assignment, I learned about the development model of front-end and back-end separation, mastered the use of Vue.js and Express.js, and how to operate the MySQL database. During the development process, I encountered some challenges, such as database connection issues and data interaction between the front-end and back-end, but I successfully resolved these issues by consulting materials and continuous attempts. This assignment not only improved my technical skills but also exercised my problem-solving abilities.

...全文
812 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
源码链接: https://pan.quark.cn/s/1889b1ebf6bc ### Linux环境下Vivado借助VCS进行仿真的操作指南 #### 一、前言 在数字电路系统设计领域中,FPGA(Field Programmable Gate Array,即现场可编程门阵列)的设计与验证占据着核心地位。伴随着设计复杂程度的增加,高效的仿真验证成为了保障设计正确性的关键环节之一。在Linux操作系统环境中运用Vivado来调用VCS执行仿真操作,不仅能够提升仿真的执行速度,同时也便于进行波形监测,从而大幅度增强设计验证的整体效率。本指南将详尽阐述如何在Linux系统平台上完成这一流程的操作。 #### 二、准备工作阶段 1. **软件部署**: - 验证Vivado软件是否已经正确安装。Vivado是由Xilinx公司开发的一款集成开发环境,专门用于FPGA的设计工作。 - 进行VCS软件的安装。VCS是一款性能卓越的仿真工具,广泛应用于Verilog和SystemVerilog语言代码的仿真测试。为了更好地支持混合语言环境下的仿真,建议采用VCS-MX版本。 2. **权限配置**: - Linux系统的权限管理机制较为严格,尤其是针对普通用户的权限限制较为严格。因此,在启动Vivado调用VCS仿真之前,必须确保所有必要的权限都已经正确配置。 3. **环境变量设定**: - 配置个人用户目录下的`.bashrc`文件,以便在终端操作时能够顺利加载所需的环境变量。 #### 三、调整个人用户下的.bashrc文件 1. **编辑.bashrc文件**: - 使用`cd`指令进入到个人用户的主目录,通过`ll -la`指令查看当前目录中的所有文件,...

173

社区成员

发帖
与我相关
我的任务
社区描述
2401_MU_SE_FZU
软件工程 高校
社区管理员
  • FZU_SE_TeacherL
  • 助教-吴可仪
  • 助教-孔志豪
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧