frontone 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,262 @@
1
+ Metadata-Version: 2.4
2
+ Name: frontone
3
+ Version: 0.1.0
4
+ Summary: MCP server that analyzes a backend GitHub repo and scaffolds a Next.js frontend.
5
+ Requires-Python: >=3.11
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: aja-codeintel>=0.1.0
8
+ Requires-Dist: mcp[cli]>=1.0.0
9
+ Requires-Dist: gitpython>=3.1.0
10
+
11
+ # frontone
12
+
13
+ MCP server that clones a backend GitHub repo, analyzes it using `aja-codeintel`,
14
+ and scaffolds a complete **React + Vite** frontend with domain-aware design system.
15
+
16
+ Works with any MCP client: Claude Code, Cursor, GitHub Copilot (VS Code), Windsurf.
17
+ No API key required.
18
+
19
+ ---
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ pip install frontone
25
+ ```
26
+
27
+ ---
28
+
29
+ ## Setup by client
30
+
31
+ ### Claude Code
32
+
33
+ Add to `~/.claude/claude_desktop_config.json`:
34
+
35
+ ```json
36
+ {
37
+ "mcpServers": {
38
+ "frontone": {
39
+ "command": "frontone",
40
+ "env": {
41
+ "GITHUB_TOKEN": "ghp_yourtoken"
42
+ }
43
+ }
44
+ }
45
+ }
46
+ ```
47
+
48
+ Then in Claude Code chat:
49
+
50
+ ```
51
+ analyze_repo https://github.com/user/my-spring-app
52
+ ```
53
+
54
+ or to fully scaffold:
55
+
56
+ ```
57
+ scaffold_frontend https://github.com/user/my-spring-app
58
+ ```
59
+
60
+ ---
61
+
62
+ ### Cursor
63
+
64
+ Add to `.cursor/mcp.json`:
65
+
66
+ ```json
67
+ {
68
+ "mcpServers": {
69
+ "frontone": {
70
+ "command": "frontone",
71
+ "env": {
72
+ "GITHUB_TOKEN": "ghp_yourtoken"
73
+ }
74
+ }
75
+ }
76
+ }
77
+ ```
78
+
79
+ ---
80
+
81
+ ### GitHub Copilot (VS Code)
82
+
83
+ Add to `.vscode/mcp.json`:
84
+
85
+ ```json
86
+ {
87
+ "servers": {
88
+ "frontone": {
89
+ "command": "frontone",
90
+ "env": {
91
+ "GITHUB_TOKEN": "ghp_yourtoken"
92
+ }
93
+ }
94
+ }
95
+ }
96
+ ```
97
+
98
+ ---
99
+
100
+ ## Tools exposed
101
+
102
+ ### `analyze_repo(repo_url)`
103
+
104
+ Clones the repo and returns a complete structured JSON overview with everything
105
+ the AI needs to build a working frontend:
106
+
107
+ | Field | What it contains |
108
+ |---|---|
109
+ | `models` | Entity classes with all field names and types |
110
+ | `relationships` | ManyToOne / OneToMany / ManyToMany edges |
111
+ | `dtos` | Request / response / shared DTOs with fields |
112
+ | `endpoints` | All routes with method, path, access (PUBLIC / AUTH / ADMIN) |
113
+ | `swagger` | Live OpenAPI spec if app is running, otherwise runtime URL |
114
+ | `auth` | JWT / OAuth2 / Session detection + how to send tokens |
115
+ | `base_path` | Global API prefix (e.g. `/api`) + ready-to-use axios baseURL |
116
+ | `pagination` | Spring Data Page response shape + which endpoints are paginated |
117
+ | `validation` | `@NotNull` / `@Size` / `@Email` etc. per field — used to build Zod schemas |
118
+ | `enums` | All enum types and their values — rendered as dropdowns |
119
+
120
+ ---
121
+
122
+ ### `scaffold_frontend(repo_url)`
123
+
124
+ Does everything `analyze_repo` does, then auto-detects the domain and writes
125
+ a complete React + Vite project to `C:/<repo-name>-frontend/`.
126
+
127
+ **Domain detection** — picks design system automatically:
128
+
129
+ | Domain | Detected from models | Design |
130
+ |---|---|---|
131
+ | `finance` | BankAccount, Transaction, Balance, Operation | Dark · emerald accent · monospace amounts |
132
+ | `healthcare` | Patient, Doctor, Appointment, Pet, Vet, Visit | Light · sky accent · rounded cards |
133
+ | `ecommerce` | Product, Order, Cart, Inventory, Category | Dark · orange accent · status badges |
134
+ | `social` | Post, Comment, Like, Follow, Feed | Dark · purple accent · engagement rows |
135
+ | `admin` | anything else | Light · indigo accent · compact tables |
136
+
137
+ **Generated file structure:**
138
+
139
+ ```
140
+ C:/<repo-name>-frontend/
141
+ ├── index.html
142
+ ├── package.json
143
+ ├── tsconfig.json
144
+ ├── vite.config.ts
145
+ ├── tailwind.config.ts
146
+ ├── .env.example
147
+ └── src/
148
+ ├── main.tsx
149
+ ├── App.tsx
150
+ ├── types/
151
+ │ └── index.ts (all models, DTOs, enums, PageResponse<T>)
152
+ ├── lib/
153
+ │ ├── axios.ts (baseURL + JWT interceptor + 401 redirect)
154
+ │ ├── queryClient.ts
155
+ │ └── utils.ts
156
+ ├── api/
157
+ │ ├── auth.ts (login, register, logout)
158
+ │ └── <entity>.ts (getAll, getById, create, update, remove)
159
+ ├── store/
160
+ │ └── authStore.ts (Zustand, token persisted to localStorage)
161
+ ├── components/
162
+ │ ├── layout/
163
+ │ │ ├── Sidebar.tsx (working nav links, active state, mobile drawer)
164
+ │ │ ├── Topbar.tsx (user info, logout button)
165
+ │ │ ├── Layout.tsx
166
+ │ │ └── AuthGuard.tsx (redirects to /login if no token)
167
+ │ ├── ui/
168
+ │ │ ├── Button.tsx
169
+ │ │ ├── Input.tsx
170
+ │ │ ├── Badge.tsx
171
+ │ │ ├── Modal.tsx
172
+ │ │ ├── DataTable.tsx
173
+ │ │ ├── Pagination.tsx (only on paginated endpoints)
174
+ │ │ ├── StatCard.tsx
175
+ │ │ ├── EmptyState.tsx
176
+ │ │ ├── Skeleton.tsx
177
+ │ │ ├── ConfirmDialog.tsx
178
+ │ │ ├── SearchInput.tsx
179
+ │ │ └── Select.tsx
180
+ │ ├── <Entity>Columns.tsx (column definitions per entity)
181
+ │ └── charts/
182
+ │ └── <Entity>Chart.tsx (Recharts, only for entities with numeric fields)
183
+ ├── pages/
184
+ │ ├── Register.tsx (only if /register endpoint exists)
185
+ │ ├── Login.tsx
186
+ │ ├── Dashboard.tsx (stat cards + charts + recent items)
187
+ │ ├── <Entity>List.tsx (search, sort, pagination, delete confirm)
188
+ │ ├── <Entity>Detail.tsx
189
+ │ ├── <Entity>Form.tsx (create + edit, Zod validation, enum dropdowns)
190
+ │ └── admin/
191
+ │ ├── UserList.tsx (only if /admin/ endpoints exist)
192
+ │ └── UserForm.tsx
193
+ └── routes/
194
+ └── index.tsx (all routes, protected by AuthGuard)
195
+ ```
196
+
197
+ **After scaffolding:**
198
+
199
+ ```bash
200
+ cd C:/<repo-name>-frontend
201
+ npm install
202
+ npm run dev
203
+ ```
204
+
205
+ ---
206
+
207
+ ## What the generated frontend does
208
+
209
+ - **Auth flow in correct order** — Register (if endpoint exists) → Login → protected routes
210
+ - **Every API call is typed** — uses exact paths from the backend, never guessed
211
+ - **Pagination** — only on endpoints that actually return `Page<T>`, with correct `?page=0&size=20` params
212
+ - **Forms with real validation** — Zod schemas built from `@NotNull`, `@Size`, `@Email`, `@Min`/`@Max` annotations
213
+ - **Enum dropdowns** — Select components populated with real enum values from the backend
214
+ - **Working sidebar** — every link points to a real route, active state via `useLocation()`
215
+ - **Charts on Dashboard** — Recharts AreaChart / BarChart using real entity data
216
+ - **Skeleton loading** — every async component has a loading state
217
+ - **Delete confirmation** — every delete action shows a ConfirmDialog before calling the API
218
+
219
+ ---
220
+
221
+ ## Private repos
222
+
223
+ Set `GITHUB_TOKEN` env variable. frontone injects it into the clone URL automatically.
224
+
225
+ ```bash
226
+ set GITHUB_TOKEN=ghp_yourtoken # Windows
227
+ export GITHUB_TOKEN=ghp_yourtoken # Mac/Linux
228
+ ```
229
+
230
+ ---
231
+
232
+ ## How it works
233
+
234
+ ```
235
+ You → MCP client (Claude / Cursor / Copilot)
236
+
237
+ frontone MCP server
238
+
239
+ git clone repo to C:/
240
+
241
+ aja-codeintel deep analysis
242
+ · models + fields
243
+ · relationships
244
+ · DTOs + fields
245
+ · endpoints + auth roles
246
+ · JWT / OAuth2 / Session detection
247
+ · API base path prefix
248
+ · Spring Data pagination detection
249
+ · @NotNull / @Size / @Email validation constraints
250
+ · enum types + values
251
+ · live Swagger / OpenAPI fetch
252
+
253
+ detect domain → pick design system
254
+
255
+ build ordered file manifest
256
+
257
+ generate all React + Vite files
258
+
259
+ write to C:/<repo-name>-frontend/
260
+
261
+ return summary JSON to MCP client
262
+ ```
@@ -0,0 +1,252 @@
1
+ # frontone
2
+
3
+ MCP server that clones a backend GitHub repo, analyzes it using `aja-codeintel`,
4
+ and scaffolds a complete **React + Vite** frontend with domain-aware design system.
5
+
6
+ Works with any MCP client: Claude Code, Cursor, GitHub Copilot (VS Code), Windsurf.
7
+ No API key required.
8
+
9
+ ---
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pip install frontone
15
+ ```
16
+
17
+ ---
18
+
19
+ ## Setup by client
20
+
21
+ ### Claude Code
22
+
23
+ Add to `~/.claude/claude_desktop_config.json`:
24
+
25
+ ```json
26
+ {
27
+ "mcpServers": {
28
+ "frontone": {
29
+ "command": "frontone",
30
+ "env": {
31
+ "GITHUB_TOKEN": "ghp_yourtoken"
32
+ }
33
+ }
34
+ }
35
+ }
36
+ ```
37
+
38
+ Then in Claude Code chat:
39
+
40
+ ```
41
+ analyze_repo https://github.com/user/my-spring-app
42
+ ```
43
+
44
+ or to fully scaffold:
45
+
46
+ ```
47
+ scaffold_frontend https://github.com/user/my-spring-app
48
+ ```
49
+
50
+ ---
51
+
52
+ ### Cursor
53
+
54
+ Add to `.cursor/mcp.json`:
55
+
56
+ ```json
57
+ {
58
+ "mcpServers": {
59
+ "frontone": {
60
+ "command": "frontone",
61
+ "env": {
62
+ "GITHUB_TOKEN": "ghp_yourtoken"
63
+ }
64
+ }
65
+ }
66
+ }
67
+ ```
68
+
69
+ ---
70
+
71
+ ### GitHub Copilot (VS Code)
72
+
73
+ Add to `.vscode/mcp.json`:
74
+
75
+ ```json
76
+ {
77
+ "servers": {
78
+ "frontone": {
79
+ "command": "frontone",
80
+ "env": {
81
+ "GITHUB_TOKEN": "ghp_yourtoken"
82
+ }
83
+ }
84
+ }
85
+ }
86
+ ```
87
+
88
+ ---
89
+
90
+ ## Tools exposed
91
+
92
+ ### `analyze_repo(repo_url)`
93
+
94
+ Clones the repo and returns a complete structured JSON overview with everything
95
+ the AI needs to build a working frontend:
96
+
97
+ | Field | What it contains |
98
+ |---|---|
99
+ | `models` | Entity classes with all field names and types |
100
+ | `relationships` | ManyToOne / OneToMany / ManyToMany edges |
101
+ | `dtos` | Request / response / shared DTOs with fields |
102
+ | `endpoints` | All routes with method, path, access (PUBLIC / AUTH / ADMIN) |
103
+ | `swagger` | Live OpenAPI spec if app is running, otherwise runtime URL |
104
+ | `auth` | JWT / OAuth2 / Session detection + how to send tokens |
105
+ | `base_path` | Global API prefix (e.g. `/api`) + ready-to-use axios baseURL |
106
+ | `pagination` | Spring Data Page response shape + which endpoints are paginated |
107
+ | `validation` | `@NotNull` / `@Size` / `@Email` etc. per field — used to build Zod schemas |
108
+ | `enums` | All enum types and their values — rendered as dropdowns |
109
+
110
+ ---
111
+
112
+ ### `scaffold_frontend(repo_url)`
113
+
114
+ Does everything `analyze_repo` does, then auto-detects the domain and writes
115
+ a complete React + Vite project to `C:/<repo-name>-frontend/`.
116
+
117
+ **Domain detection** — picks design system automatically:
118
+
119
+ | Domain | Detected from models | Design |
120
+ |---|---|---|
121
+ | `finance` | BankAccount, Transaction, Balance, Operation | Dark · emerald accent · monospace amounts |
122
+ | `healthcare` | Patient, Doctor, Appointment, Pet, Vet, Visit | Light · sky accent · rounded cards |
123
+ | `ecommerce` | Product, Order, Cart, Inventory, Category | Dark · orange accent · status badges |
124
+ | `social` | Post, Comment, Like, Follow, Feed | Dark · purple accent · engagement rows |
125
+ | `admin` | anything else | Light · indigo accent · compact tables |
126
+
127
+ **Generated file structure:**
128
+
129
+ ```
130
+ C:/<repo-name>-frontend/
131
+ ├── index.html
132
+ ├── package.json
133
+ ├── tsconfig.json
134
+ ├── vite.config.ts
135
+ ├── tailwind.config.ts
136
+ ├── .env.example
137
+ └── src/
138
+ ├── main.tsx
139
+ ├── App.tsx
140
+ ├── types/
141
+ │ └── index.ts (all models, DTOs, enums, PageResponse<T>)
142
+ ├── lib/
143
+ │ ├── axios.ts (baseURL + JWT interceptor + 401 redirect)
144
+ │ ├── queryClient.ts
145
+ │ └── utils.ts
146
+ ├── api/
147
+ │ ├── auth.ts (login, register, logout)
148
+ │ └── <entity>.ts (getAll, getById, create, update, remove)
149
+ ├── store/
150
+ │ └── authStore.ts (Zustand, token persisted to localStorage)
151
+ ├── components/
152
+ │ ├── layout/
153
+ │ │ ├── Sidebar.tsx (working nav links, active state, mobile drawer)
154
+ │ │ ├── Topbar.tsx (user info, logout button)
155
+ │ │ ├── Layout.tsx
156
+ │ │ └── AuthGuard.tsx (redirects to /login if no token)
157
+ │ ├── ui/
158
+ │ │ ├── Button.tsx
159
+ │ │ ├── Input.tsx
160
+ │ │ ├── Badge.tsx
161
+ │ │ ├── Modal.tsx
162
+ │ │ ├── DataTable.tsx
163
+ │ │ ├── Pagination.tsx (only on paginated endpoints)
164
+ │ │ ├── StatCard.tsx
165
+ │ │ ├── EmptyState.tsx
166
+ │ │ ├── Skeleton.tsx
167
+ │ │ ├── ConfirmDialog.tsx
168
+ │ │ ├── SearchInput.tsx
169
+ │ │ └── Select.tsx
170
+ │ ├── <Entity>Columns.tsx (column definitions per entity)
171
+ │ └── charts/
172
+ │ └── <Entity>Chart.tsx (Recharts, only for entities with numeric fields)
173
+ ├── pages/
174
+ │ ├── Register.tsx (only if /register endpoint exists)
175
+ │ ├── Login.tsx
176
+ │ ├── Dashboard.tsx (stat cards + charts + recent items)
177
+ │ ├── <Entity>List.tsx (search, sort, pagination, delete confirm)
178
+ │ ├── <Entity>Detail.tsx
179
+ │ ├── <Entity>Form.tsx (create + edit, Zod validation, enum dropdowns)
180
+ │ └── admin/
181
+ │ ├── UserList.tsx (only if /admin/ endpoints exist)
182
+ │ └── UserForm.tsx
183
+ └── routes/
184
+ └── index.tsx (all routes, protected by AuthGuard)
185
+ ```
186
+
187
+ **After scaffolding:**
188
+
189
+ ```bash
190
+ cd C:/<repo-name>-frontend
191
+ npm install
192
+ npm run dev
193
+ ```
194
+
195
+ ---
196
+
197
+ ## What the generated frontend does
198
+
199
+ - **Auth flow in correct order** — Register (if endpoint exists) → Login → protected routes
200
+ - **Every API call is typed** — uses exact paths from the backend, never guessed
201
+ - **Pagination** — only on endpoints that actually return `Page<T>`, with correct `?page=0&size=20` params
202
+ - **Forms with real validation** — Zod schemas built from `@NotNull`, `@Size`, `@Email`, `@Min`/`@Max` annotations
203
+ - **Enum dropdowns** — Select components populated with real enum values from the backend
204
+ - **Working sidebar** — every link points to a real route, active state via `useLocation()`
205
+ - **Charts on Dashboard** — Recharts AreaChart / BarChart using real entity data
206
+ - **Skeleton loading** — every async component has a loading state
207
+ - **Delete confirmation** — every delete action shows a ConfirmDialog before calling the API
208
+
209
+ ---
210
+
211
+ ## Private repos
212
+
213
+ Set `GITHUB_TOKEN` env variable. frontone injects it into the clone URL automatically.
214
+
215
+ ```bash
216
+ set GITHUB_TOKEN=ghp_yourtoken # Windows
217
+ export GITHUB_TOKEN=ghp_yourtoken # Mac/Linux
218
+ ```
219
+
220
+ ---
221
+
222
+ ## How it works
223
+
224
+ ```
225
+ You → MCP client (Claude / Cursor / Copilot)
226
+
227
+ frontone MCP server
228
+
229
+ git clone repo to C:/
230
+
231
+ aja-codeintel deep analysis
232
+ · models + fields
233
+ · relationships
234
+ · DTOs + fields
235
+ · endpoints + auth roles
236
+ · JWT / OAuth2 / Session detection
237
+ · API base path prefix
238
+ · Spring Data pagination detection
239
+ · @NotNull / @Size / @Email validation constraints
240
+ · enum types + values
241
+ · live Swagger / OpenAPI fetch
242
+
243
+ detect domain → pick design system
244
+
245
+ build ordered file manifest
246
+
247
+ generate all React + Vite files
248
+
249
+ write to C:/<repo-name>-frontend/
250
+
251
+ return summary JSON to MCP client
252
+ ```
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0"