完整项目源码下载链接在文章结尾处,大家自行下载即可~
传统的线下租房不便、途径少、信息更新慢,导致房屋租赁效率低。为了有效的提升租赁效率和房源信息管理和提供更优质的租赁服务。f房东好租、用户满意。本系统用户分为租客、房东、管家、管理员四种角色。
项目体验地址 http://43.138.220.206/static/index.html 由于注册需要发送短信验证码,而手机验证码服务现在只能给我的测试手机号发送验证码,因此不能使用注册服务。大家可以使用已有账号去登录体验。
| 账号类别 | 用户名 | 密码 | 备注 |
|---|---|---|---|
| 用户账号 | hui | 123456 | 租客账号 |
| 用户账号 | wang | 123456 | 房东账号 |
pip install -r requirements.txt
六、项目结构项目开发整体采用的是Python的FastAPI框架来搭建系统的接口服务,接口设计遵循 Restful API接口规范。接口前后端交互都采用json格式进行数据交互,项目整体的结构如下:
- ─house_rental
- ├─commons ------------------------- 项目公共模块
- │ ├─exceptions ------------------- 项目全局异常模块
- │ ├─libs ------------------------- 第三方服务模块
- │ ├─responses -------------------- 项目全局响应模块
- │ ├─settings --------------------- 项目配置
- │ └─utils ------------------------ 项目工具类
- ├─constants ----------------------- 项目常量模块
- ├─logic --------------------------- 项目逻辑模块
- ├─managers ------------------------ 项目数据库模型管理器模块
- ├─middlewares --------------------- 项目中间件模块
- ├─models -------------------------- 项目数据库模型模块
- ├─routers ------------------------- 项目路由模块
- │ ├─admin ------------------------ 后台管理路由
- │ │ ├─apis ---------------------- 后台管理路由接口
- │ │ ├─request_models ------------ 后台路由请求模型
- │ │ └─response_models ----------- 后台路由响应模型
- │ ├─common ----------- 公共路由模块
- │ │ ├─apis
- │ │ ├─request_models
- │ │ └─response_models
- │ ├─house ------------ 房源路由模块
- │ │ ├─apis
- │ │ ├─request_models
- │ │ └─response_models
- │ ├─order ------------ 订单路由模块
- │ │ ├─apis
- │ │ ├─request_models
- │ │ └─response_models
- │ ├─payment ---------- 支付路由模块
- │ │ ├─apis
- │ │ ├─request_models
- │ │ └─response_models
- │ ├─user ------------- 用户路由模块
- │ │ ├─apis
- │ │ ├─request_models
- │ │ ├─response_models
- └─__init__.py --------- 项目初始化文件
- └─Dockerfile ----------------- 项目docker部署文件
- └─requirements.txt ----------- 项目依赖库文件
- └─README.md ------------------ 项目说明文档
- └─run.py --------------------- 项目启动入口
- project : module : business : unique key
- 项目名 : 模块名 : 业务 : 唯一区别key
-
- 例如:用户手机短信验证码缓存
- house_rental:user:sms_code:13022331752
| Key | 类型 | 过期时间 | 说明 |
|---|---|---|---|
| house_rental:user:sms_code:{mobile} | string | 5分钟 | 存储用户手机短信验证码 |
| | | | |
| Key | 类型 | 过期时间 | 说明 |
|---|---|---|---|
| house_rental
| set | 不过期 | 存储用户收藏的房源id |
| house_rental:house:home_houses:{city} | string | 15天 | 首页房源信息缓存,存储json |
| house_rental
| string | 3个月 | 房源设施缓存,存储json |
| house_rental:house:detail:{house_id} | string | 15天 | 房源详情缓存,存储json |
| Key | 类型 | 过期时间 | 说明 |
|---|---|---|---|
| house_rental:common:areas | string | 3个月 | 存储省市区json字符串数据 |

房屋属性太多故在整体ER图省略

实际表属性更多进行了垂直分表。

















项目源码下载链接:https://download.csdn.net/download/weixin_47367099/85457369