@flipova/foundation 1.8.0
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.
- package/CHANGELOG.md +107 -0
- package/LICENSE +21 -0
- package/README.md +268 -0
- package/dist/config/index.d.mts +128 -0
- package/dist/config/index.d.ts +128 -0
- package/dist/config/index.js +1104 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/index.mjs +1098 -0
- package/dist/config/index.mjs.map +1 -0
- package/dist/index-D4qJw_Et.d.mts +55 -0
- package/dist/index-D4qJw_Et.d.ts +55 -0
- package/dist/index.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9563 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +9381 -0
- package/dist/index.mjs.map +1 -0
- package/dist/layout/index.d.mts +2340 -0
- package/dist/layout/index.d.ts +2340 -0
- package/dist/layout/index.js +9275 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/index.mjs +9124 -0
- package/dist/layout/index.mjs.map +1 -0
- package/dist/primitives-DVX2q5St.d.mts +195 -0
- package/dist/primitives-nj-4at-g.d.ts +195 -0
- package/dist/spacing-CXUulLF9.d.mts +128 -0
- package/dist/spacing-CXUulLF9.d.ts +128 -0
- package/dist/studio/cli/index.d.mts +1 -0
- package/dist/studio/cli/index.d.ts +1 -0
- package/dist/studio/cli/index.js +4823 -0
- package/dist/studio/cli/index.js.map +1 -0
- package/dist/studio/cli/index.mjs +4798 -0
- package/dist/studio/cli/index.mjs.map +1 -0
- package/dist/studio/index.d.mts +441 -0
- package/dist/studio/index.d.ts +441 -0
- package/dist/studio/index.js +4919 -0
- package/dist/studio/index.js.map +1 -0
- package/dist/studio/index.mjs +4876 -0
- package/dist/studio/index.mjs.map +1 -0
- package/dist/theme/index.d.mts +122 -0
- package/dist/theme/index.d.ts +122 -0
- package/dist/theme/index.js +840 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/index.mjs +826 -0
- package/dist/theme/index.mjs.map +1 -0
- package/dist/tokens/index.d.mts +288 -0
- package/dist/tokens/index.d.ts +288 -0
- package/dist/tokens/index.js +404 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/tokens/index.mjs +390 -0
- package/dist/tokens/index.mjs.map +1 -0
- package/dist/web/index.d.mts +778 -0
- package/dist/web/index.d.ts +778 -0
- package/dist/web/index.js +5813 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/index.mjs +5708 -0
- package/dist/web/index.mjs.map +1 -0
- package/package.json +196 -0
- package/studio/README.md +154 -0
- package/studio/app/dist/_expo/static/js/web/entry-39d36897d2758a1d36b9ce16995ecc83.js +15379 -0
- package/studio/app/dist/_expo/static/js/web/index-f0c66517963047bf2c0bdd371afb8d31.js +4 -0
- package/studio/app/dist/_expo/static/js/web/index-fb59148d0b266219e66b19aeca8e2086.js +3 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/AntDesign.3f78af31cca60105799838a1a7a59fbd.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Entypo.31b5ffea3daddc69dd01a1f3d6cf63c5.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/EvilIcons.140c53a7643ea949007aa9a282153849.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Feather.ca4b48e04dc1ce10bfbddb262c8b835f.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome.b06871f281fee6b241d60582ae9369b9.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome5_Brands.3b89dd103490708d19a95adcae52210e.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome5_Regular.1f77739ca9ff2188b539c36f30ffa2be.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome5_Solid.605ed7926cf39a2ad5ec2d1f9d391d3d.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome6_Brands.56c8d80832e37783f12c05db7c8849e2.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome6_Regular.370dd5af19f8364907b6e2c41f45dbbf.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome6_Solid.adec7d6f310bc577f05e8fe06a5daccf.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Fontisto.b49ae8ab2dbccb02c4d11caaacf09eab.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Foundation.e20945d7c929279ef7a6f1db184a4470.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Ionicons.b4eb097d35f44ed943676fd56f6bdc51.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/MaterialCommunityIcons.6e435534bd35da5fef04168860a9b8fa.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/MaterialIcons.4e85bc9ebe07e0340c9c4fc2f6c38908.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Octicons.871378c6eab492a3e689a9385dc45a12.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/SimpleLineIcons.d2285965fe34b05465047401b8595dd0.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Zocial.1681f34aaca71b8dfb70756bca331eb2.ttf +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png +0 -0
- package/studio/app/dist/assets/__node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png +0 -0
- package/studio/app/dist/index.html +37 -0
- package/studio/app/dist/metadata.json +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@flipova/foundation",
|
|
3
|
+
"version": "1.8.0",
|
|
4
|
+
"description": "Design tokens, theming system, and layout primitives for React Native (iOS, Android, Web)",
|
|
5
|
+
"author": "Flipova",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/flipova/foundation.git"
|
|
10
|
+
},
|
|
11
|
+
"main": "dist/index.js",
|
|
12
|
+
"module": "dist/index.mjs",
|
|
13
|
+
"types": "dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.mjs",
|
|
18
|
+
"require": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./tokens": {
|
|
21
|
+
"types": "./dist/tokens/index.d.ts",
|
|
22
|
+
"import": "./dist/tokens/index.mjs",
|
|
23
|
+
"require": "./dist/tokens/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./theme": {
|
|
26
|
+
"types": "./dist/theme/index.d.ts",
|
|
27
|
+
"import": "./dist/theme/index.mjs",
|
|
28
|
+
"require": "./dist/theme/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./web": {
|
|
31
|
+
"types": "./dist/web/index.d.ts",
|
|
32
|
+
"import": "./dist/web/index.mjs",
|
|
33
|
+
"require": "./dist/web/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./layout": {
|
|
36
|
+
"types": "./dist/layout/index.d.ts",
|
|
37
|
+
"import": "./dist/layout/index.mjs",
|
|
38
|
+
"require": "./dist/layout/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./config": {
|
|
41
|
+
"types": "./dist/config/index.d.ts",
|
|
42
|
+
"import": "./dist/config/index.mjs",
|
|
43
|
+
"require": "./dist/config/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./studio": {
|
|
46
|
+
"types": "./dist/studio/index.d.ts",
|
|
47
|
+
"import": "./dist/studio/index.mjs",
|
|
48
|
+
"require": "./dist/studio/index.js"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public",
|
|
53
|
+
"registry": "https://registry.npmjs.org/"
|
|
54
|
+
},
|
|
55
|
+
"bin": {
|
|
56
|
+
"flipova-studio": "./dist/studio/cli/index.js"
|
|
57
|
+
},
|
|
58
|
+
"files": [
|
|
59
|
+
"dist",
|
|
60
|
+
"studio/app/dist",
|
|
61
|
+
"README.md",
|
|
62
|
+
"CHANGELOG.md",
|
|
63
|
+
"LICENSE"
|
|
64
|
+
],
|
|
65
|
+
"scripts": {
|
|
66
|
+
"build": "npm run build:studio && npm run build:foundation",
|
|
67
|
+
"build:foundation": "tsup",
|
|
68
|
+
"build:studio": "cd studio/app && npx expo export --platform web --output-dir dist",
|
|
69
|
+
"dev": "tsup --watch",
|
|
70
|
+
"dev:studio": "cd studio/app && npx expo start --web --port 4201",
|
|
71
|
+
"typecheck": "tsc --noEmit",
|
|
72
|
+
"release": "npm run build && npm run typecheck && changeset publish",
|
|
73
|
+
"version": "changeset version",
|
|
74
|
+
"prepublishOnly": "npm run build && npm run typecheck"
|
|
75
|
+
},
|
|
76
|
+
"peerDependencies": {
|
|
77
|
+
"expo": ">=55.0.0",
|
|
78
|
+
"expo-camera": ">=15.0.0",
|
|
79
|
+
"expo-haptics": ">=13.0.0",
|
|
80
|
+
"expo-linear-gradient": ">=12.0.0",
|
|
81
|
+
"expo-navigation-bar": ">=3.0.0",
|
|
82
|
+
"expo-router": ">=55.0.0",
|
|
83
|
+
"expo-status-bar": ">=2.0.0",
|
|
84
|
+
"lucide-react-native": ">=0.300.0",
|
|
85
|
+
"react": ">=18.0.0",
|
|
86
|
+
"react-dom": ">=18.0.0",
|
|
87
|
+
"react-native": ">=0.73.0",
|
|
88
|
+
"react-native-gesture-handler": ">=2.0.0",
|
|
89
|
+
"react-native-reanimated": ">=3.0.0",
|
|
90
|
+
"react-native-safe-area-context": ">=4.0.0",
|
|
91
|
+
"react-native-screens": ">=4.0.0"
|
|
92
|
+
},
|
|
93
|
+
"peerDependenciesMeta": {
|
|
94
|
+
"expo": {
|
|
95
|
+
"optional": true
|
|
96
|
+
},
|
|
97
|
+
"expo-linear-gradient": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
100
|
+
"expo-haptics": {
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
103
|
+
"expo-status-bar": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"expo-navigation-bar": {
|
|
107
|
+
"optional": true
|
|
108
|
+
},
|
|
109
|
+
"expo-router": {
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
112
|
+
"expo-camera": {
|
|
113
|
+
"optional": true
|
|
114
|
+
},
|
|
115
|
+
"react-native": {
|
|
116
|
+
"optional": true
|
|
117
|
+
},
|
|
118
|
+
"react-native-gesture-handler": {
|
|
119
|
+
"optional": true
|
|
120
|
+
},
|
|
121
|
+
"react-native-reanimated": {
|
|
122
|
+
"optional": true
|
|
123
|
+
},
|
|
124
|
+
"react-native-safe-area-context": {
|
|
125
|
+
"optional": true
|
|
126
|
+
},
|
|
127
|
+
"react-native-screens": {
|
|
128
|
+
"optional": true
|
|
129
|
+
},
|
|
130
|
+
"lucide-react-native": {
|
|
131
|
+
"optional": true
|
|
132
|
+
},
|
|
133
|
+
"react-dom": {
|
|
134
|
+
"optional": true
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"devDependencies": {
|
|
138
|
+
"@changesets/changelog-github": "^0.6.0",
|
|
139
|
+
"@changesets/cli": "^2.30.0",
|
|
140
|
+
"@craftzdog/react-native-buffer": "^6.1.2",
|
|
141
|
+
"@expo/metro-runtime": "^56.0.15",
|
|
142
|
+
"@expo/vector-icons": "^15.1.1",
|
|
143
|
+
"@react-native-async-storage/async-storage": "^3.1.1",
|
|
144
|
+
"@types/express": "^5.0.6",
|
|
145
|
+
"@types/qrcode": "^1.5.5",
|
|
146
|
+
"@types/react": "^19.0.0",
|
|
147
|
+
"@types/react-native": "^0.73.0",
|
|
148
|
+
"@types/ws": "^8.18.1",
|
|
149
|
+
"expo": "^56.0.11",
|
|
150
|
+
"expo-camera": "^55.0.13",
|
|
151
|
+
"expo-haptics": "^55.0.11",
|
|
152
|
+
"expo-linear-gradient": "^12.0.0",
|
|
153
|
+
"expo-navigation-bar": "^55.0.10",
|
|
154
|
+
"expo-router": "^56.2.10",
|
|
155
|
+
"expo-status-bar": "^55.0.5",
|
|
156
|
+
"fast-check": "^4.6.0",
|
|
157
|
+
"lucide-react-native": "^1.7.0",
|
|
158
|
+
"react-dom": "^19.2.7",
|
|
159
|
+
"react-native": "^0.86.0",
|
|
160
|
+
"react-native-gesture-handler": "^2.0.0",
|
|
161
|
+
"react-native-reanimated": "^3.0.0",
|
|
162
|
+
"react-native-safe-area-context": "^5.8.0",
|
|
163
|
+
"react-native-screens": "^4.25.2",
|
|
164
|
+
"react-native-web": "^0.21.2",
|
|
165
|
+
"readable-stream": "^4.7.0",
|
|
166
|
+
"snack-sdk": "^6.6.2",
|
|
167
|
+
"tsup": "^8.5.0",
|
|
168
|
+
"typescript": "^5.3.0",
|
|
169
|
+
"vitest": "^4.1.2"
|
|
170
|
+
},
|
|
171
|
+
"keywords": [
|
|
172
|
+
"react-native",
|
|
173
|
+
"design-system",
|
|
174
|
+
"design-tokens",
|
|
175
|
+
"theming",
|
|
176
|
+
"layout",
|
|
177
|
+
"ui",
|
|
178
|
+
"flipova",
|
|
179
|
+
"expo"
|
|
180
|
+
],
|
|
181
|
+
"dependencies": {
|
|
182
|
+
"@radix-ui/react-accordion": "^1.2.0",
|
|
183
|
+
"@radix-ui/react-dropdown-menu": "^2.1.17",
|
|
184
|
+
"@radix-ui/react-slot": "^1.2.5",
|
|
185
|
+
"@radix-ui/react-tabs": "^1.1.14",
|
|
186
|
+
"class-variance-authority": "^0.7.1",
|
|
187
|
+
"clsx": "^2.1.1",
|
|
188
|
+
"express": "^5.2.1",
|
|
189
|
+
"lucide-react": "^1.18.0",
|
|
190
|
+
"motion": "^12.40.0",
|
|
191
|
+
"qrcode": "^1.5.4",
|
|
192
|
+
"react": ">=18.0.0",
|
|
193
|
+
"tailwind-merge": "^3.6.0",
|
|
194
|
+
"ws": "^8.20.0"
|
|
195
|
+
}
|
|
196
|
+
}
|
package/studio/README.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Flipova Studio
|
|
2
|
+
|
|
3
|
+
Visual app builder for React Native. Drag & drop layouts, components, and blocks from the foundation registry. Configure props visually. Generate clean React Native code.
|
|
4
|
+
|
|
5
|
+
## Quick start
|
|
6
|
+
|
|
7
|
+
### Using npm (Recommended for development)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx flipova-studio
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This single command:
|
|
14
|
+
1. Builds the web UI if not already built
|
|
15
|
+
2. Starts the Express server on port 4200
|
|
16
|
+
3. Opens the builder at http://localhost:4200
|
|
17
|
+
|
|
18
|
+
### Using Docker (Recommended for production)
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
docker-compose up -d
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This will:
|
|
25
|
+
- Build the Docker image with Foundation and Studio
|
|
26
|
+
- Start the Studio server on port 4200
|
|
27
|
+
- Persist project data in a Docker volume
|
|
28
|
+
- Mount generated code to a volume for easy access
|
|
29
|
+
|
|
30
|
+
Access the Studio at http://localhost:4200
|
|
31
|
+
|
|
32
|
+
See the main [README.md](../README.md) for detailed Docker setup instructions.
|
|
33
|
+
|
|
34
|
+
## Commands
|
|
35
|
+
|
|
36
|
+
| Command | Description |
|
|
37
|
+
|---------|-------------|
|
|
38
|
+
| `npx flipova-studio` | Start the builder (auto-builds UI if needed) |
|
|
39
|
+
| `npx flipova-studio --port 3000` | Start on a custom port |
|
|
40
|
+
| `npx flipova-studio --dev` | Dev mode: API on 4200 + Vite HMR on 5173 |
|
|
41
|
+
| `npx flipova-studio generate` | Generate code from the saved project |
|
|
42
|
+
|
|
43
|
+
## Development
|
|
44
|
+
|
|
45
|
+
For working on the studio UI itself:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx flipova-studio --dev
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
This starts:
|
|
52
|
+
- Express API server on http://localhost:4200
|
|
53
|
+
- Vite dev server on http://localhost:5173 (with hot reload and API proxy)
|
|
54
|
+
|
|
55
|
+
Open http://localhost:5173 for the dev experience with instant updates.
|
|
56
|
+
|
|
57
|
+
## Architecture
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
┌─────────────────────────────────────────────────┐
|
|
61
|
+
│ React Web UI (Vite + React + TypeScript) │
|
|
62
|
+
│ studio/web/src/ │
|
|
63
|
+
│ Built to studio/web/dist/ → served by Express │
|
|
64
|
+
└──────────────────────┬──────────────────────────┘
|
|
65
|
+
│ fetch /api/* + WebSocket /ws
|
|
66
|
+
┌──────────────────────▼──────────────────────────┐
|
|
67
|
+
│ Express Server (studio/server/) │
|
|
68
|
+
│ ├── /api/registry → foundation registries │
|
|
69
|
+
│ ├── /api/project → project CRUD │
|
|
70
|
+
│ ├── /api/pages/:id → page tree CRUD │
|
|
71
|
+
│ └── /api/generate → code generation │
|
|
72
|
+
└──────────────────────┬──────────────────────────┘
|
|
73
|
+
│
|
|
74
|
+
┌──────────────────────▼──────────────────────────┐
|
|
75
|
+
│ .flipova-studio/project.json │
|
|
76
|
+
└──────────────────────┬──────────────────────────┘
|
|
77
|
+
│ generate
|
|
78
|
+
┌──────────────────────▼──────────────────────────┐
|
|
79
|
+
│ ./generated/ │
|
|
80
|
+
│ ├── App.tsx │
|
|
81
|
+
│ ├── screens/*.tsx │
|
|
82
|
+
│ ├── navigation/index.tsx │
|
|
83
|
+
│ ├── theme/index.ts │
|
|
84
|
+
│ └── services/*.ts │
|
|
85
|
+
└─────────────────────────────────────────────────┘
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## REST API
|
|
89
|
+
|
|
90
|
+
### Registry (read-only)
|
|
91
|
+
|
|
92
|
+
| Method | Endpoint | Description |
|
|
93
|
+
|--------|----------|-------------|
|
|
94
|
+
| GET | `/api/registry` | All registries (layouts, components, blocks) |
|
|
95
|
+
| GET | `/api/registry/layouts` | Layout registry only |
|
|
96
|
+
| GET | `/api/registry/components` | Component registry only |
|
|
97
|
+
| GET | `/api/registry/blocks` | Block registry only |
|
|
98
|
+
|
|
99
|
+
### Project
|
|
100
|
+
|
|
101
|
+
| Method | Endpoint | Description |
|
|
102
|
+
|--------|----------|-------------|
|
|
103
|
+
| GET | `/api/project` | Load the current project |
|
|
104
|
+
| PUT | `/api/project` | Save the entire project |
|
|
105
|
+
| PUT | `/api/project/theme` | Change the active theme |
|
|
106
|
+
| PUT | `/api/project/navigation` | Update navigation config |
|
|
107
|
+
| POST | `/api/project/services` | Add a service |
|
|
108
|
+
|
|
109
|
+
### Pages
|
|
110
|
+
|
|
111
|
+
| Method | Endpoint | Description |
|
|
112
|
+
|--------|----------|-------------|
|
|
113
|
+
| POST | `/api/pages` | Create a new page |
|
|
114
|
+
| PUT | `/api/pages/:id` | Update a page (tree, name, route) |
|
|
115
|
+
| DELETE | `/api/pages/:id` | Delete a page |
|
|
116
|
+
|
|
117
|
+
### Code generation
|
|
118
|
+
|
|
119
|
+
| Method | Endpoint | Description |
|
|
120
|
+
|--------|----------|-------------|
|
|
121
|
+
| POST | `/api/generate` | Generate full project to `./generated/` |
|
|
122
|
+
| POST | `/api/generate/preview/:pageId` | Preview generated code for one page |
|
|
123
|
+
|
|
124
|
+
## WebSocket
|
|
125
|
+
|
|
126
|
+
Connect to `ws://localhost:4200/ws` for live updates.
|
|
127
|
+
|
|
128
|
+
| Event | Payload | When |
|
|
129
|
+
|-------|---------|------|
|
|
130
|
+
| `page:created` | PageDocument | New page created |
|
|
131
|
+
| `page:updated` | PageDocument | Page tree modified |
|
|
132
|
+
| `page:deleted` | `{ id }` | Page removed |
|
|
133
|
+
| `theme:changed` | `{ theme }` | Theme switched |
|
|
134
|
+
|
|
135
|
+
## Project structure
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
studio/
|
|
139
|
+
├── cli/index.ts CLI entry point (npx flipova-studio)
|
|
140
|
+
├── server/
|
|
141
|
+
│ ├── index.ts Express + WebSocket server
|
|
142
|
+
│ └── api.ts REST API routes (imports foundation registries)
|
|
143
|
+
├── engine/
|
|
144
|
+
│ ├── tree/
|
|
145
|
+
│ │ ├── types.ts TreeNode, PageDocument, ProjectDocument
|
|
146
|
+
│ │ └── operations.ts Immutable tree operations
|
|
147
|
+
│ └── codegen/
|
|
148
|
+
│ ├── generator.ts Page → .tsx code
|
|
149
|
+
│ └── project.ts Project → full app scaffold
|
|
150
|
+
└── web/ React app (Vite + TypeScript)
|
|
151
|
+
├── src/ React components
|
|
152
|
+
├── dist/ Built statics (served by Express)
|
|
153
|
+
└── package.json Separate deps (react, react-dom, vite)
|
|
154
|
+
```
|