Montara Pass
Architecture

Overview

The parts of Montara Pass and how they talk to each other.

Components

 browser ── /            ──►┐
            /vault, …       │  static files of the web app (apps/app)
                            ├─ server (apps/server) ──► PostgreSQL 18
 browser ── /api/v1/…   ──►│  the API
 extension ─ /api/v1/…  ──►┘

One process answers on one origin. Every endpoint starts with /api; any other path is a file of the web app, or index.html for a route that exists only in the browser. In development the Vite dev server plays the first role and proxies /api to the Go server.

  • The API authenticates users and stores what clients send. It validates sizes and shapes, enforces who may touch which item, and never decrypts. In production the same process also serves the web app's static files.
  • The web app is the full client: it creates the vault, manages folders, items, sharing and the trash.
  • The extension reads the same vault and fills logins into pages. It imports the web app's lib/crypto module directly, so both produce and read exactly the same ciphertext.
  • The marketing site and these docs are separate static-ish sites and do not talk to the API.

Two passwords

Sign-in passwordMaster password
Proveswho you are, to the servernothing to the server
Sent to the serveryes, over TLSnever
Can be resetyes, by emailno
Protectsthe accountthe vault's keys

Signing in gives access to the ciphertext. Only the master password turns it into something readable.

Server layout

apps/server follows the gofi structure:

PathRole
cmd/apiThe HTTP server: flags, database, Authula, the routes under /api and the static web app
cmd/migrateThe migration CLI
internal/handlersOne handler per resource; reads the request, calls a repository
internal/repositoriesSQL, one repository per table group
internal/dtosRequest bodies with their validation rules, and the response envelope
internal/middlewaresAuthorization, CORS, rate limit, error rendering
internal/modelsRow types
migrationsSQL files, embedded in the binary

The web app is served from ./public, relative to the working directory. When that folder is missing, as under go run, the server serves the API only.

Web app layout

Everything lives under apps/app/src.

PathRole
src/routesFile-based routes for TanStack Router; (auth) and (app) are groups that add no URL segment
lib/apiOne axios client that refreshes the access token on a 401, then services, queries (TanStack Query), models and dtos (zod)
lib/cryptoKey derivation, AES-GCM, RSA-OAEP and the vault operations built on them
lib/stores/vault.tsThe unlocked keys, in memory only
components/{ui,block,layout}Primitives, feature blocks and page chrome
config/env.tsThe VITE_* variables, validated once

The extension imports lib/crypto, the API models and the item schema from here through its @/ alias, which points at apps/app/src.

On this page