Introduction
Addressing a common issue within various sectors, a multi-purpose SaaS platform was developed to simplify expense management in Argentina. Initially conceived to solve a personal community's expense tracking challenges, this project evolved into 'Cuotia', a comprehensive solution now utilized by consortia, schools, gyms, and clubs across the country.
Technical Stack
- Backend: FastAPI (Python) with SQLAlchemy async and PostgreSQL 16
- Frontend: Vue 3, Vite, TailwindCSS, Pinia
- Deployment: Docker Compose and Nginx on a VPS from Contabo
- Payments: MercadoPago API with email handling via Resend
The decision to exclude frameworks like Next.js or Nuxt was driven by the need for clear separation between the API and frontend, allowing FastAPI to provide automatic validation and documentation.
General Architecture
The architecture is designed around a streamlined flow:
Internet → Cloudflare → Nginx → {
/api/* → FastAPI (port 8000)
/* → Vue SPA (internal Nginx)
}
This setup includes four Docker containers:
- db: PostgreSQL
- api: FastAPI with uvicorn
- frontend: Nginx serving the Vite build
- nginx: Reverse proxy with SSL via Certbot
The production docker-compose file ensures all components reside within an internal network, exposing only ports 80/443.
The Multi-purpose Challenge
A significant technical feature was enabling the platform to serve diverse sectors without duplicating code. This was achieved through a flexible database schema where labels are configurable, allowing customization for consortia, schools, and gyms.
In the frontend, a Pinia store dynamically loads the user's sector-specific vocabulary, adapting components like DepartamentosView.vue to display relevant terms based on the logged-in user.
Automated Month-end Closure
One of the most requested features is the automated month-end closure, which generates outstanding balances for unpaid dues. This feature ensures efficient management of financial records and reduces manual interventions.
Tenant Payment Portal
Each unit possesses a unique public token, granting tenants access to a public view for account status and payment options via MercadoPago, eliminating the need for account creation.
Bulk Data Import from Excel
To facilitate initial data integration, an endpoint accepts .xlsx files, performing upserts based on unit numbers. The downloadable template adapts to the user's sector, ensuring seamless data entry.
Freemium and Feature Flags
The business model follows a freemium structure, offering a free plan for up to 30 units and premium plans with additional features. Feature flags manage access to premium functionalities, ensuring a tailored user experience.
Lessons Learned
Technical Insights:
- FastAPI with SQLAlchemy async excels in CRUD API development, providing valuable time savings through automatic OpenAPI documentation.
- Vue 3's Composition API offers a superior development experience compared to the Options API.
Product Insights:
- The multi-sector vocabulary was a strategic choice, preventing the need for multiple separate products.
- User-friendly setup wizards significantly reduced support inquiries.
Current Status and Future Plans
The platform is live at cuotia.com.ar, offering a free plan without requiring credit card information. Future developments include:
- Automatic email reminders for overdue payments
- A mobile app (PWA initially, with potential native development)
- Migration of SQL to Alembic migrations for improved technical debt management
- A public API to integrate with accounting systems
For those interested in similar projects or seeking insights into the technical stack, feedback and inquiries are welcome. If managing a consortium, school, or gym in Argentina, explore the platform with a free trial.
Complete Stack: FastAPI · SQLAlchemy · PostgreSQL · Vue 3 · Vite · TailwindCSS · Pinia · Docker · Nginx · MercadoPago · Resend
Tags: python, vue, fastapi, saas, argentina