The pieces
Next.js app
App Router + React Server Components. Server actions and
/api/ routes hold the
business logic.Operational DB
PostgreSQL (Drizzle ORM) stores app-managed entities: plans, rules, alerts,
tags, settings, audit.
Analytics (Databricks)
Gold/silver layers hold cleaned and business-ready retail data for analytics,
forecasts, and decisions.
Two data stores, two jobs
- PostgreSQL (operational) — everything users create in Solya: inventory plans and
items, business rules and rulesets, alerts, tags and tagging rules, workflows, settings,
navigation templates, and the audit trail. Org-scoped via
organizationId. - Databricks (analytics) — everything ingested and computed: sales, orders, movements, stock, dimensions, summaries, forecasts, and decision vectors. Populated by the data platform (ETL from POS systems) and read by the app for dashboards, KPIs, search, alerts, and recommendations. See Data model.
Request flow
- A user (browser) or an integration (API token) calls a server action or an
/api/route. - The call is authenticated and resolved to an organization (see Authentication & multi-tenancy).
- Services run the business logic — reading/writing PostgreSQL and/or querying Databricks — and business rules gate mutations where applicable (see Business rules engine).
- Responses use a consistent envelope with stable error codes (see Error codes).

