目录
数据库实训课程设计(flask + swiftui + mysql)
例行整理一学期的文件,把课设啥的都传了 Github 文末自取。
( 有需要自提, 可以的话顺便点个Star吧 卑微555 ),顺便把报告发个csdn水一水。
课设大概是一个移动端的游戏论坛,非常简陋,甚至用户没法发帖子,大概的功能就用户的注册登陆,浏览文章以及回帖。
以下附英文的课设报告(废话奇多,为了凑页数……)
GNTime – a game forum
1. Project Overview
1.1 Develop tool languages and frameworks
Develop tool languages and frameworks | macOS Monterey 12.4 |
---|---|
Development environment (server) | Ubuntu Server 20.04 LTS 64 |
Database | Mysql 5.7.34 (On the server, server Local Access ) |
Back End and Framework | Python 3.8 + Flask |
HTTP server | uWSGI |
Mobile end | SwiftUI |
Runtime environment | IPHONE 11 PRO MAX + IOS 15.4 |
1.2 Functional description
The main functions of the application include two aspects, user account operation and forum post operation.
1.2.1 Account function
Including user login and registration operations, login status retention, and user personal information modification.
1.2.2 Forum post function
Including the homepage post by comment heat display, post details page and comment page, users can publish deleted comments, the administrator can manage all user comments.
1.2.3 Post search function
Users can search by post title in the search interface.
1.3 Interfacial design
⬆️ Account function View
⬆️ Post function View
⬆️ Search function View
2. Development Process
2.1 Back End
2.1.1 Framework and Deploy
The backend of the project is built by using the Python Flask framework. UWSGI is used to deploy the backend service on the cloud server, and Git is used to manage the synchronization of the project.
2.1.2 Database
Use Python PyMySQL Package to CRUD (create, read, use, delete operations) the db_course_design.db on the server.
2.1.3 Data interaction with the mobile end
Provide different request interfaces to respond to the various operations of the mobile terminal on the database.
2.2 Mobile End
2.2.1 View Design
NavigationBar at the top contains account management and search functions. Otherwise, the Home Page only displays a list of posts.
2.2.2 Data persistence
There are two parts, Local Storage and Server Database.
2.2.2.1 Local Storage
Use @AppStorage to package the current login user information to preserve the login status of the user.
Save image data using App Assets, test stored pictures in the map bed of the server. When access too many pictures same time, the loading speed is very slow, affecting the use, so the pictures are stored in local Assets.
2.2.2.2 Server database
To a chieve interaction with the database use ObservableObject class, by this type the view can observe data updates and make updates to the page. Also Define HTTP operations, interact with the back end, and store data. Wrap with @EnvironmentObject to enable data sharing for all views
3. Database Design
3.1 ER Graph
3.2 Tables