惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

DEV Community

93 Agents. 2.6 Billion Tokens. One Working OS. And a Bill Under $1,000. Stop Getting 'It Depends' Answers About RAG Architecture Wrapping Hermes Agent with agent-stack: six tiny libs for the boring parts Templating got me to 33,620 pages. Indexing them was the hard part. EML Attachments Not Opening? Here’s How to Fix the Issue Easily in 2026 WordPress client onboarding: the exact process I use to start every maintenance contract right Models shouldn't have execution authority. Why we built a deterministic FSM runtime for AI agents. AI makes building faster, but semantic distribution is now the hard part How I Created My First Solana Token from Scratch (SPL Token Basics Explained) How I use WP-CLI to cut WordPress maintenance time from 6 hours to 20 minutes What Is Vibe Coding? And Does It Actually Work for Production Code? (I Tested 10 Tools) WordPress staging environments: the 15-minute setup that prevents client emergencies Reading Log #2 — Sapiens Imagined Communities: An Organization Is Made of Shared Fiction I Built a Branded Token on Solana in 5 Minutes (No Smart Contract Needed) The Confidence Gap: How AI Introduces Silent Errors on Production Sites Day 7 - Dense Embedding - RAG Why teachers need explainable AI, not just accurate AI — building the KC dashboard Closing the feedback loop: how mistake classification drives adaptive problem selection in NumPath Amazon Quick: AWS's Agentic Workspace, Explained for Engineers "My Coding Agent Remembered Sessions, Not Work. That Was the Bug" Reading Log #0 — Manga Was a Democratization Device for Cultural Capital SecOps Salary Guide 2025: GRC CTC Ranges in Indian GCCs vs Product Companies 🐍 python global vs nonlocal keyword — when to use each? 6 Free Online Video Cutters That Don’t Completely Ruin Your Footage (2026) Engineering Around Bitcoin's Traditional Platform Lockdowns AI 2026 ⚖️ Case File 4.1: The Efficiency Extortion Client-Side AI: The Next Era of Consumer E-Commerce? Why I'm building an AI math tutor for dyscalculia — and grounding it in 30 years of ITS research "My DingTalk Coding Bot Said It Started the Task. Then It Never Sent the Result" Your trycatch sucks - lets fix it I Built a Globally Distributed Blog Platform for ~$1/Month Awesome-Claude-Skills I built 135 Claude Skills with real formulas. Here's what "production-grade" actually means. How I engineered a Non-Euclidean AI framework for massive data reduction Automated 25 Minutes of My Morning With a Prompt (Not a Script) أدوات API ذاتية الاستضافة: هل يجب أن تترك السحابة؟ Never Use Service Classes in Rails How Markus Builds AI Teams That Actually Ship — Not Just Chat Pricing logic feels boring until it's wrong. Software Engineer Skills Companies Want in 2026: 48K-Posting Analysis Data Races Reproduced: Harnesses That Catch Heisenbugs Demystifying AI Agents: Building an Agentic Pipeline From Scratch in Pure Python Coding Agents Are Becoming Remote Workers. Enterprises Need an Agent Harness. How I Let an AI Refactor My Whole Codebase (Using Gemini 3.5) Flutter 3.44 Highlights From Google I/O 2026: What's New and What Matters The Hidden Cleanup Cost Behind AI Coding Velocity Promises A beginner's guide to the Image-Background-Remove model by Zf-Kbot on Replicate A beginner's guide to the Invsr model by Zf-Kbot on Replicate How to Automate Canadian T4 Slip Parsing with an API (No OCR Setup Required) حماية مفاتيح API من إضافة VS Code ضارة Agetor Review: An Open-Source Kanban Board for Orchestrating Claude Code Why most Marketo audits start at the wrong layer RevOps alignment is an operating-model problem, not a tooling problem Why Some Developers Are Moving Away From Tailwind CSS in 2026 API 키 보호: 악성 VS 코드 확장으로부터 안전하게 VS Code拡張機能によるAPIキー漏洩を防ぐ方法 Temporal Cloud Serverless: Durable Execution Without the Ops Overhead Why Freshers Must Build Real AI Products Instead of Endless App Clones I Built a Dynamic llms.txt for Next.js. Then Google Said Don't Bother. AWS Summit Seoul 2026: Korean Enterprises And Agentic AI Does AI Know How Many Tokens It Is Burning Selling Software in Countries PayPal Can't Reach - A Cautionary Tale of Crypto and Custom Solutions My Old MacBook Air Couldn't Handle It — So I Used Google Colab to Train an AI#1 The Discord.js gotchas that cost me a week each (so they don't have to cost you one) Leetcode QOTD:- 3043. Find the Length of the Longest Common Prefix MPT DEX Performance Test Report I shipped a working landing page in 14 KB. Here is every byte. Zero-Secret CI/CD: GitHub Actions + OIDC on AWS (Part 6) Building the React Frontend: Document Library and Chat UI (Part 5) Runtime Governance Evidence Anchors in 2026: A Public Ledger for Budget and Accountability Decisions RAG and Vector Search with pgvector and Amazon Bedrock (Part 4) Serverless Document Pipelines with AWS Step Functions (Part 3) Multi-Tenant Auth with Cognito and PostgreSQL Row-Level Security (Part 2) Building a Multi-Tenant AI Document Platform on AWS (Part 1: Architecture) Building a Nutrition Calculator in JavaScript: filter, map, and reduce on Objects Shipping an MCP server: parallel search, JSON output, and what broke along the way Runtime Governance Evidence Anchors in 2026: A Public Ledger for Budget and Accountability Decisions A 3-step agent cost me $4.20. agenttrace showed me the O(n ) tool call hiding in plain sight. Beyond WebView: The Next Evolution of Hybrid App Architecture Our retry loop made an outage worse. The circuit breaker stopped the cascade. Claude returned ```json blocks 14% of the time. Here is the Rust crate I wish I had earlier. I burned my Anthropic org cap and waited 3 days. Then I built llmfleet. One Open Source Project a Day (No. 71): CodeGraph — Pre-Index Your Codebase for AI Agents, Save 35% Cost and 70% Tool Calls The prompt your SDK sends is not the prompt you wrote The Context Tax: Why Every Cursor Session Costs You 15 Minutes Prompt Physics: Building a Cognitive Steering Layer for Gemma 4 Pain Points Will Always Outlive Platforms 92. BERT: The Model That Reads in Both Directions QAOA vs. 75,000 Nodes: Building a Hybrid Architecture to Solve NP-Hard Problems When Quantum Simulators Hit a Wall E2B? E4B? 26B A4B? The Gemma 4 Model Names Finally Explained One Tool That Cuts Token Costs 40-80% for Claude Code, Codex, opencode, and openclaw Building a 32-URL economy microsite on top of a 754,000-row SQLite dataset Coordinating 100+ AI Agents in the Field: Practical Patterns for Robotic Swarms Static site search for Astro in 2026: why I picked Pagefind over Algolia and Lunr How I built pairwise AI model compare pages with Claude Haiku and a budget cap Three post-deploy checks I run after every Cloudflare Pages build Why I'm betting on AI-curated directories when Google AI Overviews answer the same queries When boto3 doesn't have it (yet), you write it: a realtime speech-to-speech story in Python Zero-Trust RAG: Defeating the Shared Private Link Deadlock in Azure Terraform You Can't Co-Design What You Don't Operate
Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3
Cuotia · 2026-04-18 · via DEV Community

Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3

Hace unos meses decidí resolver un problema que tenía mi propio consorcio: llevar el control de expensas en planillas de Excel, con pagos en efectivo sin recibo, y sin forma de saber quién debía qué. Lo que empezó como un proyecto de fin de semana terminó siendo Cuotia, una plataforma completa que hoy usan consorcios, escuelas, gimnasios y clubes en Argentina.

En este artículo cuento cómo está construida, qué decisiones técnicas tomé y qué aprendí en el camino.

Stack elegido

Backend: FastAPI (Python) + SQLAlchemy async + PostgreSQL 16
Frontend: Vue 3 + Vite + TailwindCSS + Pinia
Deploy: Docker Compose + Nginx en VPS Contabo
Pagos: MercadoPago API + Resend (emails)

No usé Next.js ni Nuxt porque quería separación clara entre API y frontend. FastAPI me da validación automática con Pydantic, docs en /docs sin esfuerzo y async nativo que necesitaba para las consultas concurrentes.

Arquitectura general

Internet → Cloudflare → Nginx → {
/api/* → FastAPI (puerto 8000)
/* → Vue SPA (Nginx interno)
}

Cuatro contenedores Docker:

  • db — PostgreSQL
  • api — FastAPI con uvicorn
  • frontend — Nginx sirviendo el build de Vite
  • nginx — reverse proxy + SSL con Certbot

El docker-compose de producción tiene todo en una red interna (app-network) y solo expone los puertos 80/443 al exterior.

El desafío del multi-rubro

El feature más interesante técnicamente fue hacer que la misma plataforma sirva para rubros completamente distintos sin duplicar código.

Un consorcio habla de departamentos, expensas y propietarios. Una escuela habla de alumnos, aranceles y grados. Un gimnasio habla de socios, mensualidades y planes.

La solución: una tabla rubros en la DB con todos los labels configurables:

python
class Rubro(Base):
tablename = "rubros"
id = Column(Integer, primary_key=True)
codigo = Column(String(30), unique=True) # "consorcio", "escuela", "gimnasio"
nombre = Column(String(100))
label_unidad = Column(String(50)) # "Departamento" / "Alumno" / "Socio"
label_miembro = Column(String(50)) # "Inquilino" / "Padre/Tutor" / "Socio"
label_cuota = Column(String(50)) # "Expensa" / "Arancel" / "Mensualidad"
label_grupo = Column(String(50)) # "Piso" / "Grado" / "Turno"
tiene_piso = Column(Boolean)
tiene_coeficiente = Column(Boolean)

Y en el frontend, un Pinia store que carga el vocabulario del rubro del usuario:

typescript
// stores/vocabulario.ts
const v = computed(() => ({
unidad: vocab.value?.label_unidad ?? 'Unidad',
miembro: vocab.value?.label_miembro ?? 'Miembro',
cuota: vocab.value?.label_cuota ?? 'Cuota',
label_grupo: vocab.value?.label_grupo ?? 'Grupo',
}))

const esConsorcio = computed(() =>
vocab.value?.rubro_codigo === 'consorcio'
)

Resultado: el mismo componente DepartamentosView.vue muestra "Alumnos" o "Departamentos" o "Socios" según quien esté logueado, sin un solo if (rubro === 'escuela') en el template.

Cierre de mes automático

Uno de los features más pedidos: al cerrar el mes, generar automáticamente las deudas de quienes no pagaron.

python
@router.post("/{consorcio_id}/cerrar-mes")
async def cerrar_mes(consorcio_id: int, ...):
departamentos = await get_departamentos(consorcio_id)
ya_pagaron = []
ya_tienen_deuda = []
deudas_generadas = 0

for depto in departamentos:
    pago = await get_pago_periodo(depto.id, periodo)

    if pago:
        ya_pagaron.append(depto.numero)
        continue

    deuda_existente = await get_deuda_activa(depto.id, periodo)
    if deuda_existente:
        ya_tienen_deuda.append(depto.numero)
        continue

    # Calcular monto con coeficiente
    monto = consorcio.expensa_mensual * depto.coeficiente
    db.add(Deuda(
        departamento_id=depto.id,
        periodo=periodo,
        monto_original=monto,
        monto_actual=monto,
    ))
    deudas_generadas += 1

await db.commit()
return {
    "deudas_generadas": deudas_generadas,
    "ya_pagaron": len(ya_pagaron),
    "ya_tienen_deuda": len(ya_tienen_deuda),
}

El bug más difícil acá: al principio mezclaba "ya pagaron" con "ya tienen deuda" en un solo contador. Llevaba a mensajes como "0 deudas generadas, 15 ya pagaron" cuando en realidad 14 ya pagaron y 1 ya tenía deuda de antes. Separar los casos fue simple pero tomó un rato entender por qué los números no cerraban.

Portal de pagos para inquilinos

Cada departamento tiene un public_token único. Con ese token, el inquilino accede a una vista pública donde ve su estado de cuenta y puede pagar con MercadoPago, sin necesidad de crear cuenta.

python
@router.get("/portal/{public_token}")
async def portal_publico(public_token: str, db: AsyncSession = Depends(get_db)):
result = await db.execute(
select(Departamento).where(Departamento.public_token == public_token)
)
depto = result.scalar_one_or_none()
if not depto:
raise HTTPException(404)

deudas = await get_deudas_activas(depto.id)
pagos = await get_pagos_recientes(depto.id)

return {
    "departamento": depto.numero,
    "deudas": deudas,
    "pagos": pagos,
    "puede_pagar_online": bool(depto.consorcio.mp_access_token)
}

El flujo de pago con MercadoPago:

  1. Frontend llama a POST /mp/crear-preferencia
  2. Backend crea la preferencia en la API de MP y devuelve init_point
  3. Redirigimos al usuario a esa URL
  4. MP callback a GET /mp/webhook cuando se aprueba
  5. Backend registra el pago y envía recibo por email con Resend

Importación masiva desde Excel

Para la incorporación inicial de datos, construí un endpoint que acepta un .xlsx y hace upsert por número de unidad:

python
@router.post("/{consorcio_id}/import/departamentos")
async def importar_departamentos(
consorcio_id: int,
file: UploadFile = File(...),
db: AsyncSession = Depends(get_db),
):
content = await file.read()
wb = load_workbook(filename=BytesIO(content), read_only=True, data_only=True)
ws = wb.active

existing = {d.numero: d for d in await get_departamentos(consorcio_id)}
created, updated, errors = 0, 0, []

for row_idx, row in enumerate(ws.iter_rows(min_row=2, values_only=True), start=2):
    numero = str(row[0]).strip() if row[0] else None
    if not numero:
        continue
    if numero in existing:
        # actualizar
        updated += 1
    else:
        db.add(Departamento(consorcio_id=consorcio_id, numero=numero, ...))
        created += 1

await db.commit()
return {"creados": created, "actualizados": updated, "errores": errors}

Y lo interesante: la plantilla descargable se adapta al rubro. Una escuela descarga una plantilla que dice "grado" en vez de "piso" y "alumno" en vez de "inquilino".

Freemium y feature flags

El modelo de negocio es freemium: plan gratuito con límite de 30 unidades, planes pagos con funcionalidades adicionales. Implementé un sistema de feature flags por plan:

python

En cada endpoint premium

@router.post("/{consorcio_id}/gastos")
async def crear_gasto(consorcio_id: int, ...):
plan = await get_plan(consorcio_id)
if not plan.tiene_extraordinarias:
raise HTTPException(403, "Funcionalidad no disponible en tu plan")

En el frontend, un store de features que bloquea la UI antes de que llegue al backend:

typescript
const featuresStore = useFeaturesStore()

// En el template
<button
@click="featuresStore.tiene('tiene_mp_integrado') ? abrirConfig() : irAPlanes()"
:class="!featuresStore.tiene('tiene_mp_integrado') ? 'opacity-50 cursor-not-allowed' : ''"

Configurar MercadoPago

Lo que aprendí

Sobre el stack:

  • FastAPI + SQLAlchemy async es una combinación excelente para APIs CRUD. La generación automática de OpenAPI docs ahorra horas.
  • Vue 3 Composition API con <script setup> es un placer de usar comparado con Options API.
  • Pinia es simple y predecible. No extraño Vuex.

Sobre el producto:

  • El vocabulario multi-rubro fue la decisión más inteligente. Hubiera necesitado 5 productos separados sin eso.
  • Los administradores de consorcios no son técnicos. El wizard de configuración inicial redujo drásticamente los mensajes de soporte.
  • El cierre de mes automático es el feature más usado. La gente literalmente esperaba hacer eso manual cada mes.

Sobre lanzar:

  • Empezar con un consorcio real (el propio) antes de monetizar fue clave para entender el flujo real.
  • Los primeros usuarios llegaron por boca a boca en grupos de WhatsApp de administradores.

Estado actual y próximos pasos

La plataforma está live en cuotia.com.ar con plan gratuito sin tarjeta de crédito.

Lo que viene:

  • Recordatorios automáticos por email para deudas vencidas
  • App mobile (PWA primero, nativa si hay demanda)
  • Migración de SQL manual a Alembic migrations (deuda técnica real)
  • API pública para integraciones con sistemas contables

Si estás construyendo algo similar o tenés preguntas sobre el stack, dejá un comentario. Y si administrás un consorcio, escuela o gimnasio en Argentina, probalo gratis.

Stack completo: FastAPI · SQLAlchemy · PostgreSQL · Vue 3 · Vite · TailwindCSS · Pinia · Docker · Nginx · MercadoPago · Resend

Tags: python vue fastapi saas argentina

No usé Next.js ni Nuxt porque quería separación clara entre API y frontend. FastAPI me da validación automática con Pydantic, docs en /docs sin esfuerzo y async nativo que necesitaba para las consultas concurrentes.