# heisenberg-xx/fring architecture

> Architecture diagram of the GitHub repository heisenberg-xx/fring, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/heisenberg-xx/fring
- Repository: https://github.com/heisenberg-xx/fring

## Overview

Fring is a Next.js architecture CLI: users create a scaffolded project, add the Fring Table package, generate module folders, or check their environment. The main creation workflow gathers options and runs project setup; a separate table workflow validates the target, prepares Shadcn UI when needed, installs TanStack Table, and copies templates. The graph preserves those distinct capabilities and the generated auth, provider, API-client, and starter-page layers. Some command implementations and generated template contents were not sampled, so uncertain command-to-service wiring is omitted.

Main entry points: [`src/services/project-creator.ts`](https://github.com/heisenberg-xx/fring/blob/main/src/services/project-creator.ts) (Project creator), [`src/index.ts`](https://github.com/heisenberg-xx/fring/blob/main/src/index.ts) (Command router), [`src/services/table.ts`](https://github.com/heisenberg-xx/fring/blob/main/src/services/table.ts) (Table setup), [`src/generators/table/table-generator.ts`](https://github.com/heisenberg-xx/fring/blob/main/src/generators/table/table-generator.ts) (Table generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_cli["Command router<br/>[index.ts]"]
  node_new_command["New command<br/>[new.ts]"]
  node_add_command["Add command<br/>[add.ts]"]
  node_generate_command["Generate command<br/>[generate.ts]"]
  node_doctor_command["Doctor command<br/>[doctor.ts]"]
end

subgraph group_creation["Project creation"]
  node_project_prompt["Project options<br/>[new-project.ts]"]
  node_project_creator["Project creator<br/>[project-creator.ts]"]
  node_next_app["Next.js scaffolder"]
  node_project_generators["Project templates"]
  node_auth_templates["Auth templates"]
  node_starter_pages["Starter pages"]
  node_providers["Query providers"]
  node_api_client["Axios client"]
  node_env_config["Environment config"]
end

subgraph group_extensions["Project extensions"]
  node_module_generator["Module generator"]
  node_table_service["Table setup<br/>[table.ts]"]
  node_table_generator["Table generator<br/>[table-generator.ts]"]
  node_shadcn_setup["Shadcn setup"]
  node_shadcn_components["Shadcn components"]
  node_package_manager["Package manager<br/>[package-manager.ts]"]
  node_next_project["Next.js check<br/>[is-next-project.ts]"]
  node_table_templates["Table templates"]
end

subgraph group_support["Environment support"]
  node_doctor["Environment check<br/>[doctor.ts]"]
end

node_developer(("Developer"))
node_git["Git executable"]

node_developer -->|"runs commands"| node_cli
node_cli -->|"dispatches new"| node_new_command
node_cli -->|"dispatches add"| node_add_command
node_cli -->|"dispatches generate"| node_generate_command
node_cli -->|"dispatches doctor"| node_doctor_command
node_new_command -->|"gathers options"| node_project_prompt
node_project_creator -->|"creates app"| node_next_app
node_project_creator -->|"runs setup"| node_project_generators
node_project_creator -->|"generates auth"| node_auth_templates
node_project_creator -->|"generates pages"| node_starter_pages
node_project_creator -->|"generates providers"| node_providers
node_project_creator -->|"generates client"| node_api_client
node_project_creator -->|"generates config"| node_env_config
node_project_creator -->|"selects commands"| node_package_manager
node_table_service -->|"checks project"| node_next_project
node_table_service -->|"initializes UI"| node_shadcn_setup
node_table_service -->|"adds components"| node_shadcn_components
node_table_service -->|"runs generation"| node_table_generator
node_table_generator -->|"selects commands"| node_package_manager
node_table_generator -->|"copies templates"| node_table_templates
node_doctor -->|"checks version"| node_git

click node_cli "https://github.com/heisenberg-xx/fring/blob/main/src/index.ts"
click node_new_command "https://github.com/heisenberg-xx/fring/blob/main/src/commands/new.ts"
click node_add_command "https://github.com/heisenberg-xx/fring/blob/main/src/commands/add.ts"
click node_generate_command "https://github.com/heisenberg-xx/fring/blob/main/src/commands/generate.ts"
click node_doctor_command "https://github.com/heisenberg-xx/fring/blob/main/src/commands/doctor.ts"
click node_project_prompt "https://github.com/heisenberg-xx/fring/blob/main/src/prompts/new-project.ts"
click node_project_creator "https://github.com/heisenberg-xx/fring/blob/main/src/services/project-creator.ts"
click node_project_generators "https://github.com/heisenberg-xx/fring/tree/main/src/generators/project-creation"
click node_auth_templates "https://github.com/heisenberg-xx/fring/blob/main/src/generators/project-creation/auth-template-generator.ts"
click node_starter_pages "https://github.com/heisenberg-xx/fring/blob/main/src/generators/project-creation/start-page-generator.ts"
click node_providers "https://github.com/heisenberg-xx/fring/blob/main/src/generators/project-creation/tanstack-providers-generator.ts"
click node_api_client "https://github.com/heisenberg-xx/fring/blob/main/src/generators/project-creation/axios-instance-generator.ts"
click node_env_config "https://github.com/heisenberg-xx/fring/blob/main/src/generators/project-creation/env-template-generator.ts"
click node_module_generator "https://github.com/heisenberg-xx/fring/blob/main/src/generators/module-generate/module-generator.ts"
click node_table_service "https://github.com/heisenberg-xx/fring/blob/main/src/services/table.ts"
click node_table_generator "https://github.com/heisenberg-xx/fring/blob/main/src/generators/table/table-generator.ts"
click node_shadcn_setup "https://github.com/heisenberg-xx/fring/blob/main/src/utils/initialize-shadcn.ts"
click node_shadcn_components "https://github.com/heisenberg-xx/fring/blob/main/src/utils/add-shadcn-components.ts"
click node_package_manager "https://github.com/heisenberg-xx/fring/blob/main/src/utils/package-manager.ts"
click node_next_project "https://github.com/heisenberg-xx/fring/blob/main/src/utils/is-next-project.ts"
click node_table_templates "https://github.com/heisenberg-xx/fring/tree/main/templates/add/table"
click node_doctor "https://github.com/heisenberg-xx/fring/blob/main/src/commands/doctor.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_new_command,node_add_command,node_generate_command,node_doctor_command toneBlue
class node_project_prompt,node_project_creator,node_next_app,node_project_generators,node_auth_templates,node_starter_pages,node_providers,node_api_client,node_env_config toneAmber
class node_module_generator,node_table_service,node_table_generator,node_shadcn_setup,node_shadcn_components,node_package_manager,node_next_project,node_table_templates toneMint
class node_doctor toneRose
class node_developer,node_git toneIndigo
```

## Components

### CLI entry

- [Command router](https://github.com/heisenberg-xx/fring/blob/main/src/index.ts): `src/index.ts`
- [New command](https://github.com/heisenberg-xx/fring/blob/main/src/commands/new.ts): `src/commands/new.ts`
- [Add command](https://github.com/heisenberg-xx/fring/blob/main/src/commands/add.ts): `src/commands/add.ts`
- [Generate command](https://github.com/heisenberg-xx/fring/blob/main/src/commands/generate.ts): `src/commands/generate.ts`
- [Doctor command](https://github.com/heisenberg-xx/fring/blob/main/src/commands/doctor.ts): `src/commands/doctor.ts`

### Project creation

- [Project options](https://github.com/heisenberg-xx/fring/blob/main/src/prompts/new-project.ts): `src/prompts/new-project.ts`
- [Project creator](https://github.com/heisenberg-xx/fring/blob/main/src/services/project-creator.ts): `src/services/project-creator.ts`
- **Next.js scaffolder**
- [Project templates](https://github.com/heisenberg-xx/fring/tree/main/src/generators/project-creation): `src/generators/project-creation`
- [Auth templates](https://github.com/heisenberg-xx/fring/blob/main/src/generators/project-creation/auth-template-generator.ts): `src/generators/project-creation/auth-template-generator.ts`
- [Starter pages](https://github.com/heisenberg-xx/fring/blob/main/src/generators/project-creation/start-page-generator.ts): `src/generators/project-creation/start-page-generator.ts`
- [Query providers](https://github.com/heisenberg-xx/fring/blob/main/src/generators/project-creation/tanstack-providers-generator.ts): `src/generators/project-creation/tanstack-providers-generator.ts`
- [Axios client](https://github.com/heisenberg-xx/fring/blob/main/src/generators/project-creation/axios-instance-generator.ts): `src/generators/project-creation/axios-instance-generator.ts`
- [Environment config](https://github.com/heisenberg-xx/fring/blob/main/src/generators/project-creation/env-template-generator.ts): `src/generators/project-creation/env-template-generator.ts`

### Project extensions

- [Module generator](https://github.com/heisenberg-xx/fring/blob/main/src/generators/module-generate/module-generator.ts): `src/generators/module-generate/module-generator.ts`
- [Table setup](https://github.com/heisenberg-xx/fring/blob/main/src/services/table.ts): `src/services/table.ts`
- [Table generator](https://github.com/heisenberg-xx/fring/blob/main/src/generators/table/table-generator.ts): `src/generators/table/table-generator.ts`
- [Shadcn setup](https://github.com/heisenberg-xx/fring/blob/main/src/utils/initialize-shadcn.ts): `src/utils/initialize-shadcn.ts`
- [Shadcn components](https://github.com/heisenberg-xx/fring/blob/main/src/utils/add-shadcn-components.ts): `src/utils/add-shadcn-components.ts`
- [Package manager](https://github.com/heisenberg-xx/fring/blob/main/src/utils/package-manager.ts): `src/utils/package-manager.ts`
- [Next.js check](https://github.com/heisenberg-xx/fring/blob/main/src/utils/is-next-project.ts): `src/utils/is-next-project.ts`
- [Table templates](https://github.com/heisenberg-xx/fring/tree/main/templates/add/table): `templates/add/table`

### Environment support

- [Environment check](https://github.com/heisenberg-xx/fring/blob/main/src/commands/doctor.ts): `src/commands/doctor.ts`

### Other components

- **Developer**
- **Git executable**

## Connections

- Developer → Command router: runs commands
- Command router → New command: dispatches new
- Command router → Add command: dispatches add
- Command router → Generate command: dispatches generate
- Command router → Doctor command: dispatches doctor
- New command → Project options: gathers options
- Project creator → Next.js scaffolder: creates app
- Project creator → Project templates: runs setup
- Project creator → Auth templates: generates auth
- Project creator → Starter pages: generates pages
- Project creator → Query providers: generates providers
- Project creator → Axios client: generates client
- Project creator → Environment config: generates config
- Project creator → Package manager: selects commands
- Table setup → Next.js check: checks project
- Table setup → Shadcn setup: initializes UI
- Table setup → Shadcn components: adds components
- Table setup → Table generator: runs generation
- Table generator → Package manager: selects commands
- Table generator → Table templates: copies templates
- Environment check → Git executable: checks version
