backend

djimontyp's avatarfrom djimontyp

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

⭐0stars🔀0forks📁View on GitHub🕐Updated Dec 14, 2025

When & Why to Use This Skill

This Claude skill provides a comprehensive framework for building high-performance backends using FastAPI, SQLModel, and asynchronous services. It leverages a Hexagonal Architecture (Ports and Adapters) pattern to ensure a clean separation of concerns between API endpoints, business logic, and data persistence, making it ideal for scalable and maintainable enterprise-grade applications.

Use Cases

  • Architecting scalable RESTful APIs: Utilizing FastAPI and async patterns to handle high-concurrency requests with minimal latency.
  • Implementing Hexagonal Architecture: Decoupling business logic from external dependencies like databases and third-party APIs to improve testability and flexibility.
  • Database Modeling and ORM Management: Defining complex data structures and relationships using SQLModel for seamless integration with PostgreSQL and other SQL databases.
  • AI-Driven Backend Development: Managing LLM provider integrations, vector embeddings, and automated data classification workflows within a structured service layer.
  • Standardizing Backend Workflows: Enforcing strict type checking with mypy and code quality with ruff to maintain a professional-grade codebase.
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