mirror of
https://git.oceanpay.cc/danial/kami_apple_exchage.git
synced 2025-12-18 12:43:25 +00:00
- 新增 CODEBUDDY.md、GEMINI.md、GEMINI_CN.md 等项目文档 - 更新 Dockerfile 和其他配置文件 - 优化部分代码结构,如 orders.py、tasks.py 等 - 新增 .dockerignore 文件
89 lines
2.4 KiB
Markdown
89 lines
2.4 KiB
Markdown
# Gemini Project Context: Apple Gift Card Exchange Platform
|
|
|
|
## Project Overview
|
|
|
|
This is a full-stack application for an Apple gift card exchange platform. It features a modern, scalable architecture with a real-time monitoring dashboard and an Apple-style user interface.
|
|
|
|
* **Frontend:** A Next.js application written in TypeScript, using Tailwind CSS for styling and Radix UI for components. It communicates with the backend via a REST API.
|
|
* **Backend:** A Python-based microservices architecture using FastAPI. It leverages Celery for asynchronous task processing, Playwright for browser automation, and PostgreSQL for the database.
|
|
* **Architecture:** The system is designed as a distributed system with a frontend, a backend API, and a pool of Celery workers. It uses Redis for caching and as a message broker.
|
|
|
|
## Building and Running
|
|
|
|
### Prerequisites
|
|
|
|
* Python 3.13+
|
|
* Node.js 18+
|
|
* Docker & Docker Compose
|
|
* PostgreSQL
|
|
* Redis
|
|
|
|
### Development Mode
|
|
|
|
1. **Start Dependencies:**
|
|
```bash
|
|
cd backend
|
|
docker-compose up -d redis postgres
|
|
```
|
|
|
|
2. **Start Backend:**
|
|
```bash
|
|
cd backend
|
|
uv sync
|
|
uv run python app/main.py
|
|
```
|
|
|
|
3. **Start Frontend:**
|
|
```bash
|
|
cd frontend
|
|
bun install
|
|
bun run dev
|
|
```
|
|
|
|
4. **Start Workers:**
|
|
```bash
|
|
cd backend
|
|
uv run celery -A app.core.celery_app worker --loglevel=info
|
|
uv run celery -A app.core.celery_app beat --loglevel=info
|
|
```
|
|
|
|
### Docker Development
|
|
|
|
```bash
|
|
cd backend
|
|
docker-compose up -d
|
|
```
|
|
|
|
* **Frontend:** `http://localhost:3000`
|
|
* **Backend API:** `http://localhost:8000`
|
|
* **API Documentation:** `http://localhost:8000/docs`
|
|
|
|
## Development Conventions
|
|
|
|
### Code Quality
|
|
|
|
* **Backend:**
|
|
* **Formatting:** Black
|
|
* **Import Sorting:** isort
|
|
* **Type Checking:** MyPy
|
|
* **Linting:** Ruff
|
|
* **Testing:** pytest
|
|
* **Frontend:**
|
|
* **Formatting:** Prettier
|
|
* **Linting:** ESLint
|
|
* **Type Checking:** TypeScript
|
|
* **Testing:** Jest + React Testing Library
|
|
|
|
### Git Workflow
|
|
|
|
* Create feature branches from `master`.
|
|
* Use conventional commit messages (e.g., `feat:`, `fix:`, `docs:`).
|
|
* Submit pull requests for code review.
|
|
|
|
## Key Files
|
|
|
|
* `frontend/`: Contains the Next.js frontend application.
|
|
* `backend/`: Contains the FastAPI backend application.
|
|
* `deploy/`: Contains deployment scripts and configurations.
|
|
* `README.md`: The main README file with detailed project information.
|