Architecture
MemberJunction is metadata-driven: you define your schema in the database, and CodeGen produces everything above it — typed entity classes, stored procedures and views, GraphQL resolvers, and Angular forms. One object model runs identically on the server, in the browser, in the CLI, and inside agents.
graph TD
DB[(Your Database<br/>SQL Server / PostgreSQL)] --> MD[Metadata Layer<br/>entities, fields, permissions]
MD --> CG[CodeGen]
CG --> ENT[Typed Entity Classes<br/>@memberjunction/core-entities]
CG --> SQL[Views + Stored Procedures]
CG --> UI[Generated Angular Forms]
ENT --> API[MJAPI — GraphQL Server]
API --> EXP[MJ Explorer — Angular UI]
API --> AGENTS[AI Agents & Actions]
ENT --> AGENTS
AGENTS --> PROVIDERS[15+ AI Providers<br/>one abstraction layer]
The layers
Section titled “The layers”- Metadata core — every entity, field, relationship, and permission is described in metadata tables.
@memberjunction/coreis the runtime that reads it. - Generated data layer — CodeGen emits typed
BaseEntitysubclasses, SQL views, and CRUD stored procedures. You never hand-write CRUD. - API layer — MJAPI serves a GraphQL API generated from the same metadata, with row-level security and full audit trails.
- UI layer — MJ Explorer renders generated forms, dashboards, and grids; every surface is extensible with custom Angular components.
- AI stack — providers, prompts, agents, and vector sync operate directly on your entities. See AI & Agents.
Go deeper
Section titled “Go deeper”- Building Apps on MJ — the schema-to-app development model.
- Framework comparison — MJ vs. Next.js/Supabase/Rails/Django.
- Caching & real-time sync — the server cache + pub/sub architecture.
- Package directory — all 290+ packages by area.
- API Reference — TypeDoc for every published package.