stackkit 0.1.9 → 0.2.1

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.
@@ -2,9 +2,21 @@
2
2
 
3
3
  Production-ready Next.js starter with TypeScript and App Router.
4
4
 
5
+ ## Requirements
6
+
7
+ - Node.js 18+ (LTS recommended)
8
+ - pnpm or npm
9
+
5
10
  ## Quick Start
6
11
 
12
+ Install dependencies and start a development server:
13
+
7
14
  ```bash
15
+ # using pnpm (recommended)
16
+ pnpm install
17
+ pnpm dev
18
+
19
+ # or using npm
8
20
  npm install
9
21
  npm run dev
10
22
  ```
@@ -40,7 +52,7 @@ public/ # Static assets
40
52
 
41
53
  ## Environment Variables
42
54
 
43
- Create `.env.local` file for environment variables.
55
+ Create a `.env.local` (Next.js) file for local environment variables. Keep secrets out of the repository.
44
56
 
45
57
  ## Deployment
46
58
 
@@ -50,3 +62,14 @@ npm run start
50
62
  ```
51
63
 
52
64
  Deploy to Vercel, Netlify, or any Node.js hosting service.
65
+
66
+ ---
67
+
68
+ ## Generated with StackKit
69
+
70
+ This project was scaffolded using **StackKit** — a CLI toolkit for building production-ready applications.
71
+
72
+ - Generated via: `npx stackkit@latest create`
73
+
74
+ Learn more about StackKit:
75
+ https://github.com/tariqul420/stackkit
@@ -5,7 +5,7 @@ export default function Home() {
5
5
  <div className="flex min-h-screen items-center justify-center bg-zinc-50 font-sans dark:bg-black">
6
6
  <main className="flex min-h-screen w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-white dark:bg-black sm:items-start">
7
7
  <div className="flex items-center gap-4 mb-8">
8
- <div className="text-2xl font-bold text-black dark:text-white">Stackkit</div>
8
+ <div className="text-2xl font-bold text-black dark:text-white">StackKit</div>
9
9
  <span className="text-xl text-zinc-400">+</span>
10
10
  <Image
11
11
  className="dark:invert"
@@ -21,14 +21,14 @@ export default function Home() {
21
21
  To get started, edit the page.tsx file.
22
22
  </h1>
23
23
  <p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400">
24
- This template includes Next.js, Tailwind CSS, and Stackkit best practices. Check out the{" "}
24
+ This template includes Next.js, Tailwind CSS, and StackKit best practices. Check out the{" "}
25
25
  <a
26
26
  href="https://github.com/tariqul420/stackkit"
27
27
  className="font-medium text-zinc-950 dark:text-zinc-50 hover:underline"
28
28
  target="_blank"
29
29
  rel="noopener noreferrer"
30
30
  >
31
- Stackkit repository
31
+ StackKit repository
32
32
  </a>{" "}
33
33
  for more info.
34
34
  </p>
@@ -9,7 +9,9 @@
9
9
  },
10
10
  "files": [
11
11
  "app/",
12
+ "lib/",
12
13
  "public/",
14
+ ".env.example",
13
15
  ".gitignore",
14
16
  "eslint.config.mjs",
15
17
  "next-env.d.ts",
@@ -2,11 +2,23 @@
2
2
 
3
3
  Production-ready React starter with TypeScript, Vite, and essential libraries.
4
4
 
5
+ ## Requirements
6
+
7
+ - Node.js 18+ (LTS recommended)
8
+ - pnpm (recommended) or npm
9
+
5
10
  ## Quick Start
6
11
 
12
+ Install dependencies and run the dev server:
13
+
7
14
  ```bash
15
+ # using pnpm (recommended)
8
16
  pnpm install
9
17
  pnpm dev
18
+
19
+ # or using npm
20
+ npm install
21
+ npm run dev
10
22
  ```
11
23
 
12
24
  ## Features
@@ -27,7 +39,9 @@ pnpm dev
27
39
 
28
40
  ## Environment Variables
29
41
 
30
- Copy `.env.example` to `.env` and configure:
42
+ Copy `.env.example` to `.env` and configure local values. Do not commit secrets.
43
+
44
+ Example:
31
45
 
32
46
  ```env
33
47
  VITE_API_URL=http://localhost:3000/api
@@ -49,8 +63,27 @@ src/
49
63
 
50
64
  ## Deployment
51
65
 
66
+ Build for production and serve or deploy the static output:
67
+
52
68
  ```bash
69
+ # pnpm
53
70
  pnpm build
71
+ pnpm preview
72
+
73
+ # npm
74
+ npm run build
75
+ npm run preview
54
76
  ```
55
77
 
56
- Deploy the `dist` folder to Vercel, Netlify, or any static hosting service.
78
+ Deploy the resulting `dist`/build output to your hosting platform (Vercel, Netlify, etc.).
79
+
80
+ ---
81
+
82
+ ## Generated with StackKit
83
+
84
+ This project was scaffolded using **StackKit** — a CLI toolkit for building production-ready applications.
85
+
86
+ - Generated via: `npx stackkit@latest create`
87
+
88
+ Learn more about StackKit:
89
+ https://github.com/tariqul420/stackkit
@@ -3,8 +3,8 @@ import { QueryClient } from "@tanstack/react-query";
3
3
  export const queryClient = new QueryClient({
4
4
  defaultOptions: {
5
5
  queries: {
6
- staleTime: 1000 * 60 * 5, // 5 minutes
7
- gcTime: 1000 * 60 * 10, // 10 minutes (formerly cacheTime)
6
+ staleTime: 1000 * 60 * 5,
7
+ gcTime: 1000 * 60 * 10,
8
8
  retry: 1,
9
9
  refetchOnWindowFocus: false,
10
10
  },
@@ -7,7 +7,7 @@ export default function Home() {
7
7
  <div className="flex min-h-screen items-center justify-center bg-black">
8
8
  <main className="flex min-h-screen w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-black sm:items-start">
9
9
  <div className="flex items-center gap-4 mb-8">
10
- <div className="text-2xl font-bold text-white">Stackkit</div>
10
+ <div className="text-2xl font-bold text-white">StackKit</div>
11
11
  <span className="text-xl text-zinc-400">+</span>
12
12
  <img src="https://react.dev/favicon.ico" alt="React logo" width={32} height={32} />
13
13
  </div>
@@ -28,7 +28,7 @@ export default function Home() {
28
28
 
29
29
  <div className="flex flex-col gap-4 text-base font-medium sm:flex-row">
30
30
  <a
31
- className="flex h-12 w-full items-center justify-center rounded-full bg-white text-black px-5 transition-colors hover:bg-zinc-200 md:w-39.5"
31
+ className="flex h-12 w-full items-center justify-center rounded-full bg-white text-black px-5 transition-colors hover:bg-zinc-200 md:w-40"
32
32
  href="https://react.dev"
33
33
  target="_blank"
34
34
  rel="noopener noreferrer"
@@ -36,7 +36,7 @@ export default function Home() {
36
36
  Get Started
37
37
  </a>
38
38
  <a
39
- className="flex h-12 w-full items-center justify-center rounded-full px-5 transition-colors hover:border-transparent bg-zinc-900 md:w-39.5 dark:text-white text-black"
39
+ className="flex h-12 w-full items-center justify-center rounded-full bg-black text-white px-5 transition-colors hover:bg-zinc-900 md:w-40"
40
40
  href="/about"
41
41
  >
42
42
  Documentation
@@ -0,0 +1,3 @@
1
+ export function cn(...classes: (string | boolean | undefined | null)[]): string {
2
+ return classes.filter(Boolean).join(" ");
3
+ }
@@ -12,6 +12,8 @@
12
12
  "public/",
13
13
  ".env.example",
14
14
  ".gitignore",
15
+ ".prettierignore",
16
+ ".prettierrc",
15
17
  "eslint.config.js",
16
18
  "index.html",
17
19
  "package.json",
@@ -1,5 +0,0 @@
1
- export const APP_NAME = import.meta.env.VITE_APP_NAME || "React App";
2
- export const APP_VERSION = import.meta.env.VITE_APP_VERSION || "1.0.0";
3
- export const API_URL = import.meta.env.VITE_API_URL || "http://localhost:3000/api";
4
- export const IS_DEV = import.meta.env.DEV;
5
- export const IS_PROD = import.meta.env.PROD;
@@ -1,64 +0,0 @@
1
- import { useEffect, useState } from "react";
2
-
3
- export function useDebounce<T>(value: T, delay: number): T {
4
- const [debouncedValue, setDebouncedValue] = useState<T>(value);
5
-
6
- useEffect(() => {
7
- const handler = setTimeout(() => {
8
- setDebouncedValue(value);
9
- }, delay);
10
-
11
- return () => {
12
- clearTimeout(handler);
13
- };
14
- }, [value, delay]);
15
-
16
- return debouncedValue;
17
- }
18
-
19
- export function useLocalStorage<T>(
20
- key: string,
21
- initialValue: T,
22
- ): [T, (value: T | ((val: T) => T)) => void] {
23
- const [storedValue, setStoredValue] = useState<T>(() => {
24
- try {
25
- const item = window.localStorage.getItem(key);
26
- return item ? JSON.parse(item) : initialValue;
27
- } catch (error) {
28
- console.error(error);
29
- return initialValue;
30
- }
31
- });
32
-
33
- const setValue = (value: T | ((val: T) => T)) => {
34
- try {
35
- const valueToStore = value instanceof Function ? value(storedValue) : value;
36
- setStoredValue(valueToStore);
37
- window.localStorage.setItem(key, JSON.stringify(valueToStore));
38
- } catch (error) {
39
- console.error(error);
40
- }
41
- };
42
-
43
- return [storedValue, setValue];
44
- }
45
-
46
- export function useMediaQuery(query: string): boolean {
47
- const [matches, setMatches] = useState(() => {
48
- if (typeof window !== "undefined") {
49
- return window.matchMedia(query).matches;
50
- }
51
- return false;
52
- });
53
-
54
- useEffect(() => {
55
- const media = window.matchMedia(query);
56
-
57
- const listener = () => setMatches(media.matches);
58
- media.addEventListener("change", listener);
59
-
60
- return () => media.removeEventListener("change", listener);
61
- }, [query]);
62
-
63
- return matches;
64
- }
@@ -1,51 +0,0 @@
1
- export function cn(...classes: (string | boolean | undefined | null)[]): string {
2
- return classes.filter(Boolean).join(" ");
3
- }
4
-
5
- export function formatDate(date: Date | string): string {
6
- const d = typeof date === "string" ? new Date(date) : date;
7
- return d.toLocaleDateString("en-US", {
8
- year: "numeric",
9
- month: "long",
10
- day: "numeric",
11
- });
12
- }
13
-
14
- export function truncate(str: string, maxLength: number): string {
15
- if (str.length <= maxLength) return str;
16
- return str.slice(0, maxLength) + "...";
17
- }
18
-
19
- export function delay(ms: number): Promise<void> {
20
- return new Promise((resolve) => setTimeout(resolve, ms));
21
- }
22
-
23
- export function debounce<T extends (...args: never[]) => unknown>(
24
- func: T,
25
- wait: number,
26
- ): (...args: Parameters<T>) => void {
27
- let timeout: ReturnType<typeof setTimeout> | null = null;
28
-
29
- return function executedFunction(...args: Parameters<T>) {
30
- const later = () => {
31
- timeout = null;
32
- func(...args);
33
- };
34
-
35
- if (timeout) clearTimeout(timeout);
36
- timeout = setTimeout(later, wait);
37
- };
38
- }
39
-
40
- export function capitalize(str: string): string {
41
- return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
42
- }
43
-
44
- export function slugify(str: string): string {
45
- return str
46
- .toLowerCase()
47
- .trim()
48
- .replace(/[^\w\s-]/g, "")
49
- .replace(/[\s_-]+/g, "-")
50
- .replace(/^-+|-+$/g, "");
51
- }