Back to projects

Multi-Tenant SaaS Platform for Business Management

Own product · In development

Multi-Tenant SaaS Platform for Business Management — 1

Context

Small retail and wholesale businesses often run sales, stock and invoicing on spreadsheets or disconnected tools. The platform aims to bring all of it together as a subscription web service.

Each business signs up as a tenant with isolated data. It covers product management, sales, inventory with stock history and electronic invoicing.

Technical decisions & challenges

  1. 01

    Multi-tenancy with one PostgreSQL schema per business

    I chose to isolate each tenant in its own schema instead of filtering by column: isolation is enforced by the database, not by every query. The cost was adapting Alembic to migrate the public schema and tenant schemas separately, backed by an integration test.

  2. 02

    Electronic invoicing with AFIP

    Integrating with AFIP's web services requires storing each business's certificate and private key. Keys and tokens are stored encrypted, and the backend refuses to start without the encryption key, preventing data that could never be decrypted later.

  3. 03

    Async backend with FastAPI and SQLAlchemy

    REST API built with FastAPI, async SQLAlchemy and Pydantic, consumed by a Next.js frontend in TypeScript, all containerized with Docker.