create-autostack 1.0.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.
Files changed (96) hide show
  1. package/README.md +237 -0
  2. package/bin/index.js +675 -0
  3. package/lib/PackageManagerClass.js +185 -0
  4. package/package.json +55 -0
  5. package/templates/assets/fastapi.svg +1 -0
  6. package/templates/assets/flask.svg +1 -0
  7. package/templates/assets/mongodb.svg +1 -0
  8. package/templates/assets/mysql.svg +1 -0
  9. package/templates/assets/nodejs.svg +1 -0
  10. package/templates/assets/postgresql.svg +1 -0
  11. package/templates/backend/FASTAPI/MONGODB/.env +1 -0
  12. package/templates/backend/FASTAPI/MONGODB/config.py +26 -0
  13. package/templates/backend/FASTAPI/MONGODB/main.py +32 -0
  14. package/templates/backend/FASTAPI/MONGODB/models.py +56 -0
  15. package/templates/backend/FASTAPI/MONGODB/requirements.txt +6 -0
  16. package/templates/backend/FASTAPI/MONGODB/routes.py +189 -0
  17. package/templates/backend/FASTAPI/MONGODB/schemas.py +31 -0
  18. package/templates/backend/FASTAPI/MYSQL/.env +5 -0
  19. package/templates/backend/FASTAPI/MYSQL/config.py +29 -0
  20. package/templates/backend/FASTAPI/MYSQL/main.py +32 -0
  21. package/templates/backend/FASTAPI/MYSQL/models.py +31 -0
  22. package/templates/backend/FASTAPI/MYSQL/requirements.txt +6 -0
  23. package/templates/backend/FASTAPI/MYSQL/routes.py +180 -0
  24. package/templates/backend/FASTAPI/MYSQL/schemas.py +36 -0
  25. package/templates/backend/FASTAPI/POSTGRESQL/.env +5 -0
  26. package/templates/backend/FASTAPI/POSTGRESQL/config.py +29 -0
  27. package/templates/backend/FASTAPI/POSTGRESQL/main.py +32 -0
  28. package/templates/backend/FASTAPI/POSTGRESQL/models.py +31 -0
  29. package/templates/backend/FASTAPI/POSTGRESQL/requirements.txt +6 -0
  30. package/templates/backend/FASTAPI/POSTGRESQL/routes.py +180 -0
  31. package/templates/backend/FASTAPI/POSTGRESQL/schemas.py +36 -0
  32. package/templates/backend/FLASK/MONGODB/.env +6 -0
  33. package/templates/backend/FLASK/MONGODB/config.py +27 -0
  34. package/templates/backend/FLASK/MONGODB/main.py +5 -0
  35. package/templates/backend/FLASK/MONGODB/models.py +16 -0
  36. package/templates/backend/FLASK/MONGODB/requirements.txt +6 -0
  37. package/templates/backend/FLASK/MONGODB/routes.py +137 -0
  38. package/templates/backend/FLASK/MYSQL/.env +7 -0
  39. package/templates/backend/FLASK/MYSQL/config.py +24 -0
  40. package/templates/backend/FLASK/MYSQL/main.py +8 -0
  41. package/templates/backend/FLASK/MYSQL/models.py +26 -0
  42. package/templates/backend/FLASK/MYSQL/requirements.txt +6 -0
  43. package/templates/backend/FLASK/MYSQL/routes.py +135 -0
  44. package/templates/backend/FLASK/POSTGRESQL/.env +5 -0
  45. package/templates/backend/FLASK/POSTGRESQL/config.py +24 -0
  46. package/templates/backend/FLASK/POSTGRESQL/main.py +7 -0
  47. package/templates/backend/FLASK/POSTGRESQL/models.py +26 -0
  48. package/templates/backend/FLASK/POSTGRESQL/requirements.txt +6 -0
  49. package/templates/backend/FLASK/POSTGRESQL/routes.py +134 -0
  50. package/templates/backend/NODEJS/MONGODB/config/dbConn.js +11 -0
  51. package/templates/backend/NODEJS/MONGODB/controllers/noteController.js +79 -0
  52. package/templates/backend/NODEJS/MONGODB/controllers/userController.js +79 -0
  53. package/templates/backend/NODEJS/MONGODB/index.js +39 -0
  54. package/templates/backend/NODEJS/MONGODB/models/noteModel.js +17 -0
  55. package/templates/backend/NODEJS/MONGODB/models/userModel.js +17 -0
  56. package/templates/backend/NODEJS/MYSQL/config/dbConn.js +20 -0
  57. package/templates/backend/NODEJS/MYSQL/controllers/noteController.js +97 -0
  58. package/templates/backend/NODEJS/MYSQL/controllers/userController.js +98 -0
  59. package/templates/backend/NODEJS/MYSQL/index.js +39 -0
  60. package/templates/backend/NODEJS/MYSQL/models.txt +3 -0
  61. package/templates/backend/NODEJS/POSTGRESQL/config/dbConn.js +28 -0
  62. package/templates/backend/NODEJS/POSTGRESQL/controllers/noteController.js +91 -0
  63. package/templates/backend/NODEJS/POSTGRESQL/controllers/userController.js +92 -0
  64. package/templates/backend/NODEJS/POSTGRESQL/index.js +39 -0
  65. package/templates/backend/NODEJS/POSTGRESQL/models.txt +3 -0
  66. package/templates/backend/NODEJS/common/middleware/upstash.js +12 -0
  67. package/templates/backend/NODEJS/common/routes/noteRoutes.js +22 -0
  68. package/templates/backend/NODEJS/common/routes/userRoutes.js +22 -0
  69. package/templates/frontend/PREACT/src/app.jsx +103 -0
  70. package/templates/frontend/PREACT/vite.config.js +8 -0
  71. package/templates/frontend/PREACT-TS/src/app.tsx +112 -0
  72. package/templates/frontend/PREACT-TS/vite.config.ts +8 -0
  73. package/templates/frontend/REACT/src/App.css +27 -0
  74. package/templates/frontend/REACT/src/App.jsx +105 -0
  75. package/templates/frontend/REACT/vite.config.js +8 -0
  76. package/templates/frontend/REACT-SWC/src/App.css +27 -0
  77. package/templates/frontend/REACT-SWC/src/App.jsx +105 -0
  78. package/templates/frontend/REACT-SWC/vite.config.js +8 -0
  79. package/templates/frontend/REACT-SWC-TS/src/App.css +27 -0
  80. package/templates/frontend/REACT-SWC-TS/src/App.tsx +114 -0
  81. package/templates/frontend/REACT-SWC-TS/vite.config.ts +8 -0
  82. package/templates/frontend/REACT-TS/src/App.css +27 -0
  83. package/templates/frontend/REACT-TS/src/App.tsx +114 -0
  84. package/templates/frontend/REACT-TS/vite.config.ts +8 -0
  85. package/templates/frontend/SOLID/src/App.jsx +104 -0
  86. package/templates/frontend/SOLID/vite.config.js +7 -0
  87. package/templates/frontend/SOLID-TS/src/App.tsx +116 -0
  88. package/templates/frontend/SOLID-TS/vite.config.ts +7 -0
  89. package/templates/frontend/SVELTE/src/App.svelte +104 -0
  90. package/templates/frontend/SVELTE/vite.config.js +8 -0
  91. package/templates/frontend/SVELTE-TS/src/App.svelte +116 -0
  92. package/templates/frontend/SVELTE-TS/vite.config.ts +8 -0
  93. package/templates/frontend/VUE/src/App.vue +96 -0
  94. package/templates/frontend/VUE/vite.config.js +8 -0
  95. package/templates/frontend/VUE-TS/src/App.vue +112 -0
  96. package/templates/frontend/VUE-TS/vite.config.ts +8 -0
@@ -0,0 +1,114 @@
1
+ import { useState, useEffect } from 'react'
2
+ import reactLogo from './assets/react.svg'
3
+ import backendLogo from './assets/backend.svg'
4
+ import dbLogo from './assets/database.svg'
5
+ import viteLogo from '/vite.svg'
6
+ import './App.css'
7
+
8
+ interface AutoStackAPI {
9
+ message: string;
10
+ backend: string;
11
+ database: string;
12
+ filepath: string;
13
+ }
14
+
15
+ function App() {
16
+ const [data, setData] = useState<AutoStackAPI | null>(null);
17
+ const [loading, setLoading] = useState<boolean>(true);
18
+ const [error, setError] = useState<string | null>(null);
19
+
20
+ useEffect(() => {
21
+ fetch('http://localhost:5000/autostack')
22
+ .then((res) => {
23
+ return res.json();
24
+ })
25
+ .then((data: AutoStackAPI) => {
26
+ setData(data);
27
+ setLoading(false);
28
+ })
29
+ .catch((err: Error) => {
30
+ setError(err.message);
31
+ setLoading(false);
32
+ });
33
+ }, []);
34
+
35
+ return (
36
+ <div className="min-h-screen bg-linear-to-br from-gray-900 via-gray-800 to-gray-900 text-white flex items-center justify-center p-8">
37
+ <div className="max-w-4xl w-full">
38
+
39
+ <div className="flex justify-center items-center gap-8 mb-12">
40
+ <a href="https://vitejs.dev" target="_blank" rel="noopener noreferrer"
41
+ className="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#646cffaa]">
42
+ <img src={viteLogo} className="h-24 w-24" alt="Vite logo" />
43
+ </a>
44
+ <span className="text-4xl text-gray-500">+</span>
45
+ <a href="https://react.dev" target="_blank" rel="noopener noreferrer"
46
+ className="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#61dafbaa] animate-[spin_20s_linear_infinite]">
47
+ <img src={reactLogo} className="h-24 w-24" alt="React logo" />
48
+ </a>
49
+ <span className="text-4xl text-gray-500">+</span>
50
+ <a href="#" className="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#10b981aa]">
51
+ <img src={backendLogo} className="h-24 w-24" alt="Backend logo" />
52
+ </a>
53
+ <span className="text-4xl text-gray-500">+</span>
54
+ <a href="#" className="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#3b82f6aa]">
55
+ <img src={dbLogo} className="h-24 w-24" alt="Database logo" />
56
+ </a>
57
+ </div>
58
+
59
+ <h1 className="text-5xl font-bold text-center mb-8 text-white bg-clip-text text-transparent">
60
+ Vite + React + {data?.backend || '...'} + {data?.database || '...'}
61
+ </h1>
62
+
63
+ <div className="bg-gray-800/50 backdrop-blur-sm rounded-2xl p-8 mb-8 border border-gray-700 shadow-2xl">
64
+ {loading && (
65
+ <div className="flex items-center justify-center gap-3">
66
+ <div className="w-5 h-5 border-3 border-blue-500 border-t-transparent rounded-full animate-spin"></div>
67
+ <p className="text-gray-400">Connecting to backend...</p>
68
+ </div>
69
+ )}
70
+
71
+ {error && (
72
+ <div className="text-center">
73
+ <p className="text-red-400 mb-2">⚠️ Connection Failed</p>
74
+ <p className="text-sm text-gray-500">{error}</p>
75
+ <p className="text-xs text-gray-600 mt-3">Make sure your backend server is running on port 5000</p>
76
+ </div>
77
+ )}
78
+
79
+ {!loading && !error && data && (
80
+ <div className="text-center">
81
+ <div className="inline-flex items-center gap-2 px-4 py-2 bg-green-500/10 border border-green-500/20 rounded-full mb-4">
82
+ <span className="w-2 h-2 bg-green-500 rounded-full animate-pulse"></span>
83
+ <span className="text-green-400 text-sm font-medium">Connected</span>
84
+ </div>
85
+ <p className="text-2xl text-gray-300 mb-2">{data.message}</p>
86
+ <p className="text-sm text-gray-500">Your full-stack app is up and running! ✨</p>
87
+ </div>
88
+ )}
89
+ </div>
90
+
91
+ <div className="bg-gray-800/30 rounded-xl p-6 border border-gray-700/50">
92
+ <h2 className="text-xl font-semibold mb-4 text-gray-300 text-center">Quick Start</h2>
93
+ <div className="space-y-3 text-sm text-gray-400">
94
+ <div className="flex justify-center items-center gap-3">
95
+ <p>Edit <code className="px-2 py-1 bg-gray-700 rounded text-blue-300">src/App.tsx</code> to start building your frontend</p>
96
+ </div>
97
+ <div className="flex justify-center items-center gap-3">
98
+ <p>Modify <code className="px-2 py-1 bg-gray-700 rounded text-blue-300">{data?.filepath}</code> to add your API routes</p>
99
+ </div>
100
+ <div className="flex justify-center items-center gap-3">
101
+ <p>Check the console for any errors or messages</p>
102
+ </div>
103
+ </div>
104
+ </div>
105
+
106
+ <p className="text-center text-gray-500 text-sm mt-8">
107
+ Created with ❤️ using AutoStack
108
+ </p>
109
+ </div>
110
+ </div>
111
+ )
112
+ }
113
+
114
+ export default App
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'vite'
2
+ import react from '@vitejs/plugin-react'
3
+ import tailwindcss from '@tailwindcss/vite'
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react(), tailwindcss()],
8
+ })
@@ -0,0 +1,27 @@
1
+ .logo {
2
+ height: 6em;
3
+ padding: 1.5em;
4
+ will-change: filter;
5
+ transition: filter 300ms;
6
+ }
7
+ .logo:hover {
8
+ filter: drop-shadow(0 0 2em #646cffaa);
9
+ }
10
+ .logo.react:hover {
11
+ filter: drop-shadow(0 0 2em #61dafbaa);
12
+ }
13
+
14
+ @keyframes logo-spin {
15
+ from {
16
+ transform: rotate(0deg);
17
+ }
18
+ to {
19
+ transform: rotate(360deg);
20
+ }
21
+ }
22
+
23
+ @media (prefers-reduced-motion: no-preference) {
24
+ a:nth-of-type(2) .logo {
25
+ animation: logo-spin infinite 20s linear;
26
+ }
27
+ }
@@ -0,0 +1,114 @@
1
+ import { useState, useEffect } from 'react'
2
+ import reactLogo from './assets/react.svg'
3
+ import backendLogo from './assets/backend.svg'
4
+ import dbLogo from './assets/database.svg'
5
+ import viteLogo from '/vite.svg'
6
+ import './App.css'
7
+
8
+ interface AutoStackAPI {
9
+ message: string;
10
+ backend: string;
11
+ database: string;
12
+ filepath: string;
13
+ }
14
+
15
+ function App() {
16
+ const [data, setData] = useState<AutoStackAPI | null>(null);
17
+ const [loading, setLoading] = useState<boolean>(true);
18
+ const [error, setError] = useState<string | null>(null);
19
+
20
+ useEffect(() => {
21
+ fetch('http://localhost:5000/autostack')
22
+ .then((res) => {
23
+ return res.json();
24
+ })
25
+ .then((data: AutoStackAPI) => {
26
+ setData(data);
27
+ setLoading(false);
28
+ })
29
+ .catch((err: Error) => {
30
+ setError(err.message);
31
+ setLoading(false);
32
+ });
33
+ }, []);
34
+
35
+ return (
36
+ <div className="min-h-screen bg-linear-to-br from-gray-900 via-gray-800 to-gray-900 text-white flex items-center justify-center p-8">
37
+ <div className="max-w-4xl w-full">
38
+
39
+ <div className="flex justify-center items-center gap-8 mb-12">
40
+ <a href="https://vitejs.dev" target="_blank" rel="noopener noreferrer"
41
+ className="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#646cffaa]">
42
+ <img src={viteLogo} className="h-24 w-24" alt="Vite logo" />
43
+ </a>
44
+ <span className="text-4xl text-gray-500">+</span>
45
+ <a href="https://react.dev" target="_blank" rel="noopener noreferrer"
46
+ className="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#61dafbaa] animate-[spin_20s_linear_infinite]">
47
+ <img src={reactLogo} className="h-24 w-24" alt="React logo" />
48
+ </a>
49
+ <span className="text-4xl text-gray-500">+</span>
50
+ <a href="#" className="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#10b981aa]">
51
+ <img src={backendLogo} className="h-24 w-24" alt="Backend logo" />
52
+ </a>
53
+ <span className="text-4xl text-gray-500">+</span>
54
+ <a href="#" className="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#3b82f6aa]">
55
+ <img src={dbLogo} className="h-24 w-24" alt="Database logo" />
56
+ </a>
57
+ </div>
58
+
59
+ <h1 className="text-5xl font-bold text-center mb-8 text-white bg-clip-text text-transparent">
60
+ Vite + React + {data?.backend || '...'} + {data?.database || '...'}
61
+ </h1>
62
+
63
+ <div className="bg-gray-800/50 backdrop-blur-sm rounded-2xl p-8 mb-8 border border-gray-700 shadow-2xl">
64
+ {loading && (
65
+ <div className="flex items-center justify-center gap-3">
66
+ <div className="w-5 h-5 border-3 border-blue-500 border-t-transparent rounded-full animate-spin"></div>
67
+ <p className="text-gray-400">Connecting to backend...</p>
68
+ </div>
69
+ )}
70
+
71
+ {error && (
72
+ <div className="text-center">
73
+ <p className="text-red-400 mb-2">⚠️ Connection Failed</p>
74
+ <p className="text-sm text-gray-500">{error}</p>
75
+ <p className="text-xs text-gray-600 mt-3">Make sure your backend server is running on port 5000</p>
76
+ </div>
77
+ )}
78
+
79
+ {!loading && !error && data && (
80
+ <div className="text-center">
81
+ <div className="inline-flex items-center gap-2 px-4 py-2 bg-green-500/10 border border-green-500/20 rounded-full mb-4">
82
+ <span className="w-2 h-2 bg-green-500 rounded-full animate-pulse"></span>
83
+ <span className="text-green-400 text-sm font-medium">Connected</span>
84
+ </div>
85
+ <p className="text-2xl text-gray-300 mb-2">{data.message}</p>
86
+ <p className="text-sm text-gray-500">Your full-stack app is up and running! ✨</p>
87
+ </div>
88
+ )}
89
+ </div>
90
+
91
+ <div className="bg-gray-800/30 rounded-xl p-6 border border-gray-700/50">
92
+ <h2 className="text-xl font-semibold mb-4 text-gray-300 text-center">Quick Start</h2>
93
+ <div className="space-y-3 text-sm text-gray-400">
94
+ <div className="flex justify-center items-center gap-3">
95
+ <p>Edit <code className="px-2 py-1 bg-gray-700 rounded text-blue-300">src/App.tsx</code> to start building your frontend</p>
96
+ </div>
97
+ <div className="flex justify-center items-center gap-3">
98
+ <p>Modify <code className="px-2 py-1 bg-gray-700 rounded text-blue-300">{data?.filepath}</code> to add your API routes</p>
99
+ </div>
100
+ <div className="flex justify-center items-center gap-3">
101
+ <p>Check the console for any errors or messages</p>
102
+ </div>
103
+ </div>
104
+ </div>
105
+
106
+ <p className="text-center text-gray-500 text-sm mt-8">
107
+ Created with ❤️ using AutoStack
108
+ </p>
109
+ </div>
110
+ </div>
111
+ )
112
+ }
113
+
114
+ export default App
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'vite'
2
+ import react from '@vitejs/plugin-react'
3
+ import tailwindcss from '@tailwindcss/vite'
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react(), tailwindcss()],
8
+ })
@@ -0,0 +1,104 @@
1
+ import { createSignal, onMount } from 'solid-js'
2
+ import solidLogo from './assets/solid.svg'
3
+ import backendLogo from './assets/backend.svg'
4
+ import dbLogo from './assets/database.svg'
5
+ import viteLogo from '/vite.svg'
6
+
7
+ function App() {
8
+ const [data, setData] = createSignal(null);
9
+ const [loading, setLoading] = createSignal(true);
10
+ const [error, setError] = createSignal(null);
11
+
12
+ onMount(() => {
13
+ fetch('http://localhost:5000/autostack')
14
+ .then(res => res.json())
15
+ .then(data => {
16
+ setData(data);
17
+ setLoading(false);
18
+ })
19
+ .catch(err => {
20
+ setError(err.message);
21
+ setLoading(false);
22
+ });
23
+ });
24
+
25
+ return (
26
+ <div class="min-h-screen bg-linear-to-br from-gray-900 via-gray-800 to-gray-900 text-white flex items-center justify-center p-8">
27
+ <div class="max-w-4xl w-full">
28
+
29
+ <div class="flex justify-center items-center gap-8 mb-12">
30
+ <a href="https://vitejs.dev" target="_blank" rel="noopener noreferrer"
31
+ class="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#646cffaa]">
32
+ <img src={viteLogo} class="h-24 w-24" alt="Vite logo" />
33
+ </a>
34
+ <span class="text-4xl text-gray-500">+</span>
35
+ <a href="https://solidjs.com" target="_blank" rel="noopener noreferrer"
36
+ class="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#2c4f7caa] ">
37
+ <img src={solidLogo} class="h-24 w-24" alt="Solid logo" />
38
+ </a>
39
+ <span class="text-4xl text-gray-500">+</span>
40
+ <a href="#" class="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#10b981aa]">
41
+ <img src={backendLogo} class="h-24 w-24" alt="Backend logo" />
42
+ </a>
43
+ <span class="text-4xl text-gray-500">+</span>
44
+ <a href="#" class="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#3b82f6aa]">
45
+ <img src={dbLogo} class="h-24 w-24" alt="Database logo" />
46
+ </a>
47
+ </div>
48
+
49
+ <h1 class="text-5xl font-bold text-center mb-8 text-white bg-clip-text text-transparent">
50
+ Vite + Solid + {data()?.backend || '...'} + {data()?.database || '...'}
51
+ </h1>
52
+
53
+ <div class="bg-gray-800/50 backdrop-blur-sm rounded-2xl p-8 mb-8 border border-gray-700 shadow-2xl">
54
+ {loading() && (
55
+ <div class="flex items-center justify-center gap-3">
56
+ <div class="w-5 h-5 border-3 border-blue-500 border-t-transparent rounded-full animate-spin"></div>
57
+ <p class="text-gray-400">Connecting to backend...</p>
58
+ </div>
59
+ )}
60
+
61
+ {error() && (
62
+ <div class="text-center">
63
+ <p class="text-red-400 mb-2">⚠️ Connection Failed</p>
64
+ <p class="text-sm text-gray-500">{error()}</p>
65
+ <p class="text-xs text-gray-600 mt-3">Make sure your backend server is running on port 5000</p>
66
+ </div>
67
+ )}
68
+
69
+ {!loading() && !error() && data() && (
70
+ <div class="text-center">
71
+ <div class="inline-flex items-center gap-2 px-4 py-2 bg-green-500/10 border border-green-500/20 rounded-full mb-4">
72
+ <span class="w-2 h-2 bg-green-500 rounded-full animate-pulse"></span>
73
+ <span class="text-green-400 text-sm font-medium">Connected</span>
74
+ </div>
75
+ <p class="text-2xl text-gray-300 mb-2">{data()?.message}</p>
76
+ <p class="text-sm text-gray-500">Your full-stack app is up and running! ✨</p>
77
+ </div>
78
+ )}
79
+ </div>
80
+
81
+ <div class="bg-gray-800/30 rounded-xl p-6 border border-gray-700/50">
82
+ <h2 class="text-xl font-semibold mb-4 text-gray-300 text-center">Quick Start</h2>
83
+ <div class="space-y-3 text-sm text-gray-400">
84
+ <div class="flex justify-center items-center gap-3">
85
+ <p>Edit <code class="px-2 py-1 bg-gray-700 rounded text-blue-300">src/App.jsx</code> to start building your frontend</p>
86
+ </div>
87
+ <div class="flex justify-center items-center gap-3">
88
+ <p>Modify <code class="px-2 py-1 bg-gray-700 rounded text-blue-300">{data()?.filepath}</code> to add your API routes</p>
89
+ </div>
90
+ <div class="flex justify-center items-center gap-3">
91
+ <p>Check the console for any errors or messages</p>
92
+ </div>
93
+ </div>
94
+ </div>
95
+
96
+ <p class="text-center text-gray-500 text-sm mt-8">
97
+ Created with ❤️ using AutoStack
98
+ </p>
99
+ </div>
100
+ </div>
101
+ )
102
+ }
103
+
104
+ export default App
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vite'
2
+ import solid from 'vite-plugin-solid'
3
+ import tailwindcss from "@tailwindcss/vite"
4
+
5
+ export default defineConfig({
6
+ plugins: [solid(), tailwindcss()],
7
+ })
@@ -0,0 +1,116 @@
1
+ import { createSignal, onMount } from 'solid-js'
2
+ import solidLogo from './assets/solid.svg'
3
+ import backendLogo from './assets/backend.svg'
4
+ import dbLogo from './assets/database.svg'
5
+ import viteLogo from '/vite.svg'
6
+
7
+ interface AutoStackAPI {
8
+ message: string;
9
+ backend: string;
10
+ database: string;
11
+ filepath: string;
12
+ }
13
+
14
+ function App() {
15
+ const [data, setData] = createSignal<AutoStackAPI | null>(null);
16
+ const [loading, setLoading] = createSignal<boolean>(true);
17
+ const [error, setError] = createSignal<string | null>(null);
18
+
19
+ onMount(() => {
20
+ fetch('http://localhost:5000/autostack')
21
+ .then((res) => {
22
+ if (!res.ok) {
23
+ throw new Error(`HTTP error! status: ${res.status}`);
24
+ }
25
+ return res.json();
26
+ })
27
+ .then((data: AutoStackAPI) => {
28
+ setData(data);
29
+ setLoading(false);
30
+ })
31
+ .catch((err: Error) => {
32
+ setError(err.message);
33
+ setLoading(false);
34
+ });
35
+ });
36
+
37
+ return (
38
+ <div class="min-h-screen bg-linear-to-br from-gray-900 via-gray-800 to-gray-900 text-white flex items-center justify-center p-8">
39
+ <div class="max-w-4xl w-full">
40
+
41
+ <div class="flex justify-center items-center gap-8 mb-12">
42
+ <a href="https://vitejs.dev" target="_blank" rel="noopener noreferrer"
43
+ class="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#646cffaa]">
44
+ <img src={viteLogo} class="h-24 w-24" alt="Vite logo" />
45
+ </a>
46
+ <span class="text-4xl text-gray-500">+</span>
47
+ <a href="https://solidjs.com" target="_blank" rel="noopener noreferrer"
48
+ class="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#2c4f7caa] animate-[spin_20s_linear_infinite]">
49
+ <img src={solidLogo} class="h-24 w-24" alt="Solid logo" />
50
+ </a>
51
+ <span class="text-4xl text-gray-500">+</span>
52
+ <a href="#" class="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#10b981aa]">
53
+ <img src={backendLogo} class="h-24 w-24" alt="Backend logo" />
54
+ </a>
55
+ <span class="text-4xl text-gray-500">+</span>
56
+ <a href="#" class="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#3b82f6aa]">
57
+ <img src={dbLogo} class="h-24 w-24" alt="Database logo" />
58
+ </a>
59
+ </div>
60
+
61
+ <h1 class="text-5xl font-bold text-center mb-8 text-white bg-clip-text text-transparent">
62
+ Vite + Solid + {data()?.backend || '...'} + {data()?.database || '...'}
63
+ </h1>
64
+
65
+ <div class="bg-gray-800/50 backdrop-blur-sm rounded-2xl p-8 mb-8 border border-gray-700 shadow-2xl">
66
+ {loading() && (
67
+ <div class="flex items-center justify-center gap-3">
68
+ <div class="w-5 h-5 border-3 border-blue-500 border-t-transparent rounded-full animate-spin"></div>
69
+ <p class="text-gray-400">Connecting to backend...</p>
70
+ </div>
71
+ )}
72
+
73
+ {error() && (
74
+ <div class="text-center">
75
+ <p class="text-red-400 mb-2">⚠️ Connection Failed</p>
76
+ <p class="text-sm text-gray-500">{error()}</p>
77
+ <p class="text-xs text-gray-600 mt-3">Make sure your backend server is running on port 5000</p>
78
+ </div>
79
+ )}
80
+
81
+ {!loading() && !error() && data() && (
82
+ <div class="text-center">
83
+ <div class="inline-flex items-center gap-2 px-4 py-2 bg-green-500/10 border border-green-500/20 rounded-full mb-4">
84
+ <span class="w-2 h-2 bg-green-500 rounded-full animate-pulse"></span>
85
+ <span class="text-green-400 text-sm font-medium">Connected</span>
86
+ </div>
87
+ <p class="text-2xl text-gray-300 mb-2">{data()!.message}</p>
88
+ <p class="text-sm text-gray-500">Your full-stack app is up and running! ✨</p>
89
+ </div>
90
+ )}
91
+ </div>
92
+
93
+ <div class="bg-gray-800/30 rounded-xl p-6 border border-gray-700/50">
94
+ <h2 class="text-xl font-semibold mb-4 text-gray-300 text-center">Quick Start</h2>
95
+ <div class="space-y-3 text-sm text-gray-400">
96
+ <div class="flex justify-center items-center gap-3">
97
+ <p>Edit <code class="px-2 py-1 bg-gray-700 rounded text-blue-300">src/App.tsx</code> to start building your frontend</p>
98
+ </div>
99
+ <div class="flex justify-center items-center gap-3">
100
+ <p>Modify <code class="px-2 py-1 bg-gray-700 rounded text-blue-300">{data()?.filepath}</code> to add your API routes</p>
101
+ </div>
102
+ <div class="flex justify-center items-center gap-3">
103
+ <p>Check the console for any errors or messages</p>
104
+ </div>
105
+ </div>
106
+ </div>
107
+
108
+ <p class="text-center text-gray-500 text-sm mt-8">
109
+ Created with ❤️ using AutoStack
110
+ </p>
111
+ </div>
112
+ </div>
113
+ )
114
+ }
115
+
116
+ export default App
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vite'
2
+ import solid from 'vite-plugin-solid'
3
+ import tailwindcss from "@tailwindcss/vite"
4
+
5
+ export default defineConfig({
6
+ plugins: [solid(), tailwindcss()],
7
+ })
@@ -0,0 +1,104 @@
1
+ <script>
2
+ import { onMount } from 'svelte'
3
+ import svelteLogo from './assets/svelte.svg'
4
+ import backendLogo from './assets/backend.svg'
5
+ import dbLogo from './assets/database.svg'
6
+ import viteLogo from '/vite.svg'
7
+
8
+ let data = null
9
+ let loading = true
10
+ let error = null
11
+
12
+ onMount(() => {
13
+ fetch('http://localhost:5000/autostack')
14
+ .then(res => res.json())
15
+ .then(responseData => {
16
+ data = responseData
17
+ loading = false
18
+ })
19
+ .catch(err => {
20
+ error = err.message
21
+ loading = false
22
+ })
23
+ })
24
+ </script>
25
+
26
+ <div class="min-h-screen bg-linear-to-br from-gray-900 via-gray-800 to-gray-900 text-white flex items-center justify-center p-8">
27
+ <div class="max-w-4xl w-full">
28
+
29
+ <div class="flex justify-center items-center gap-8 mb-12">
30
+ <a href="https://vitejs.dev" target="_blank" rel="noopener noreferrer"
31
+ class="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#646cffaa]">
32
+ <img src={viteLogo} class="h-24 w-24" alt="Vite logo" />
33
+ </a>
34
+ <span class="text-4xl text-gray-500">+</span>
35
+ <a href="https://svelte.dev" target="_blank" rel="noopener noreferrer"
36
+ class="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#ff3e00aa]">
37
+ <img src={svelteLogo} class="h-24 w-24" alt="Svelte logo" />
38
+ </a>
39
+ <span class="text-4xl text-gray-500">+</span>
40
+ <a href="#" class="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#10b981aa]">
41
+ <img src={backendLogo} class="h-24 w-24" alt="Backend logo" />
42
+ </a>
43
+ <span class="text-4xl text-gray-500">+</span>
44
+ <a href="#" class="transition-transform hover:scale-110 hover:drop-shadow-[0_0_2em_#3b82f6aa]">
45
+ <img src={dbLogo} class="h-24 w-24" alt="Database logo" />
46
+ </a>
47
+ </div>
48
+
49
+ <h1 class="text-5xl font-bold text-center mb-8 text-white bg-clip-text text-transparent">
50
+ Vite + Svelte + {data?.backend || '...'} + {data?.database || '...'}
51
+ </h1>
52
+
53
+ <div class="bg-gray-800/50 backdrop-blur-sm rounded-2xl p-8 mb-8 border border-gray-700 shadow-2xl">
54
+ {#if loading}
55
+ <div class="flex items-center justify-center gap-3">
56
+ <div class="w-5 h-5 border-3 border-blue-500 border-t-transparent rounded-full animate-spin"></div>
57
+ <p class="text-gray-400">Connecting to backend...</p>
58
+ </div>
59
+ {/if}
60
+
61
+ {#if error}
62
+ <div class="text-center">
63
+ <p class="text-red-400 mb-2">⚠️ Connection Failed</p>
64
+ <p class="text-sm text-gray-500">{error}</p>
65
+ <p class="text-xs text-gray-600 mt-3">Make sure your backend server is running on port 5000</p>
66
+ </div>
67
+ {/if}
68
+
69
+ {#if !loading && !error && data}
70
+ <div class="text-center">
71
+ <div class="inline-flex items-center gap-2 px-4 py-2 bg-green-500/10 border border-green-500/20 rounded-full mb-4">
72
+ <span class="w-2 h-2 bg-green-500 rounded-full animate-pulse"></span>
73
+ <span class="text-green-400 text-sm font-medium">Connected</span>
74
+ </div>
75
+ <p class="text-2xl text-gray-300 mb-2">{data?.message}</p>
76
+ <p class="text-sm text-gray-500">Your full-stack app is up and running! ✨</p>
77
+ </div>
78
+ {/if}
79
+ </div>
80
+
81
+ <div class="bg-gray-800/30 rounded-xl p-6 border border-gray-700/50">
82
+ <h2 class="text-xl font-semibold mb-4 text-gray-300 text-center">Quick Start</h2>
83
+ <div class="space-y-3 text-sm text-gray-400">
84
+ <div class="flex justify-center items-center gap-3">
85
+ <p>Edit <code class="px-2 py-1 bg-gray-700 rounded text-blue-300">src/App.svelte</code> to start building your frontend</p>
86
+ </div>
87
+ <div class="flex justify-center items-center gap-3">
88
+ <p>Modify <code class="px-2 py-1 bg-gray-700 rounded text-blue-300">{data?.filepath}</code> to add your API routes</p>
89
+ </div>
90
+ <div class="flex justify-center items-center gap-3">
91
+ <p>Check the console for any errors or messages</p>
92
+ </div>
93
+ </div>
94
+ </div>
95
+
96
+ <p class="text-center text-gray-500 text-sm mt-8">
97
+ Created with ❤️ using AutoStack
98
+ </p>
99
+ </div>
100
+ </div>
101
+
102
+ <style>
103
+ @import './app.css';
104
+ </style>
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'vite'
2
+ import { svelte } from '@sveltejs/vite-plugin-svelte'
3
+ import tailwindcss from "@tailwindcss/vite"
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [svelte(), tailwindcss()],
8
+ })