moai-domain-backend

Implements backend APIs, database integrations, and microservices patterns with FastAPI, PostgreSQL, and Redis.

Updated Jul 24, 2026
One-click install
npx skills add https://github.com/jjjh7401/AI-Lighting_Console --skill moai-domain-backend-jjjh7401
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: moai-domain-backend
Source: https://github.com/jjjh7401/AI-Lighting_Console/tree/main/.moai/archive/skills/v2.16/moai-domain-backend
Command: npx skills add https://github.com/jjjh7401/AI-Lighting_Console --skill moai-domain-backend-jjjh7401

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing and implementing backend systems involves many recurring decisions—API style, database access, caching, authentication, and service communication. This Skill provides concrete implementation patterns for these tasks so backend work follows consistent, secure, and tested conventions instead of ad-hoc solutions. ## Core Features & Use Cases - API Design: Patterns for REST (FastAPI with Pydantic and OpenAPI 3.1), GraphQL (Strawberry), and gRPC services. - Database Integration: SQLAlchemy models with connection pooling for PostgreSQL, Motor-based async MongoDB services, and Redis caching decorators. - Microservices & Security: Consul service discovery, AMQP event buses with aio_pika, JWT authentication, and bcrypt password hashing. - Use Case: When building a new FastAPI service that needs user authentication, PostgreSQL persistence, and cached read endpoints, use this Skill to generate the models, security layer, and cache manager following proven patterns. ## Quick Start Use the backend specialist skill to scaffold a FastAPI endpoint with JWT authentication and a pooled PostgreSQL connection.

Frequently Asked Questions about moai-domain-backend

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a REST API with FastAPI and authentication?▼

Define Pydantic response models, then implement endpoints protected by an HTTPBearer security dependency. The skill's pattern shows list and create endpoints returning typed UserResponse models with JWT-based access control.

How to set up PostgreSQL connection pooling with SQLAlchemy?▼

Configure the SQLAlchemy engine with QueuePool, pool_size of 20, max_overflow of 30, pool_pre_ping enabled, and pool_recycle of 3600 seconds. Event listeners on cursor execution can log queries exceeding a 100ms threshold.

What caching pattern works with Redis in Python backends?▼

Use a CacheManager class with a cache_result decorator that accepts a ttl parameter. It builds cache keys from the function name and arguments, returns cached values on hit, and stores serialized results with expiration on miss.

Does this skill cover GraphQL as well as REST?▼

Yes, it includes a GraphQL implementation pattern using Strawberry, defining typed objects and async resolvers, alongside REST with FastAPI and gRPC for high-performance services.

Why should backend endpoints validate input if the frontend already does?▼

Frontend validation is a user-experience concern, while backend validation is a security requirement. Every endpoint must validate input because requests can bypass the frontend entirely, and unvalidated input risks injection and data corruption.

When should I avoid adding another endpoint to an existing service?▼

Unbounded endpoint growth creates a monolith-in-disguise. Evaluate service boundaries first; if the new functionality belongs to a distinct domain, a separate microservice with its own discovery and event flow may be the better pattern.