MOD-01
kulai_auth
AUTHENTICATION CORE
Password hashing and HMAC JWT creation and validation without framework or persistence coupling.
SYSTEM 03
REUSABLE PYTHON INFRASTRUCTURE
A 52-package first-party Python ecosystem covering application foundations, domain modules, persistence and FastAPI adapters.
SYSTEM IDENTITY
SYSTEM IDKULAI-MODULES-03
STATUSACTIVE DEVELOPMENT
TYPESOFTWARE INFRASTRUCTURE
Reusable core, persistence and HTTP adapter layer for composing application systems.
01 / OVERVIEW
KulAI Modules is a first-party Python package ecosystem for reusable application infrastructure and domain capabilities. It separates framework-neutral cores, persistence layers and FastAPI adapters so a new product can compose the pieces it needs.
The verified source snapshot contains 52 packages, 370 Python source files and 277 test files. The inventory covers configuration, logging, errors, databases, authentication, users, payments, subscriptions, access, jobs, providers and more.
02 / MODULE INVENTORY
MOD-01
AUTHENTICATION CORE
Password hashing and HMAC JWT creation and validation without framework or persistence coupling.
MOD-02
FASTAPI AUTH
Email-password login, registration, refresh, logout and current-user dependency wiring.
MOD-03
ECONOMIC CORE
Persistent wallets, reservations and append-only balance ledger with idempotent mutations.
MOD-04
FASTAPI ECONOMICS
Authenticated balance reads plus guarded user, internal and admin balance routes.
MOD-05
ACCESS READ MODEL
Framework-neutral normalization of subscriptions, entitlements, balances and usage summaries.
MOD-06
FASTAPI ACCESS
Read-only billing access HTTP adapter with current-subject and guarded lookup routes.
MOD-07
ACCESS INTEGRATION
Read-only adapters composing subscription, entitlement, balance and usage data.
MOD-08
REDIS INFRASTRUCTURE
Async Redis client lifecycle, prefixed cache operations, JSON helpers and distributed locks.
MOD-09
CALENDAR CORE
Scoped services, resources, availability, bookings, lifecycle transitions and audit events.
MOD-10
FASTAPI CALENDAR
HTTP schemas, dependency injection and configurable routes over the calendar core.
MOD-11
POSTGRES CONCURRENCY
PostgreSQL advisory locks for concurrency-sensitive booking creation and rescheduling.
MOD-12
CONTENT ENGINE
Typed content, JSON-backed sections, navigation menus and contact-message persistence.
MOD-13
CMS ADMIN UI
Server-rendered protected administration panel over the CMS admin API.
MOD-14
CONFIGURATION
Typed Pydantic settings, environment selection, layered dotenv loading and binding.
MOD-15
DATABASE FOUNDATION
Async SQLAlchemy engine and session infrastructure, ORM base and Alembic helpers.
MOD-16
DEVICE IDENTITY
Guest and linked device records, secrets, device JWTs, linking, rotation and revocation.
MOD-17
FASTAPI DEVICES
FastAPI routes and dependency wiring for the device identity core.
MOD-18
ERROR CONTRACT
Shared error codes, typed exceptions, public-detail separation and FastAPI handlers.
MOD-19
FASTAPI FOUNDATION
Application factory, CORS setup, logging middleware and default exception registration.
MOD-20
SERVICE HEALTH
Standard liveness and readiness endpoints with optional database checks.
MOD-21
OBSERVABILITY
JSON logging and request or job correlation identifiers through context variables.
MOD-22
RELIABLE DISPATCH
Durable business events with leased, retryable and idempotent dispatch.
MOD-23
PAYMENTS CORE
Normalized payment facts, Stripe signature verification, webhook claims and sanitization.
MOD-24
PAYMENT BRIDGE
Idempotent bridge from confirmed payment fulfillment requests to balance grants.
MOD-25
FASTAPI PAYMENTS
Signed Stripe webhook transport, database session wiring and fixed HTTP responses.
MOD-26
PERMISSION CORE
Framework-neutral deny-by-default permission evaluation with policies and ports.
MOD-27
PERMISSION STORAGE
Persistence and effective-policy loading for database-backed permission rules.
MOD-28
FASTAPI PERMISSIONS
FastAPI adapter for core evaluation and database-backed permission policies.
MOD-29
PLAN DOMAIN
Portable contracts for feature access, usage limits and periodic credit grants.
MOD-30
PLAN STORAGE
Database definitions and lifecycle for plans, features, limits and credit grants.
MOD-31
FASTAPI PLANS
HTTP access, guarded administration and read-only previews for plan entitlements.
MOD-32
PLAN INTEGRATION
Deterministic mapping from plan DTOs to permission, usage, balance and subscription data.
MOD-33
PLAN CATALOG
Immutable price and duration catalog with database models and built-in seeding.
MOD-34
FASTAPI PLAN CATALOG
Public plan reads and guarded creation or default-seed actions.
MOD-35
PROVIDER AUTH CORE
Framework-neutral provider authentication use cases, contracts and profile handling.
MOD-36
FASTAPI PROVIDER AUTH
HTTP validation, response mapping and composition around injected provider ports.
MOD-37
AUTH BRIDGE
Adapters connecting provider-auth flows with kulai_users and kulai_auth token issuance.
MOD-38
FACEBOOK PROVIDER
Facebook Graph API token verification mapped to the provider profile contract.
MOD-39
GOOGLE PROVIDER
Google ID token verification mapped to the provider profile contract.
MOD-40
IDENTITY STORAGE
Scoped external-provider identity mappings, profile snapshots and lifecycle services.
MOD-41
RATE LIMIT CORE
Weighted fixed-window rules, Redis counters, deterministic keys and limit errors.
MOD-42
FASTAPI RATE LIMITING
Endpoint dependency, application middleware and proxy-aware client IP extraction.
MOD-43
SMS CORE
Provider-neutral SMS dispatch, contracts, optional persistence and idempotent audit state.
MOD-44
FASTAPI SMS
HTTP-safe SMS send and audit-read routes with dependency wiring.
MOD-45
SUBSCRIPTION DOMAIN
Provider-neutral lifecycle functions for start, cancellation, payment changes and access.
MOD-46
SUBSCRIPTION STORAGE
Durable subscription facts, period processing, outbox requests and balance handlers.
MOD-47
FASTAPI SUBSCRIPTIONS
Subject reads, guarded administration and internal period-grant preparation routes.
MOD-48
ASYNC JOBS
Redis-backed enqueue, workers, retries, dead-letter routing and interval scheduling.
MOD-49
SERVICE TUNNELS
Provider abstraction and lifecycle management for exposing a local HTTP service.
MOD-50
USAGE TRACKING
Scoped daily counters, quota checks and read-only usage projections.
MOD-51
USER PERSISTENCE
User accounts, password authentication and refresh-token revocation persistence.
MOD-52
FASTAPI USERS
Authenticated self-service account reads and email updates.
03 / CORE INFRASTRUCTURE
FOUND-01
Typed settings and dotenv loading give applications a shared configuration contract without owning an external service.
FOUND-02
JSON formatting and request or job correlation make logs consistent across HTTP services, workers and CLI processes.
FOUND-03
A common error taxonomy separates safe public payloads from internal details and provides reusable handlers.
FOUND-04
Async SQLAlchemy engine, sessions, ORM foundations and migration helpers establish the persistence boundary.
FOUND-05
Password and JWT primitives remain framework-independent, while user lookup and persistence stay in composing packages.
FOUND-06
Application factories, CORS, middleware and default exception registration form a reusable HTTP assembly layer.
04 / COMPOSITION MODEL
The source establishes a repeatable composition path: the host supplies configuration and application policy, core modules own focused rules, persistence packages own storage, and FastAPI packages translate those capabilities into HTTP boundaries.
Host application composition path
05 / PRACTICAL REUSE
UC-01
Start with typed configuration, shared logging, error handling and database session infrastructure instead of recreating those boundaries in every application.
UC-02
Select a focused core such as calendar, subscriptions, CMS, users or payments and keep its use cases behind an explicit package API.
UC-03
Add the matching FastAPI adapter when an application needs route factories, request schemas and injected host dependencies.
UC-04
Combine access, entitlements, balance, usage, outbox, cache and task modules where the application actually needs those capabilities.
UC-05
Let the host application provide its transaction boundary, policy decisions, external credentials and application-specific workflows.
06 / ENGINEERING DECISIONS
ENG-01
Core domain packages, persistence packages and FastAPI adapters are split into separate distributions with documented responsibility boundaries.
ENG-02
Many repository and service layers flush and refresh without committing, leaving the outer transaction to the host or HTTP adapter where documented.
ENG-03
Package roots define exported models, factories and use cases so consuming applications have deliberate integration points.
ENG-04
Billing access integrations compose existing persistence modules through read ports without mutating subscriptions, balances or usage.
ENG-05
ORM registration exposes models to host Alembic autogeneration while schema revision ownership remains explicit.
ENG-06
Idempotency, outbox dispatch, retries, leases, revocation and advisory locks appear as focused responsibilities rather than hidden application code.
07 / TECHNICAL INVENTORY
STACK-01
All 52 first-party packages are Python distributions with source under their package src directories.
STACK-02
Dedicated adapter packages provide configurable routers, dependencies and application factories.
STACK-03
Settings, domain objects and HTTP schemas use typed validation boundaries across the ecosystem.
STACK-04
Database-backed packages use async ORM models, repositories, sessions and shared metadata conventions.
STACK-05
Migration revisions and model-registration helpers are present in persistence packages and host integration paths.
STACK-06
Cache, rate-limit and task modules use Redis for shared counters, locks, queues and durable runtime state.
STACK-07
The source includes PostgreSQL persistence paths and a dedicated advisory-lock adapter for calendar concurrency.
STACK-08
Payment webhook and local tunnel packages isolate provider-specific boundaries behind focused adapters.
08 / PROJECT STATE
STATE ACTIVE DEVELOPMENT
MODULES 52 FIRST-PARTY PACKAGES
SOURCE 370 PYTHON SOURCE FILES
TESTS 277 TEST FILES / 1724 TEST FUNCTIONS
PRIMARY ROLE REUSABLE CORE / PERSISTENCE / FASTAPI ADAPTERS