How jaydhulia/iam-policy-generator works
1. Overall shape
- This is a single-page React front end for generating AWS IAM policies.
- There is no backend service in the repo; all current behavior is client-side, with static data shipped in public/iam_definition.json.
2. Application entry and bootstrapping
- src/index.js is the React entry point.
- It mounts App into the DOM and pulls in global CSS.
- Standard Create React App support files exist (reportWebVitals.js, setupTests.js), but they are not central to the product architecture.
3. Top-level composition
- src/App.js is the main composition layer.
- It likely wires together the page layout, header, search, and policy-generation sections.
- App.css and index.css define the app-wide presentation layer.
4. Core feature subsystem: policy generation
- src/Components/PolicyGen.js is the main domain component.
- It appears responsible for managing the selected AWS service, actions, and the evolving IAM policy state.
- From the README, this is where future capabilities will expand: statements, resources, conditions, CRUD templates, and export formats.
5. Service and action selection
- src/Components/Search.js is the discovery interface for AWS services.
- README status says the user can currently search and select an AWS service, then select actions based on that service.
- This suggests a data flow of: service search input → filtered service list → selected service → action list.
6. UI framing and navigation
- src/Components/PolicyGenHeader.js is a lightweight presentational/header component.
- It likely provides the page title or contextual controls for the policy generator.
- Semantic UI is used for the interface styling and components, so the UI is component-driven rather than custom-built from scratch.
7. Static AWS dataset
- public/iam_definition.json is the main data asset.
- It contains the IAM definitions used to drive service/action lookup and suggestion logic.
- The README credits the source dataset to iann0036/iam-dataset, which means the app’s behavior depends on a precomputed, local data file rather than live AWS API calls.
8. Data flow through the app
- The architecture is essentially: static IAM dataset → search/filter UI → selected AWS service/actions → policy generation state → rendered policy output.
- The current repo shows the left side of that flow most clearly; the output/export side is listed as future work.
9. Current boundaries and limitations
- The codebase is intentionally minimal and WIP.
- It currently stops short of handling several important IAM policy modeling concepts: removing actions, preventing duplicates, multiple statements, resources, conditions, and output formats.
- That means the present architecture is focused on selection and assembly, not full policy validation or export pipelines.
10. Deployment/runtime model
- As a CRA-style React app, it is meant to be built into static assets and served like a normal web app.
- public/index.html, public/manifest.json, and public/robots.txt are standard web app shell assets.
- There are no infrastructure dependencies or external runtime services visible in the repo.
11. Useful diagram boundaries
- A good architecture diagram would show:
- Browser UI layer: App, Header, Search, PolicyGen
- Local dataset layer: iam_definition.json
- Generated policy state: maintained in React component state
- Future export/output layer: JSON / Terraform / YAML, noted in README but not yet implemented
12. What matters most for understanding the repo
- The repository is a front-end policy authoring tool centered on AWS IAM metadata.
- Its current differentiator is searchable AWS service/action selection from a bundled dataset.
- Everything else in the repo supports that single workflow.
Main entry points: App.js App · PolicyGen.js Policy builder · index.js Entry · Search.js Search
Components 11
React app
Client-side IAM policy authoring UI
- Entry · Mounts the app and loads global styles
src/index.js - App · Top-level page composition and wiring
src/App.js - Header · Page title and contextual header area
src/Components/PolicyGenHeader.js - Search · Discovers AWS services and selects actions
src/Components/Search.js - Policy builder · Manages selected service, actions, and policy assembly
src/Components/PolicyGen.js - App styles · App-wide component styling
src/App.css - Global styles · Global page styles
src/index.css
Static assets
Bundled data and web shell files
- IAM dataset · Local service and action definitions used by the UI
public/iam_definition.json - HTML shell · Root document served to the React app
public/index.html - Web manifest · Browser installation metadata
public/manifest.json - Robots · Search crawler directives
public/robots.txt
Connections 13
- HTML shell → Entry: loads · Browser shell hosts the React bundle
- Entry → App: mounts · Bootstraps the main application component
- Entry → Global styles: imports · Applies global page styles
- App → Header: renders · Composes the page header
- App → Search: renders · Composes the service discovery UI
- App → Policy builder: renders · Composes the policy authoring workspace
- App → App styles: imports · Applies app-level styling
- Search → IAM dataset: reads · Filters services and actions from the bundled dataset
- Policy builder → IAM dataset: reads · Uses the local IAM metadata to build policy state
- Search → Policy builder: updates · Selected service and actions flow into the policy builder
- Header → Policy builder: frames · Provides contextual UI for the builder
- Web manifest → HTML shell: supports · Provides web app metadata for the shell
- Robots → HTML shell: supports · Defines crawler behavior for the public site