Gerege App¶
Production · Layer 4 — Vertical product ·
Repo: gerege-app-mn · geregeapp.mn
Everyday citizen services in one app. Identified by your national eID, you obtain certificates, sign contracts, make payments and manage your organisation — without juggling multiple apps, passwords and queues.
Ownership
The platform is owned and operated by Gerege App LLC. Its technical
foundation is open-gerege-core, the versioned shared Go module from Gerege
Systems, which supplies identity, security, AI and the service baseline.
The problem it solves¶
Citizens open a different app for every service, remember a different password for each, and attach the same documents over and over. Gerege App closes all three gaps:
| Question | Answer |
|---|---|
| Who is signing in? | eID authentication — QR / App2App / push by national ID |
| Sign in again? | Once only — the platform is itself an OIDC provider |
| Ask for the same document again? | The service registry detects once-only violations |
| Where is my application? | An application timeline plus relay SLA tracking |
Core capabilities¶
-
eID + Gerege SSO
The only way in is eID. No passwords, no e-mail OTP. It is also a relying party of Gerege SSO.
-
An OIDC provider in its own right
With
OAUTH_ISSUERset the platform becomes an identity provider — plain Go code, PKCES256, RS256 id_tokens. -
Government services portal
Catalogue → application → officer queue → decision → certificate, payment and appointment. A ZGW-style state machine separating progress from outcome.
-
Unified service registry
CPSV-AP passports, version history, an evidence catalogue and once-only violation detection (the Estonian principle).
-
Cross-platform relay
Deadline-bound requests from an upstream platform are routed to downstream agencies with SLA tracking. Webhooks are signed with a per-platform secret.
-
AI assistant (Gemini)
Chat, speech-to-text, text-to-speech, live translation. A pgvector semantic knowledge base; the anonymous guest chat is isolated separately.
Also: PAdES document signing plus a sign relay, an admin-managed API gateway, RBAC with a super admin (TOTP MFA), organisations and membership, the eID PKI profile, Google Drive · Dropbox · Google Meet connections, its own SFTP storage (Gerege Space), and a four-language UI (mn · en · zh · ru).
Position in the ecosystem¶
flowchart TD
EID[eID Mongolia<br/>Layer 1] --> SSO[Gerege SSO<br/>Layer 2]
SSO -->|OIDC RP| APP[Gerege App<br/>Layer 4]
SSO -->|eID proxy · sign relay| APP
CORE[(open-gerege-core<br/>Layer 3)] -.foundation module.-> APP
- It never talks to eID directly. Permitted eID services arrive through the
SSO's eID proxy (
/rp/eid,/rp/eid-org) and sign relay (/rp/sign). - The client secret lives on the SSO. The
gerege-app-mnclient is registered onsso.gerege.mn, where the secret is stored only as a hash. - The foundation is shared. The backend is the reference deployment of
open-gerege-core(main.gois ~30 lines) with no routes of its own, so security patches propagate from a single place.
Technology¶
| Layer | Choice |
|---|---|
| Backend | Go 1.26 · chi (net/http) · pgx (no ORM, hand-written SQL) |
| Data | PostgreSQL 16 + pgvector · Redis 7 |
| Frontend | Next.js 15 (BFF) · TanStack Query |
| AI | Gemini REST (no SDK) — chat · STT · TTS · translation |
| Observability | OpenTelemetry · Prometheus · Zap |
| Deployment | Docker Compose + edge nginx, geregeapp.mn |
See Technology stack for details.
Security foundations¶
- Postgres Row-Level Security — the API connects as a non-superuser role and
a boot guard verifies it. The
gov_*tables carry a dedicated officer policy. - The BFF pattern — tokens live in httpOnly cookies and never reach browser JavaScript; CSRF is doubly protected (custom header plus origin).
- Fail-closed features — without credentials a capability turns off rather than pretending to work, and a boot-guard violation stops the API from starting at all.
- Hash-chained audit —
/api/v1/audit/verifychecks the chain's integrity.
Ecosystem-wide requirements are in Security.
Full documentation¶
Implementation-level documentation — the capability matrix, endpoint reference and deployment runbook — lives on its own site:
| Page | About |
|---|---|
| Capability matrix | Every module, permission and UI page at a glance |
| Government services | The full application cycle and officer queue |
| Service registry | CPSV-AP passports, once-only violations |
| Connect an app (OIDC RP) | Steps to sign users in through the platform |
| API reference | Every endpoint in one table |
| Deployment | Compose, env, nginx, rollback |