vault backup: 2026-02-26 22:57:07
This commit is contained in:
@@ -15,14 +15,14 @@ Non-functional requirements, deployment model, API design, and infrastructure co
|
||||
|
||||
### Core Decisions
|
||||
|
||||
| Layer | Technology | Rationale |
|
||||
| -------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------- |
|
||||
| **Backend language** | **Go** | Fast compilation, single binary deployment, excellent concurrency, strong ecosystem for network services |
|
||||
| **API protocol** | **ConnectRPC** (gRPC wrapper) | Type-safe, code-generated clients, supports gRPC, gRPC-Web, and Connect protocols — works in browsers natively |
|
||||
| **API definition** | **Protocol Buffers (Protobuf)** | Schema-first API design, backward-compatible evolution, generates Go server stubs + TypeScript/JS clients |
|
||||
| **Database** | **PostgreSQL 15+** | Robust, proven, excellent JSON support, full-text search, strong ecosystem |
|
||||
| **Frontend** | TBD (React, Vue, Svelte, or SolidJS) | ConnectRPC generates typed client SDKs for any JS/TS framework |
|
||||
| **File storage** | Local filesystem or S3-compatible | Configurable per deployment |
|
||||
| Layer | Technology | Rationale |
|
||||
| -------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
||||
| **Backend language** | **Go** | Fast compilation, single binary deployment, excellent concurrency, strong ecosystem for network services |
|
||||
| **API protocol** | **ConnectRPC** (gRPC wrapper) | Type-safe, code-generated clients, supports gRPC, gRPC-Web, and Connect protocols — works in browsers natively |
|
||||
| **API definition** | **Protocol Buffers (Protobuf)** | Schema-first API design, backward-compatible evolution, generates Go server stubs + TypeScript/JS clients |
|
||||
| **Database** | **PostgreSQL 15+** | Robust, proven, excellent JSON support, full-text search, strong ecosystem |
|
||||
| **Frontend** | **React** (TanStack Router + TanStack Query) | Team expertise, strong ecosystem, ConnectRPC generates typed TS clients |
|
||||
| **File storage** | Local filesystem or S3-compatible | Configurable per deployment |
|
||||
|
||||
### Why ConnectRPC
|
||||
|
||||
@@ -41,6 +41,26 @@ This means:
|
||||
- **Mobile apps** can use gRPC natively
|
||||
- **One `.proto` definition** generates server code (Go), browser client (TypeScript), and mobile client code
|
||||
|
||||
### Frontend Stack
|
||||
|
||||
| Component | Technology | Notes |
|
||||
| ----------------- | ---------------------------- | -------------------------------------------------- |
|
||||
| **Framework** | React | SPA — SEO is not a requirement |
|
||||
| **Routing** | @tanstack/router | Type-safe, file-based routing |
|
||||
| **Data fetching** | @tanstack/query | Caching, background refetching, optimistic updates |
|
||||
| **API client** | ConnectRPC generated TS code | Type-safe from `.proto` definitions |
|
||||
| **Build tool** | Vite | Fast dev server and optimised builds |
|
||||
|
||||
### Mobile App
|
||||
|
||||
| Component | Technology | Notes |
|
||||
| ----------------- | ---------------------------- | ------------------------------------------------ |
|
||||
| **Framework** | React Native / Expo | Shared knowledge with web React team |
|
||||
| **Data fetching** | @tanstack/query | Same patterns as web client |
|
||||
| **API client** | ConnectRPC generated TS code | Same `.proto` definitions as web |
|
||||
| **Priority** | Planned but not prioritised | PWA / responsive web covers initial mobile needs |
|
||||
| **Offline** | Nice-to-have | Queue scan operations and sync when reconnected |
|
||||
|
||||
### Project Structure (Proposed)
|
||||
|
||||
```
|
||||
@@ -95,6 +115,18 @@ eventkit/
|
||||
|
||||
Each company runs their own instance. The deployment should be **simple and reproducible**.
|
||||
|
||||
### Multi-Tenancy (Managed SaaS)
|
||||
|
||||
For the hosted SaaS offering, use a **shared database with tenant isolation**:
|
||||
|
||||
| Aspect | Approach |
|
||||
| -------------------- | ----------------------------------------------------------------------- |
|
||||
| **Database** | Shared PostgreSQL instance, tenant ID on every table |
|
||||
| **Isolation** | Row-level security (RLS) policies enforce tenant boundaries |
|
||||
| **Connection** | Connection pooling shared across tenants |
|
||||
| **Migration** | Single schema, all tenants upgrade together |
|
||||
| **Data sovereignty** | Tenants wanting full isolation should use self-hosted or dedicated tier |
|
||||
|
||||
| Approach | Description |
|
||||
| ---------------------- | -------------------------------------------------------------------- |
|
||||
| **Docker Compose** | Recommended for single-server deployments — all services in one file |
|
||||
@@ -315,6 +347,18 @@ erDiagram
|
||||
|
||||
---
|
||||
|
||||
## Notifications
|
||||
|
||||
| Channel | Supported | Notes |
|
||||
| --------------- | --------- | --------------------------------------------- |
|
||||
| **Email** | ✅ Yes | Transactional emails (SMTP or provider API) |
|
||||
| **Web push** | ✅ Yes | Browser push notifications via service worker |
|
||||
| **Native push** | ✅ Yes | Via Expo push / APNs / FCM for mobile app |
|
||||
| **Webhooks** | ✅ Yes | Outbound webhooks for third-party integration |
|
||||
| **SMS** | ❌ No | Not planned |
|
||||
|
||||
---
|
||||
|
||||
## Monitoring & Observability
|
||||
|
||||
| Feature | Description |
|
||||
|
||||
Reference in New Issue
Block a user