Introduction & Project Scope
Relevant source files
The following files were used as context for generating this wiki page:
The MuteTaxes project is a prototype and visualization platform for relationship-based access control (ReBAC). Its primary purpose is to demonstrate how authorization can be managed using OpenFGA in conjunction with a relational database (PostgreSQL). The project focuses on the configuration of roles and permissions by an administrator and the subsequent dynamic adjustment of the user interface based on those permissions.
The scope of the project encompasses a Node.js Express backend and a React frontend. Rather than serving as a functional CRM, the system uses minimal or mocked business data to highlight the authorization UX, including a dynamic sidebar and permission-sensitive action buttons.
Sources: PLAN.md:3-9, frontend/src/pages/HomePage.tsx:7-11
System Architecture
The project is structured into three main components: a TypeScript backend, a Vite-powered React frontend, and infrastructure managed via Docker Compose.
High-Level Component Overview
The diagram shows the communication flow between the frontend client, the backend API, and the two primary data stores used for state and authorization.
Sources: PLAN.md:12-21, backend/src/index.ts:1-20
Technical Stack
| Layer | Technologies |
|---|---|
| Backend | Node.js, Express, TypeScript, Prisma (ORM) |
| Frontend | React, Vite, TailwindCSS, TypeScript |
| Authorization | OpenFGA (Official JS SDK) |
| Database | PostgreSQL |
| Infrastructure | Docker, Docker Compose |
Sources: PLAN.md:12-21, backend/package.json:20-30
Project Scope & Objectives
The project is designed to demonstrate specific authorization workflows:
- Relationship-Based Definition: Roles and permissions are defined as relationships within OpenFGA.
- Administrative Configuration: A "Super Admin" user has access to management interfaces for users, roles, and table resources.
- Dynamic UI Adaptation: The frontend sidebar and action buttons (Create, Read, Update, Delete) are rendered or enabled based on real-time permission checks against OpenFGA.
Sources: PLAN.md:4-9, frontend/src/pages/HomePage.tsx:16-29
Core Data & Authorization Models
The project utilizes two distinct models to manage data and access: a PostgreSQL schema for entity metadata and an OpenFGA model for relationship logic.
Relationship Logic (OpenFGA)
The OpenFGA model defines how users interact with "tables" (resources) through roles. Permissions are computed based on "badges" assigned to roles.
The diagram represents the relationship hierarchy where users gain permissions to tables by being members of roles that hold specific CRUD badges.
Sources: PLAN.md:26-44, backend/src/fga/fgaClient.ts:98-150
Application Entities (PostgreSQL)
The relational database tracks the metadata for users, roles, and the registry of tables available in the system.
| Entity | Description |
|---|---|
| User | System users identified by a unique username. |
| Role | Named collections of permissions (e.g., "accountant", "superadmin"). |
| UserRole | Many-to-many mapping connecting Users to Roles. |
| Table | A registry of resource "slugs" (e.g., clients, invoices) managed by the system. |
Sources: PLAN.md:49-74, backend/src/seed.ts:16-25
Key System Integration
The backend serves as the bridge between the database and the OpenFGA server. It provides specific endpoints for the frontend to query the "Permission Matrix" and individual user capabilities.
Authorization Data Flow
This flow illustrates how the frontend requests a permission set for a specific resource, which the backend verifies by querying the OpenFGA server.
Sources: PLAN.md:129-137, backend/src/fga/fgaClient.ts:98-115, frontend/src/api/endpoints.ts:141-143
Summary of Scope
MuteTaxes is an architectural demonstration of modern authorization patterns. It limits its scope to the "Authorization UX," providing a "Permission Matrix" for administrators to toggle CRUD badges and a responsive frontend that reflects these changes instantly. It avoids the complexity of a full business application to maintain focus on the integration between Express, Prisma, and OpenFGA.