backend

majiayu000's avatarfrom majiayu000

FastAPI, SQLModel, async services for Pulse Radar backend development.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 5, 2026

When & Why to Use This Skill

This Claude skill streamlines backend development by leveraging FastAPI and SQLModel within a strict Hexagonal architecture. It provides a robust framework for building asynchronous services, managing complex data models with embeddings, and ensuring high code quality through standardized patterns for routers, services, and CRUD operations.

Use Cases

  • Developing scalable asynchronous RESTful APIs using FastAPI with built-in dependency injection and validation.
  • Implementing a clean Hexagonal architecture to decouple business logic from database and API layers for better maintainability.
  • Managing relational database schemas and AI-specific data (like embeddings and importance scores) using SQLModel entities.
  • Automating backend quality assurance with integrated support for strict type checking (Mypy), formatting (Ruff), and comprehensive testing (Pytest).
namebackend
descriptionFastAPI, SQLModel, async services for Pulse Radar backend development.

Backend Development Skill

Architecture (Hexagonal)

backend/app/
├── api/v1/          # 23 routers (~100 endpoints)
├── models/          # 21 SQLModel entities
├── services/        # 35 services (business logic)
├── tasks/           # TaskIQ workers
└── ws/              # WebSocket endpoint

Layer Pattern

Router (API) → Service (logic) → CRUD (data)
     ↓              ↓                ↓
  Validation    Business rules    Database

API Pattern

@router.get("/atoms/{atom_id}")
async def get_atom(
    atom_id: UUID,
    service: AtomService = Depends()
) -> AtomRead:
    return await service.get_by_id(atom_id)

Service Pattern

class AtomService:
    def __init__(self, crud: AtomCRUD = Depends()):
        self.crud = crud

    async def get_by_id(self, atom_id: UUID) -> AtomRead:
        atom = await self.crud.get(atom_id)
        if not atom:
            raise HTTPException(404, "Atom not found")
        return AtomRead.model_validate(atom)

Key Models

  • Message: content, embedding (1536), importance_score, noise_classification
  • Topic: name, icon, color, keywords
  • Atom: type, title, content, confidence, user_approved
  • LLMProvider: type (ollama/openai), api_key_encrypted, validation_status

Key Enums

AnalysisStatus: pending, analyzed, spam, noise
AtomType: problem, solution, decision, question, insight, pattern, requirement
ProviderType: ollama, openai
ValidationStatus: pending, validating, connected, error

Verification

just typecheck  # mypy strict
just fmt        # ruff format
just test       # pytest suite

References

  • @references/models.md — All 21 models with fields
  • @references/services.md — All 35 services
  • @references/taskiq.md — Background task patterns