Technology

almond system overview

This page answers common questions about our technology, database, security, backup, and offline usage — organized in two levels so both executives and IT teams can read it together.

Level 1 — Executive Summary

Executive summary

The 10 key questions customers ask, answered in a single page — ready to hand to leadership.

LanguagesTypeScript / React 19 (Frontend) + TypeScript on Edge runtime (Backend)
Main toolsTanStack Start, Tailwind CSS, PostgreSQL, Cloudflare Workers
DatabasePostgreSQL (Managed Cloud Service) on encrypted SSD (AES-256)
Where storedData centers in Southeast Asia (Singapore region)
Storage sizeStarts at 8 GB, auto-scales to TB range
Tenant isolationRow-Level Security (RLS) — enforced by the database engine itself
SecurityHTTPS/TLS 1.3, JWT, OAuth, bcrypt password hashing, audit logs, SOC 2
BackupDaily automated + Point-in-Time Recovery to the second, 7 days back
Offline useNo — it is a Cloud SaaS (4G/5G recommended as backup)
Uptime99.9% SLA (~8 hrs/year max downtime)
Level 2 — Technical Details

Details for IT teams

Deep dive into architecture, security, and operations.

2.1 Technology Stack

Frontend
  • Language: TypeScript
  • UI: React 19
  • Routing / SSR: TanStack Start v1
  • Styling: Tailwind CSS v4 + shadcn/ui
  • Build: Vite 7 + Bun
Backend
  • Language: TypeScript
  • Runtime: Cloudflare Workers (Edge)
  • API: TanStack Server Functions (type-safe RPC)
  • Auth: JWT + Refresh Token, Google OAuth
Database & Storage
  • PostgreSQL 15+ (Managed)
  • Encrypted object storage (attachments, images, PDFs)
  • Email: Managed SMTP + pgmq + pg_cron
DevOps
  • Git + automated CI/CD on every commit
  • Environments: Dev / Preview / Production

2.2 Database Architecture

PostgreSQL — an industry-standard RDBMS used by Apple, Instagram, Reddit, Spotify, and many enterprises. Hosted in Singapore (Southeast Asia region) to meet PDPA data-residency needs.

  • Low latency to Thailand (< 30ms)
  • High-speed SSD, encryption at rest (AES-256)
  • Encryption in transit: TLS 1.3
  • Automatic vacuum and index optimization
  • Starts at 8 GB, auto-scales to TB range
  • Pay-as-you-grow (no upfront hardware)

2.3 Multi-Tenant Isolation

Every table has a company_id column plus a policy that filters every query. A user from Company A always sees 0 rows from Company B. Because the rule lives in the database engine — not the application — even a bug in the app cannot bypass it.

ModelSecurityCostScaleWe use
Shared DB + RLSVery high (engine-enforced)LowExcellent
Schema-per-tenantHighMediumLimited
DB-per-tenantVery highVery highLimited
User Roles: stored in a separate user_roles table + security-definer function has_role() to prevent privilege escalation (owner / admin / member / viewer).

2.4 Security Controls

Authentication
  • Email + Password (bcrypt hashing)
  • Google OAuth 2.0 single sign-on
  • JWT session + rotating Refresh Token
Encryption
  • In Transit: HTTPS/TLS 1.3
  • At Rest: AES-256 on disk
  • Backups encrypted with a separate key
Access Control
  • Row-Level Security (see 2.3)
  • License codes — module + expiry gating
  • Role-based permission (owner/admin/member)
  • Rate limiting against brute force
Monitoring & Compliance
  • Audit logs for sensitive access & changes
  • Real-time error tracking + alerting
  • SOC 2 Type II (infrastructure provider)
  • GDPR-ready, PDPA-aligned

2.5 Backup & Disaster Recovery

Automated daily backup + Point-in-Time Recovery to any second within the last 7 days — RTO 1-4 hours, RPO < 1 minute.

TypeFrequencyRetention
Full backupDaily7 days (up to 30)
WAL (transaction log)Continuous, real-time7 days
Geo-redundant copyDailyStored in a different region
Customers can self-export from Settings → Backup & Restore (JSON / CSV / SQL) — no vendor lock-in.

2.6 Availability & Offline

This is a Cloud SaaS and requires internet — designed for real-time consistency across branches and devices, with zero installation and automatic updates.

When the internet is down
  • Use a 4G/5G mobile hotspot — low bandwidth (~50-200 KB/page)
  • Local cache in some modules (POS, Front Office) for temporary read
  • Auto-retry queued actions when connectivity returns
Uptime SLA
  • 99.9% (~8 hours downtime/year)
  • Multi-region failover for frontend (Edge network)
  • Database with read replicas + automatic failover
FAQ

Frequently asked questions

Q: Can my company's data leak to another company?
A: No — RLS is enforced at the database engine on every query. Even if the application had a bug, the database itself would still block it.
Q: What happens to my data if we stop using the platform?
A: You can export it yourself from Settings (JSON/CSV/SQL) — no vendor lock-in. After account closure, data is deleted per our retention policy (30 days).
Q: How many concurrent users does the system support?
A: Edge runtime + managed PostgreSQL scale automatically. Current capacity handles tens of thousands of concurrent users per instance.
Q: Do you run penetration testing?
A: The infrastructure provider is SOC 2 Type II audited with annual pen tests. At the application layer, we run automated security scans on every deployment.
Q: Can data be stored only in Thailand?
A: We currently store data in Singapore (Southeast Asia region), still within ASEAN and PDPA-compliant. Thailand-only storage requires a custom plan.
Q: Do costs grow as data grows?
A: Yes — usage-based billing (storage, bandwidth, compute billed separately), with advance notice before any tier change.
Glossary

Terms used in this page

SaaSSoftware as a Service — used through the web, nothing to install
RLSRow-Level Security — PostgreSQL's row-level filtering rules
JWTJSON Web Token — a signed token used for authentication
PITRPoint-in-Time Recovery — restore to any second in the past
RTORecovery Time Objective — max time to restore service
RPORecovery Point Objective — max acceptable data loss window
Edge RuntimeServers distributed worldwide close to users for low latency
SOC 2Security compliance standard for service providers
PDPAThailand's Personal Data Protection Act
AES-256Military-grade encryption standard

Want to learn more about almond?

Read more about the team, or talk to sales for a live demo.