Files
kami_apple_exchage/CODEBUDDY.md
danial 5c486e34d3 docs(项目): 添加项目文档并进行代码调整
- 新增 CODEBUDDY.md、GEMINI.md、GEMINI_CN.md 等项目文档
- 更新 Dockerfile 和其他配置文件
- 优化部分代码结构,如 orders.py、tasks.py 等
- 新增 .dockerignore 文件
2025-09-12 19:38:24 +08:00

1.8 KiB

CODEBUDDY.md

Development Commands

Frontend (Next.js)

  • cd frontend && bun install - Install dependencies
  • cd frontend && bun run dev - Start development server
  • cd frontend && bun run build - Build production version
  • cd frontend && bun run lint - Run ESLint checks
  • cd frontend && bun run test - Run tests

Backend (FastAPI)

  • cd backend && uv sync - Install dependencies
  • cd backend && uv run python app/main.py - Run development server
  • cd backend && uv run pytest - Run tests
  • cd backend && uv run black . - Format code with Black
  • cd backend && uv run ruff check . - Lint with Ruff

Docker Development

  • cd backend && docker-compose up -d - Start all services
  • cd backend && docker-compose down - Stop all services

Architecture Overview

Project Structure

  • Frontend: Next.js 15 with App Router, React 18, TypeScript
  • Backend: FastAPI with Python 3.13, async/await architecture
  • Infrastructure: Docker, Redis, PostgreSQL

Key Directories

  • Frontend: frontend/src/app/ (Next.js pages), frontend/src/components/ (UI components)
  • Backend: backend/app/api/ (FastAPI routes), backend/app/core/ (core functionality), backend/app/services/ (business logic)

Core Features

  • Frontend: Real-time dashboard, Apple-style UI, theme switching
  • Backend: Distributed web scraping, Redis-based locking, Celery task queue

API Integration

  • Backend OpenAPI spec at http://localhost:8000/openapi.json
  • Frontend auto-generates API client code

State Management

  • Frontend: React Context + TanStack Query
  • Backend: PostgreSQL + Redis

Deployment

  • Development: Docker Compose for services, Bun/UV for apps
  • Production: Docker containers with Nginx, Kubernetes support