Mostafa Effati
author · 12 documentschapter · 4 min
Frontend Session Edge
How a Next.js edge proxy keeps device and user-account cookies in sync — resolve device first, refresh account second, single-flight to avoid refresh races.identitynextjssessions
chapter · 3 min
Organizations and Location
Modeling organizations, employees, and geo as domain entities — not free-text fields bolted onto User.identityorganizationsgeo
chapter · 3 min
Authentication Convergence
OTP, email password, and OAuth should verify differently — then share one user-provisioning and session-establishment path in the identity domain.identityauthenticationoauth
chapter · 3 min
Refresh Token Families
How refresh-token rotation and family reuse detection turn stolen tokens into detectable compromise — for both device and account sessions.identityrefresh-tokenssecurity
chapter · 4 min
Device Session vs User Account Session
Why identity needs two session layers — device before account — and how that changes logout, theft, and multi-device design.identitysessionsdevice-session
chapter · 3 min
Citizenship as a Relationship
Why citizenship should not be a single field on the Person entity.identitycitizenshipdomain-modeling
chapter · 3 min
Contact Information as an Aggregate
Why contact channels should not live as fields on the User account.identitycontactsaggregates
chapter · 3 min
Why User and Person Are Different
Why a user account is not the same thing as a human being in identity systems.identitydomain-modelinguser
chapter · 3 min
Identity Is More Than Login
Designing an identity service from scratch — why authentication is only a small part of the problem.identityarchitectureauthentication
book · 2 min
Identity Service Architecture
Designing an identity service from scratch — User vs Person, contacts, citizenship, dual sessions, auth convergence, orgs, geo, and the Next.js session edge.identitysystem-designbackend
article · 3 min
Stop Proxying Files Through Your Backend
A scalable system design shift — treat the backend as a permission engine, not a file pipeline.system-designbackendcdn
article · 4 min
Keeping Docker, Git, and CI/CD Alive During Internet Disruptions
Keeping Docker, Git, and CI/CD alive on Iranian servers during internet disruptions with SSH reverse tunneling and a local proxy.devopsdockerssh