quantum_stack_interview/README.md

70 lines
977 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# quantum-stack-interview
## 环境要求
- Python >= 3.9
- Docker用于 Redis
## 安装依赖
推荐使用 [uv](https://github.com/astral-sh/uv) 进行依赖管理:
```bash
uv sync
```
或使用 pip
```bash
pip install -e .
```
## 启动 Redis
项目依赖 Redis推荐使用 Docker 启动:
```bash
just start_redis
```
或手动执行:
```bash
docker compose -f docker/docker-compose.dev.yaml up -d redis
```
Redis 默认监听 6379 端口。
## 启动项目
开发环境下可使用 uvicorn 启动 ASGI 服务:
```bash
just run
```
或手动执行:
```bash
uvicorn quantum_stack_interview.asgi:application --reload
```
访问地址: http://127.0.0.1:8000/
## 运行测试
```bash
pytest
```
## 主要功能
- 商品搜索、创建
- 批量下单
- Redis 缓存加速搜索
## 目录结构
- `shop/` 业务代码(商品、订单等)
- `quantum_stack_interview/` 项目配置
- `docker/` Docker 配置
- `tests/` 测试用例