create-stackit 0.1.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/LICENSE +21 -0
- package/README.md +194 -0
- package/bin/index.js +64 -0
- package/package.json +43 -0
- package/src/choices.js +63 -0
- package/src/generator.js +133 -0
- package/src/injectors/addons.js +311 -0
- package/src/injectors/structure.js +51 -0
- package/src/pm.js +94 -0
- package/src/prompts.js +179 -0
- package/src/utils.js +18 -0
- package/templates/next-js-redux-mui/README.md +15 -0
- package/templates/next-js-redux-mui/app/layout.jsx +12 -0
- package/templates/next-js-redux-mui/app/page.jsx +15 -0
- package/templates/next-js-redux-mui/app/providers.jsx +16 -0
- package/templates/next-js-redux-mui/package.json +22 -0
- package/templates/next-js-redux-mui/src/store/counterSlice.js +13 -0
- package/templates/next-js-redux-mui/src/store/store.js +8 -0
- package/templates/next-js-redux-mui/src/theme.js +9 -0
- package/templates/next-js-redux-shadcn/README.md +15 -0
- package/templates/next-js-redux-shadcn/app/globals.css +3 -0
- package/templates/next-js-redux-shadcn/app/layout.jsx +13 -0
- package/templates/next-js-redux-shadcn/app/page.jsx +15 -0
- package/templates/next-js-redux-shadcn/app/providers.jsx +11 -0
- package/templates/next-js-redux-shadcn/package.json +23 -0
- package/templates/next-js-redux-shadcn/src/store/counterSlice.js +13 -0
- package/templates/next-js-redux-shadcn/src/store/store.js +8 -0
- package/templates/next-js-zustand-mui/README.md +15 -0
- package/templates/next-js-zustand-mui/app/layout.jsx +16 -0
- package/templates/next-js-zustand-mui/app/page.jsx +18 -0
- package/templates/next-js-zustand-mui/package.json +21 -0
- package/templates/next-js-zustand-mui/src/theme.js +9 -0
- package/templates/next-js-zustand-shadcn/README.md +15 -0
- package/templates/next-js-zustand-shadcn/app/globals.css +3 -0
- package/templates/next-js-zustand-shadcn/app/layout.jsx +10 -0
- package/templates/next-js-zustand-shadcn/app/page.jsx +18 -0
- package/templates/next-js-zustand-shadcn/package.json +22 -0
- package/templates/next-ts-redux-mui/README.md +15 -0
- package/templates/next-ts-redux-mui/app/layout.tsx +14 -0
- package/templates/next-ts-redux-mui/app/page.tsx +15 -0
- package/templates/next-ts-redux-mui/app/providers.tsx +16 -0
- package/templates/next-ts-redux-mui/package.json +27 -0
- package/templates/next-ts-redux-mui/src/store/counterSlice.ts +16 -0
- package/templates/next-ts-redux-mui/src/store/store.ts +11 -0
- package/templates/next-ts-redux-mui/src/theme.ts +9 -0
- package/templates/next-ts-redux-shadcn/README.md +15 -0
- package/templates/next-ts-redux-shadcn/app/globals.css +3 -0
- package/templates/next-ts-redux-shadcn/app/layout.tsx +15 -0
- package/templates/next-ts-redux-shadcn/app/page.tsx +15 -0
- package/templates/next-ts-redux-shadcn/app/providers.tsx +11 -0
- package/templates/next-ts-redux-shadcn/package.json +27 -0
- package/templates/next-ts-redux-shadcn/src/store/counterSlice.ts +16 -0
- package/templates/next-ts-redux-shadcn/src/store/store.ts +11 -0
- package/templates/next-ts-zustand-mui/README.md +15 -0
- package/templates/next-ts-zustand-mui/app/layout.tsx +18 -0
- package/templates/next-ts-zustand-mui/app/page.tsx +18 -0
- package/templates/next-ts-zustand-mui/package.json +26 -0
- package/templates/next-ts-zustand-mui/src/theme.ts +9 -0
- package/templates/next-ts-zustand-shadcn/README.md +15 -0
- package/templates/next-ts-zustand-shadcn/app/globals.css +3 -0
- package/templates/next-ts-zustand-shadcn/app/layout.tsx +12 -0
- package/templates/next-ts-zustand-shadcn/app/page.tsx +18 -0
- package/templates/next-ts-zustand-shadcn/package.json +26 -0
- package/templates/vite-js-redux-mui/README.md +15 -0
- package/templates/vite-js-redux-mui/package.json +24 -0
- package/templates/vite-js-redux-mui/src/App.jsx +14 -0
- package/templates/vite-js-redux-mui/src/main.jsx +18 -0
- package/templates/vite-js-redux-mui/src/store/counterSlice.js +13 -0
- package/templates/vite-js-redux-mui/src/store/store.js +8 -0
- package/templates/vite-js-redux-mui/src/theme.js +9 -0
- package/templates/vite-js-redux-shadcn/README.md +15 -0
- package/templates/vite-js-redux-shadcn/package.json +24 -0
- package/templates/vite-js-redux-shadcn/src/App.jsx +14 -0
- package/templates/vite-js-redux-shadcn/src/index.css +3 -0
- package/templates/vite-js-redux-shadcn/src/main.jsx +14 -0
- package/templates/vite-js-redux-shadcn/src/store/counterSlice.js +13 -0
- package/templates/vite-js-redux-shadcn/src/store/store.js +8 -0
- package/templates/vite-js-zustand-mui/README.md +15 -0
- package/templates/vite-js-zustand-mui/package.json +23 -0
- package/templates/vite-js-zustand-mui/src/App.jsx +17 -0
- package/templates/vite-js-zustand-mui/src/main.jsx +14 -0
- package/templates/vite-js-zustand-mui/src/theme.js +9 -0
- package/templates/vite-js-zustand-shadcn/README.md +15 -0
- package/templates/vite-js-zustand-shadcn/package.json +23 -0
- package/templates/vite-js-zustand-shadcn/src/App.jsx +17 -0
- package/templates/vite-js-zustand-shadcn/src/index.css +3 -0
- package/templates/vite-js-zustand-shadcn/src/main.jsx +10 -0
- package/templates/vite-ts-redux-mui/README.md +15 -0
- package/templates/vite-ts-redux-mui/package.json +27 -0
- package/templates/vite-ts-redux-mui/src/App.tsx +14 -0
- package/templates/vite-ts-redux-mui/src/main.tsx +18 -0
- package/templates/vite-ts-redux-mui/src/store/counterSlice.ts +16 -0
- package/templates/vite-ts-redux-mui/src/store/store.ts +11 -0
- package/templates/vite-ts-redux-mui/src/theme.ts +9 -0
- package/templates/vite-ts-redux-shadcn/README.md +15 -0
- package/templates/vite-ts-redux-shadcn/package.json +27 -0
- package/templates/vite-ts-redux-shadcn/src/App.tsx +14 -0
- package/templates/vite-ts-redux-shadcn/src/index.css +3 -0
- package/templates/vite-ts-redux-shadcn/src/main.tsx +14 -0
- package/templates/vite-ts-redux-shadcn/src/store/counterSlice.ts +16 -0
- package/templates/vite-ts-redux-shadcn/src/store/store.ts +11 -0
- package/templates/vite-ts-zustand-mui/README.md +15 -0
- package/templates/vite-ts-zustand-mui/package.json +26 -0
- package/templates/vite-ts-zustand-mui/src/App.tsx +17 -0
- package/templates/vite-ts-zustand-mui/src/main.tsx +14 -0
- package/templates/vite-ts-zustand-mui/src/theme.ts +9 -0
- package/templates/vite-ts-zustand-shadcn/README.md +15 -0
- package/templates/vite-ts-zustand-shadcn/package.json +23 -0
- package/templates/vite-ts-zustand-shadcn/src/main.tsx +2 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { Provider } from 'react-redux'
|
|
3
|
+
import { store } from '../src/store/store'
|
|
4
|
+
import { ThemeProvider, CssBaseline } from '@mui/material'
|
|
5
|
+
import { theme } from '../src/theme'
|
|
6
|
+
|
|
7
|
+
export function Providers({ children }) {
|
|
8
|
+
return (
|
|
9
|
+
<Provider store={store}>
|
|
10
|
+
<ThemeProvider theme={theme}>
|
|
11
|
+
<CssBaseline />
|
|
12
|
+
{children}
|
|
13
|
+
</ThemeProvider>
|
|
14
|
+
</Provider>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "stackit-template",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"lint": "next lint"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"next": "^15.0.3",
|
|
13
|
+
"react": "^18.3.1",
|
|
14
|
+
"react-dom": "^18.3.1",
|
|
15
|
+
"@reduxjs/toolkit": "^2.3.0",
|
|
16
|
+
"react-redux": "^9.1.2",
|
|
17
|
+
"@mui/material": "^6.1.6",
|
|
18
|
+
"@emotion/react": "^11.13.3",
|
|
19
|
+
"@emotion/styled": "^11.13.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {}
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit'
|
|
2
|
+
|
|
3
|
+
const counterSlice = createSlice({
|
|
4
|
+
name: 'counter',
|
|
5
|
+
initialState: { value: 0 },
|
|
6
|
+
reducers: {
|
|
7
|
+
increment: (state) => { state.value += 1 },
|
|
8
|
+
decrement: (state) => { state.value -= 1 },
|
|
9
|
+
},
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
export const { increment, decrement } = counterSlice.actions
|
|
13
|
+
export default counterSlice.reducer
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
Generated with [create-stackit](https://github.com/your-handle/create-stackit).
|
|
4
|
+
|
|
5
|
+
## Stack
|
|
6
|
+
- Next.js + JavaScript
|
|
7
|
+
- Redux Toolkit
|
|
8
|
+
- Tailwind + shadcn/ui
|
|
9
|
+
|
|
10
|
+
## Scripts
|
|
11
|
+
```bash
|
|
12
|
+
npm run dev # start dev server
|
|
13
|
+
npm run build # production build
|
|
14
|
+
npm run start # start production server
|
|
15
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { useDispatch, useSelector } from 'react-redux'
|
|
3
|
+
import { increment } from '../src/store/counterSlice'
|
|
4
|
+
|
|
5
|
+
export default function Home() {
|
|
6
|
+
const count = useSelector((state) => state.counter.value)
|
|
7
|
+
const dispatch = useDispatch()
|
|
8
|
+
return (
|
|
9
|
+
<main>
|
|
10
|
+
<h1>create-stackit</h1>
|
|
11
|
+
<p>Count: {count}</p>
|
|
12
|
+
<button onClick={() => dispatch(increment())}>Increment</button>
|
|
13
|
+
</main>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "stackit-template",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"lint": "next lint"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"next": "^15.0.3",
|
|
13
|
+
"react": "^18.3.1",
|
|
14
|
+
"react-dom": "^18.3.1",
|
|
15
|
+
"@reduxjs/toolkit": "^2.3.0",
|
|
16
|
+
"react-redux": "^9.1.2"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"tailwindcss": "^3.4.14",
|
|
20
|
+
"postcss": "^8.4.47",
|
|
21
|
+
"autoprefixer": "^10.4.20"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit'
|
|
2
|
+
|
|
3
|
+
const counterSlice = createSlice({
|
|
4
|
+
name: 'counter',
|
|
5
|
+
initialState: { value: 0 },
|
|
6
|
+
reducers: {
|
|
7
|
+
increment: (state) => { state.value += 1 },
|
|
8
|
+
decrement: (state) => { state.value -= 1 },
|
|
9
|
+
},
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
export const { increment, decrement } = counterSlice.actions
|
|
13
|
+
export default counterSlice.reducer
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
Generated with [create-stackit](https://github.com/your-handle/create-stackit).
|
|
4
|
+
|
|
5
|
+
## Stack
|
|
6
|
+
- Next.js + JavaScript
|
|
7
|
+
- Zustand
|
|
8
|
+
- Material UI
|
|
9
|
+
|
|
10
|
+
## Scripts
|
|
11
|
+
```bash
|
|
12
|
+
npm run dev # start dev server
|
|
13
|
+
npm run build # production build
|
|
14
|
+
npm run start # start production server
|
|
15
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ThemeProvider, CssBaseline } from '@mui/material'
|
|
3
|
+
import { theme } from '../src/theme'
|
|
4
|
+
|
|
5
|
+
export default function RootLayout({ children }) {
|
|
6
|
+
return (
|
|
7
|
+
<html lang="en">
|
|
8
|
+
<body>
|
|
9
|
+
<ThemeProvider theme={theme}>
|
|
10
|
+
<CssBaseline />
|
|
11
|
+
{children}
|
|
12
|
+
</ThemeProvider>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { create } from 'zustand'
|
|
3
|
+
|
|
4
|
+
const useStore = create((set) => ({
|
|
5
|
+
count: 0,
|
|
6
|
+
increment: () => set((s) => ({ count: s.count + 1 })),
|
|
7
|
+
}))
|
|
8
|
+
|
|
9
|
+
export default function Home() {
|
|
10
|
+
const { count, increment } = useStore()
|
|
11
|
+
return (
|
|
12
|
+
<main>
|
|
13
|
+
<h1>create-stackit</h1>
|
|
14
|
+
<p>Count: {count}</p>
|
|
15
|
+
<button onClick={increment}>Increment</button>
|
|
16
|
+
</main>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "stackit-template",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"lint": "next lint"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"next": "^15.0.3",
|
|
13
|
+
"react": "^18.3.1",
|
|
14
|
+
"react-dom": "^18.3.1",
|
|
15
|
+
"zustand": "^5.0.0",
|
|
16
|
+
"@mui/material": "^6.1.6",
|
|
17
|
+
"@emotion/react": "^11.13.3",
|
|
18
|
+
"@emotion/styled": "^11.13.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {}
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
Generated with [create-stackit](https://github.com/your-handle/create-stackit).
|
|
4
|
+
|
|
5
|
+
## Stack
|
|
6
|
+
- Next.js + JavaScript
|
|
7
|
+
- Zustand
|
|
8
|
+
- Tailwind + shadcn/ui
|
|
9
|
+
|
|
10
|
+
## Scripts
|
|
11
|
+
```bash
|
|
12
|
+
npm run dev # start dev server
|
|
13
|
+
npm run build # production build
|
|
14
|
+
npm run start # start production server
|
|
15
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { create } from 'zustand'
|
|
3
|
+
|
|
4
|
+
const useStore = create((set) => ({
|
|
5
|
+
count: 0,
|
|
6
|
+
increment: () => set((s) => ({ count: s.count + 1 })),
|
|
7
|
+
}))
|
|
8
|
+
|
|
9
|
+
export default function Home() {
|
|
10
|
+
const { count, increment } = useStore()
|
|
11
|
+
return (
|
|
12
|
+
<main>
|
|
13
|
+
<h1>create-stackit</h1>
|
|
14
|
+
<p>Count: {count}</p>
|
|
15
|
+
<button onClick={increment}>Increment</button>
|
|
16
|
+
</main>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "stackit-template",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"lint": "next lint"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"next": "^15.0.3",
|
|
13
|
+
"react": "^18.3.1",
|
|
14
|
+
"react-dom": "^18.3.1",
|
|
15
|
+
"zustand": "^5.0.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"tailwindcss": "^3.4.14",
|
|
19
|
+
"postcss": "^8.4.47",
|
|
20
|
+
"autoprefixer": "^10.4.20"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
Generated with [create-stackit](https://github.com/your-handle/create-stackit).
|
|
4
|
+
|
|
5
|
+
## Stack
|
|
6
|
+
- Next.js + TypeScript
|
|
7
|
+
- Redux Toolkit
|
|
8
|
+
- Material UI
|
|
9
|
+
|
|
10
|
+
## Scripts
|
|
11
|
+
```bash
|
|
12
|
+
npm run dev # start dev server
|
|
13
|
+
npm run build # production build
|
|
14
|
+
npm run start # start production server
|
|
15
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Providers } from './providers'
|
|
3
|
+
|
|
4
|
+
export const metadata = { title: 'create-stackit app', description: 'Generated by create-stackit' }
|
|
5
|
+
|
|
6
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
7
|
+
return (
|
|
8
|
+
<html lang="en">
|
|
9
|
+
<body>
|
|
10
|
+
<Providers>{children}</Providers>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { useDispatch, useSelector } from 'react-redux'
|
|
3
|
+
import { increment } from '../src/store/counterSlice'
|
|
4
|
+
|
|
5
|
+
export default function Home() {
|
|
6
|
+
const count = useSelector((state) => state.counter.value)
|
|
7
|
+
const dispatch = useDispatch()
|
|
8
|
+
return (
|
|
9
|
+
<main>
|
|
10
|
+
<h1>create-stackit</h1>
|
|
11
|
+
<p>Count: {count}</p>
|
|
12
|
+
<button onClick={() => dispatch(increment())}>Increment</button>
|
|
13
|
+
</main>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { Provider } from 'react-redux'
|
|
3
|
+
import { store } from '../src/store/store'
|
|
4
|
+
import { ThemeProvider, CssBaseline } from '@mui/material'
|
|
5
|
+
import { theme } from '../src/theme'
|
|
6
|
+
|
|
7
|
+
export function Providers({ children }: { children: React.ReactNode }) {
|
|
8
|
+
return (
|
|
9
|
+
<Provider store={store}>
|
|
10
|
+
<ThemeProvider theme={theme}>
|
|
11
|
+
<CssBaseline />
|
|
12
|
+
{children}
|
|
13
|
+
</ThemeProvider>
|
|
14
|
+
</Provider>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "stackit-template",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"lint": "next lint"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"next": "^15.0.3",
|
|
13
|
+
"react": "^18.3.1",
|
|
14
|
+
"react-dom": "^18.3.1",
|
|
15
|
+
"@reduxjs/toolkit": "^2.3.0",
|
|
16
|
+
"react-redux": "^9.1.2",
|
|
17
|
+
"@mui/material": "^6.1.6",
|
|
18
|
+
"@emotion/react": "^11.13.3",
|
|
19
|
+
"@emotion/styled": "^11.13.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "^20",
|
|
23
|
+
"@types/react": "^18.3.10",
|
|
24
|
+
"@types/react-dom": "^18.3.0",
|
|
25
|
+
"typescript": "^5.6.2"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit'
|
|
2
|
+
|
|
3
|
+
interface CounterState { value: number }
|
|
4
|
+
const initialState: CounterState = { value: 0 }
|
|
5
|
+
|
|
6
|
+
export const counterSlice = createSlice({
|
|
7
|
+
name: 'counter',
|
|
8
|
+
initialState,
|
|
9
|
+
reducers: {
|
|
10
|
+
increment: (state) => { state.value += 1 },
|
|
11
|
+
decrement: (state) => { state.value -= 1 },
|
|
12
|
+
},
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export const { increment, decrement } = counterSlice.actions
|
|
16
|
+
export default counterSlice.reducer
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { configureStore } from '@reduxjs/toolkit'
|
|
2
|
+
import counterReducer from './counterSlice'
|
|
3
|
+
|
|
4
|
+
export const store = configureStore({
|
|
5
|
+
reducer: {
|
|
6
|
+
counter: counterReducer,
|
|
7
|
+
},
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export type RootState = ReturnType<typeof store.getState>
|
|
11
|
+
export type AppDispatch = typeof store.dispatch
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
Generated with [create-stackit](https://github.com/your-handle/create-stackit).
|
|
4
|
+
|
|
5
|
+
## Stack
|
|
6
|
+
- Next.js + TypeScript
|
|
7
|
+
- Redux Toolkit
|
|
8
|
+
- Tailwind + shadcn/ui
|
|
9
|
+
|
|
10
|
+
## Scripts
|
|
11
|
+
```bash
|
|
12
|
+
npm run dev # start dev server
|
|
13
|
+
npm run build # production build
|
|
14
|
+
npm run start # start production server
|
|
15
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Providers } from './providers'
|
|
3
|
+
import './globals.css'
|
|
4
|
+
|
|
5
|
+
export const metadata = { title: 'create-stackit app', description: 'Generated by create-stackit' }
|
|
6
|
+
|
|
7
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
8
|
+
return (
|
|
9
|
+
<html lang="en">
|
|
10
|
+
<body>
|
|
11
|
+
<Providers>{children}</Providers>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { useDispatch, useSelector } from 'react-redux'
|
|
3
|
+
import { increment } from '../src/store/counterSlice'
|
|
4
|
+
|
|
5
|
+
export default function Home() {
|
|
6
|
+
const count = useSelector((state) => state.counter.value)
|
|
7
|
+
const dispatch = useDispatch()
|
|
8
|
+
return (
|
|
9
|
+
<main>
|
|
10
|
+
<h1>create-stackit</h1>
|
|
11
|
+
<p>Count: {count}</p>
|
|
12
|
+
<button onClick={() => dispatch(increment())}>Increment</button>
|
|
13
|
+
</main>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "stackit-template",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"lint": "next lint"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"next": "^15.0.3",
|
|
13
|
+
"react": "^18.3.1",
|
|
14
|
+
"react-dom": "^18.3.1",
|
|
15
|
+
"@reduxjs/toolkit": "^2.3.0",
|
|
16
|
+
"react-redux": "^9.1.2"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/node": "^20",
|
|
20
|
+
"@types/react": "^18.3.10",
|
|
21
|
+
"@types/react-dom": "^18.3.0",
|
|
22
|
+
"typescript": "^5.6.2",
|
|
23
|
+
"tailwindcss": "^3.4.14",
|
|
24
|
+
"postcss": "^8.4.47",
|
|
25
|
+
"autoprefixer": "^10.4.20"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit'
|
|
2
|
+
|
|
3
|
+
interface CounterState { value: number }
|
|
4
|
+
const initialState: CounterState = { value: 0 }
|
|
5
|
+
|
|
6
|
+
export const counterSlice = createSlice({
|
|
7
|
+
name: 'counter',
|
|
8
|
+
initialState,
|
|
9
|
+
reducers: {
|
|
10
|
+
increment: (state) => { state.value += 1 },
|
|
11
|
+
decrement: (state) => { state.value -= 1 },
|
|
12
|
+
},
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export const { increment, decrement } = counterSlice.actions
|
|
16
|
+
export default counterSlice.reducer
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { configureStore } from '@reduxjs/toolkit'
|
|
2
|
+
import counterReducer from './counterSlice'
|
|
3
|
+
|
|
4
|
+
export const store = configureStore({
|
|
5
|
+
reducer: {
|
|
6
|
+
counter: counterReducer,
|
|
7
|
+
},
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export type RootState = ReturnType<typeof store.getState>
|
|
11
|
+
export type AppDispatch = typeof store.dispatch
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
Generated with [create-stackit](https://github.com/your-handle/create-stackit).
|
|
4
|
+
|
|
5
|
+
## Stack
|
|
6
|
+
- Next.js + TypeScript
|
|
7
|
+
- Zustand
|
|
8
|
+
- Material UI
|
|
9
|
+
|
|
10
|
+
## Scripts
|
|
11
|
+
```bash
|
|
12
|
+
npm run dev # start dev server
|
|
13
|
+
npm run build # production build
|
|
14
|
+
npm run start # start production server
|
|
15
|
+
```
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ThemeProvider, CssBaseline } from '@mui/material'
|
|
3
|
+
import { theme } from '../src/theme'
|
|
4
|
+
|
|
5
|
+
export const metadata = { title: 'create-stackit app', description: 'Generated by create-stackit' }
|
|
6
|
+
|
|
7
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
8
|
+
return (
|
|
9
|
+
<html lang="en">
|
|
10
|
+
<body>
|
|
11
|
+
<ThemeProvider theme={theme}>
|
|
12
|
+
<CssBaseline />
|
|
13
|
+
{children}
|
|
14
|
+
</ThemeProvider>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
17
|
+
)
|
|
18
|
+
}
|