diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000000000000000000000000000000000000..e8df446ec872de0dd236d6d54130ca26591b2f08 --- /dev/null +++ b/README.en.md @@ -0,0 +1,55 @@ + + +# README.md + +This is a backend project for a simple food management system based on FastAPI, including database operations, interface definitions, and simple front-end pages. This project can be used to learn the basics of Python Web development. + +## Installation Instructions + +1. Ensure that Python 3.x and pip are installed. +2. Install the required packages: + ```bash + pip install fastapi uvicorn sqlalchemy pydantic python-dotenv + ``` +3. Configure database information: + - Modify the database connection parameters in the `common/config.py` file. +4. Initialize the database: + - Ensure the database service is running. +5. Start the application: + ```bash + uvicorn main:app --reload + ``` + +## Usage Instructions + +- Visit `http://localhost:8000` to view the homepage. +- Visit `http://localhost:8000/docs` to view the API documentation. +- Use the provided interfaces to perform create, read, update, and delete operations on food information. + +## Features + +- Provides RESTful API interfaces for food information management. +- Supports functions such as retrieving all food information, fetching specific food details by ID, and saving food information. +- Uses SQLAlchemy for database operations. +- Uses Pydantic for data validation and serialization. +- Includes simple Vue.js front-end pages for food information management. + +## Directory Structure + +``` +. +├── common/ # Public configuration files +├── crud/ # Database operation logic +├── data/ # Data files +├── db/ # Database models and sessions +├── deps/ # Dependency injection +├── doc/ # Documentation +├── pages/ # Front-end pages +├── routers/ # API routes +├── schemas/ # Data model definitions +└── main.py # Application entry point +``` + +## License + +This project uses the MIT License. Please refer to the LICENSE file for details. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b16b0212ad09f60f7d5b3264bd53083ffb64ca10 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +这是一个基于 FastAPI 的简单食物管理系统的后端项目,包含数据库操作、接口定义和简单的前端页面。该项目可用于学习 Python Web 开发的基础知识。 + +## 安装说明 + +1. 确保已安装 Python 3.x 和 pip。 +2. 安装依赖包: + ```bash + pip install fastapi uvicorn sqlalchemy pydantic python-dotenv + ``` +3. 配置数据库信息: + - 修改 `common/config.py` 文件中的数据库连接参数。 +4. 初始化数据库: + - 确保数据库服务已启动。 +5. 启动应用: + ```bash + uvicorn main:app --reload + ``` + +## 使用说明 + +- 访问 `http://localhost:8000` 查看主页。 +- 访问 `http://localhost:8000/docs` 查看 API 文档。 +- 使用提供的接口进行食物信息的增删改查操作。 + +## 功能特性 + +- 提供 RESTful API 接口用于食物信息管理。 +- 支持获取所有食物信息、根据 ID 获取特定食物信息、保存食物信息等功能。 +- 使用 SQLAlchemy 进行数据库操作。 +- 使用 Pydantic 进行数据验证和序列化。 +- 包含简单的 Vue.js 前端页面用于食物信息管理。 + +## 目录结构 + +``` +. +├── common/ # 公共配置文件 +├── crud/ # 数据库操作逻辑 +├── data/ # 数据文件 +├── db/ # 数据库相关模型和会话 +├── deps/ # 依赖注入 +├── doc/ # 文档 +├── pages/ # 前端页面 +├── routers/ # API 路由 +├── schemas/ # 数据模型定义 +└── main.py # 应用入口 +``` + +## 许可证 + +本项目采用 MIT 许可证。详情请查看 LICENSE 文件。 \ No newline at end of file