zerostarter 0.0.6

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 (3) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +274 -0
  3. package/package.json +140 -0
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Neeraj Dalal
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,274 @@
1
+ # ZeroStarter - The SaaS Starter
2
+
3
+ A modern, type-safe, and high-performance SaaS starter template built with a monorepo architecture.
4
+
5
+ - **📚 Documentation**: For comprehensive documentation, visit **[https://zerostarter.dev/docs](https://zerostarter.dev/docs)**.
6
+ - **🤖 AI/LLM Users**: For optimized documentation, use **[https://zerostarter.dev/llms.txt](https://zerostarter.dev/llms.txt)**.
7
+ - **🐦 X**: Follow **[@nrjdalal](https://twitter.com/nrjdalal)** for updates and don't forget to star the repository!
8
+
9
+ > [!IMPORTANT]
10
+ > **Release Candidate (RC) Status**: ZeroStarter is currently in **Release Candidate (RC)** status. All implemented features are stable and production-ready. We're actively adding new features and integrations day-by-day.
11
+
12
+ <!--
13
+ ```bash
14
+ npx turbo run build --graph=graph.svg
15
+ sed -i '' 's/\[root\] //g; s/#build//g; s/___ROOT___/ZeroStarter/g' graph.svg
16
+ sed -i '' 's/fill="white"/fill="none"/g; s/fill="#ffffff"/fill="none"/g; s/fill="#fff"/fill="none"/g' graph.svg
17
+ sed -i '' 's/fill="black"/fill="#1f6feb"/g' graph.svg
18
+ sed -i '' 's/stroke="[^"]*"/stroke="#1f6feb"/g; s/stroke:[^;]*;/stroke:#1f6feb;/g' graph.svg
19
+ sed -i '' 's/<text\([^>]*\)>/<text\1 fill="#1f6feb">/g' graph.svg
20
+ sed -i '' 's/stroke="#1f6feb" points="-4,4/stroke="none" points="-4,4/g' graph.svg
21
+ mkdir -p .github/assets
22
+ mv graph.svg .github/assets/graph-build.svg
23
+ ```
24
+ -->
25
+
26
+ ## Architecture and Tech Stack
27
+
28
+ ![Graph Build](./.github/assets/graph-build.svg)
29
+
30
+ - **Runtime & Build System**: [Bun](https://bun.sh) + [Turborepo](https://turbo.build)
31
+ - **Frontend**: [Next.js 16](https://nextjs.org)
32
+ - **Backend**: [Hono](https://hono.dev)
33
+ - **RPC**: [Hono Client](https://hono.dev/docs/guides/rpc) for end-to-end type safety with frontend client
34
+ - **Database**: [PostgreSQL](https://www.postgresql.org) with [Drizzle ORM](https://orm.drizzle.team)
35
+ - **Authentication**: [Better Auth](https://better-auth.com)
36
+ - **Styling**: [Tailwind CSS](https://tailwindcss.com)
37
+ - **UI Components**: [Shadcn UI](https://ui.shadcn.com)
38
+ - **Data Fetching**: [TanStack Query](https://tanstack.com/query/latest)
39
+ - **Validation**: [Zod](https://zod.dev)
40
+ - **Bundling, Linting & Formatting**: [tsdown](https://tsdown.dev), [Oxlint](https://oxc.rs/docs/guide/usage/linter) and [Prettier](https://prettier.io)
41
+ - **Documentation**: [Fumadocs](https://fumadocs.dev) with auto-generated [llms.txt](https://zerostarter.dev/llms.txt)
42
+ - **Automated Releases**: Automatically updated [Changelog](https://github.com/nrjdalal/zerostarter/releases) on release
43
+
44
+ ### Future Stack and Features
45
+
46
+ - **AI**
47
+ - [ ] [Vercel AI SDK](https://ai-sdk.dev)
48
+ - **Analytics**:
49
+ - [ ] [Posthog](https://posthog.com)
50
+ - **Background Tasks**:
51
+ - [ ] [Inngest](https://www.inngest.com)
52
+ - [ ] [Trigger.dev](https://trigger.dev)
53
+ - **Email**:
54
+ - [ ] [Resend](https://resend.com)
55
+ - [ ] [SendGrid](https://sendgrid.com)
56
+ - **OpenAPI**:
57
+ - [ ] [Scalar](https://scalar.com)
58
+ - **Organization/teams**:
59
+ - [ ] [Better Auth](https://www.better-auth.com/docs/plugins/organization)
60
+ - **Internationalization**:
61
+ - [ ] [i18next](https://www.i18next.com)
62
+ - [ ] [next-intl](https://next-intl.dev)
63
+ - **Payment Processing**:
64
+ - [ ] [Autumn](https://useautumn.com)
65
+ - [ ] [Creem](https://www.creem.io)
66
+ - [ ] [Dodo](https://dodopayments.com)
67
+ - [ ] [Lemon Squeezy](https://www.lemonsqueezy.com)
68
+ - [ ] [Paddle](https://www.paddle.com)
69
+ - [ ] [Polar](https://polar.sh)
70
+ - [ ] [Razorpay](https://razorpay.com)
71
+ - [ ] [Stripe](https://stripe.com)
72
+
73
+ ---
74
+
75
+ ## 📂 Project Structure
76
+
77
+ This project is a monorepo organized as follows:
78
+
79
+ ```
80
+ .
81
+ ├── api/
82
+ │ └── hono/ # Backend API server (Hono)
83
+ ├── web/
84
+ │ └── next/ # Frontend application (Next.js)
85
+ └── packages/
86
+ ├── auth/ # Shared authentication logic (Better Auth)
87
+ ├── db/ # Database schema and Drizzle configuration
88
+ ├── env/ # Type-safe environment variables
89
+ └── tsconfig/ # Shared TypeScript configuration
90
+ ```
91
+
92
+ ---
93
+
94
+ ## 🔌 Type-Safe API Client
95
+
96
+ This starter utilizes [Hono RPC](https://hono.dev/docs/guides/rpc) to provide end-to-end type safety between the backend and frontend.
97
+
98
+ - **Backend**: Routes defined in `api/hono/src/routers` are exported as `AppType` at `api/hono/src/index.ts`.
99
+ - **Frontend**: The client at `web/next/src/lib/api/client.ts` infers `AppType` request/response types using `hono/client`.
100
+
101
+ ### Usage Example
102
+
103
+ ```ts
104
+ import { apiClient } from "@/lib/api/client"
105
+
106
+ // Fully typed request and response
107
+ const res = await apiClient.health.$get()
108
+ const data = await res.json()
109
+ ```
110
+
111
+ ---
112
+
113
+ ## ⚙️ Getting Started
114
+
115
+ ### Prerequisites
116
+
117
+ - [Bun](https://bun.sh) (v1.3.0 or later)
118
+
119
+ ### Installation
120
+
121
+ 1. Clone this template:
122
+
123
+ ```bash
124
+ bunx gitpick https://github.com/nrjdalal/zerostarter/tree/main
125
+ cd zerostarter
126
+ ```
127
+
128
+ > **Note**: The `main` branch is the latest stable release.
129
+
130
+ 2. Install dependencies:
131
+
132
+ ```bash
133
+ bun install
134
+ ```
135
+
136
+ > **Note**: If the installation fails, try using `bun install --ignore-scripts`
137
+
138
+ 3. Set up environment variables:
139
+
140
+ Create a `.env` file in the root directory with the following variables:
141
+
142
+ ```
143
+ # -------------------- Server variables --------------------
144
+
145
+ HONO_APP_URL=http://localhost:4000
146
+ HONO_TRUSTED_ORIGINS=http://localhost:3000
147
+
148
+ # Generate using `openssl rand -base64 32`
149
+ BETTER_AUTH_SECRET=
150
+
151
+ # Generate at `https://github.com/settings/developers`
152
+ GITHUB_CLIENT_ID=
153
+ GITHUB_CLIENT_SECRET=
154
+
155
+ # Generate at `https://console.cloud.google.com/apis/credentials`
156
+ GOOGLE_CLIENT_ID=
157
+ GOOGLE_CLIENT_SECRET=
158
+
159
+ # Generate using `bunx pglaunch -k`
160
+ POSTGRES_URL=
161
+
162
+ # -------------------- Client variables --------------------
163
+
164
+ NEXT_PUBLIC_APP_URL=http://localhost:3000
165
+ NEXT_PUBLIC_API_URL=http://localhost:4000
166
+ ```
167
+
168
+ ### Database Setup
169
+
170
+ 1. Ensure your PostgreSQL server is running.
171
+ 2. Run the generation:
172
+
173
+ ```bash
174
+ bun run db:generate
175
+ ```
176
+
177
+ 3. Run the migration:
178
+
179
+ ```bash
180
+ bun run db:migrate
181
+ ```
182
+
183
+ ### Authentication Setup
184
+
185
+ ZeroStarter comes with some default authentication plugins using [Better Auth](https://better-auth.com), you can extend as needed.
186
+
187
+ #### Github
188
+
189
+ 1. Create a GitHub OAuth App at [GitHub Developer Settings](https://github.com/settings/developers).
190
+ 2. Set the **Homepage URL** to `http://localhost:3000`.
191
+ 3. Set the **Authorization callback URL** to `http://localhost:3000/api/auth/callback/github`.
192
+ 4. Copy the **Client ID** and **Client Secret** into your `.env` file.
193
+
194
+ #### Google
195
+
196
+ 1. Create a Google OAuth App in the [Google Cloud Console](https://console.cloud.google.com/apis/credentials.
197
+ 2. Configure the OAuth consent screen (External).
198
+ 3. Create an **OAuth Client ID** (Application type: Web).
199
+ 4. Set the **Authorized JavaScript origins** to `http://localhost:3000`.
200
+ 5. Set the **Authorized redirect URI** to `http://localhost:4000/api/auth/callback/google`.
201
+ 6. Copy the **Client ID** and **Client Secret** into your `.env` file.
202
+
203
+ ### Running the Application
204
+
205
+ ```bash
206
+ bun dev
207
+ ```
208
+
209
+ ### Running the Application with Docker Compose
210
+
211
+ ```bash
212
+ docker compose up
213
+ ```
214
+
215
+ ### Accessing the Application
216
+
217
+ - Frontend: [http://localhost:3000](http://localhost:3000)
218
+ - Backend: [http://localhost:4000](http://localhost:4000)
219
+
220
+ ---
221
+
222
+ ## 📜 Scripts
223
+
224
+ ### Development
225
+
226
+ - `bun run dev`: Start the development servers.
227
+
228
+ ### Maintenance
229
+
230
+ - `bun run clean`: Clean the cache and build artifacts.
231
+ - `bun run lint`: Lint the codebase using Oxlint.
232
+ - `bun run format`: Format the codebase using Prettier.
233
+ - `bun run check-types`: Check the types of the codebase.
234
+
235
+ ### Production
236
+
237
+ - `bun run build`: Build the applications.
238
+ - `bun run start`: Start the production servers.
239
+
240
+ ### Database
241
+
242
+ - `bun run db:generate`: Generate Drizzle migrations.
243
+ - `bun run db:migrate`: Run Drizzle migrations.
244
+ - `bun run db:studio`: Open Drizzle Studio to view/edit data.
245
+
246
+ ## 📖 Deployment
247
+
248
+ - **Frontend**:
249
+ - [Vercel](.github/docs/deployment/vercel.md#vercel)
250
+ - **Backend**:
251
+ - [Vercel](.github/docs/deployment/vercel.md#vercel-1)
252
+
253
+ ## 🤝 Contributing
254
+
255
+ Contributions welcome — any help is appreciated!
256
+
257
+ - Fork the repo and create a branch (use descriptive names, e.g. `feat/{name}` or `fix/{name}`).
258
+ - Make your changes, add tests if applicable, and run the checks:
259
+ - `bun run build`
260
+ - `bun run check-types`
261
+ - `bun run format`
262
+ - `bun run lint`
263
+ - Follow the existing code style and commit message conventions (use conventional commits: feat, fix, docs, chore).
264
+ - Open a PR describing the change, motivation, and any migration notes; link related issues.
265
+ - For breaking changes or large features, open an issue first to discuss the approach.
266
+ - By contributing you agree to the MIT license and the project's Code of Conduct.
267
+
268
+ Thank you for helping improve ZeroStarter!
269
+
270
+ ## 📄 License
271
+
272
+ This project is licensed under the [MIT](https://github.com/nrjdalal/zerostarter/blob/canary/LICENSE.md) License.
273
+
274
+ <!-- trigger build: 4 -->
package/package.json ADDED
@@ -0,0 +1,140 @@
1
+ {
2
+ "name": "zerostarter",
3
+ "version": "0.0.6",
4
+ "homepage": "https://github.com/nrjdalal/zerostarter#readme",
5
+ "bugs": "https://github.com/nrjdalal/zerostarter/issues",
6
+ "repository": "nrjdalal/zerostarter",
7
+ "funding": "https://github.com/sponsors/nrjdalal",
8
+ "license": "MIT",
9
+ "files": [],
10
+ "author": {
11
+ "name": "Neeraj Dalal",
12
+ "email": "admin@nrjdalal.com",
13
+ "url": "https://nrjdalal.com"
14
+ },
15
+ "workspaces": [
16
+ "api/*",
17
+ "packages/*",
18
+ "web/*"
19
+ ],
20
+ "scripts": {
21
+ "build": "turbo build --summarize",
22
+ "check-types": "SKIP_ENV_VALIDATION=true turbo check-types --summarize",
23
+ "clean": "bunx rimraf --glob \"**/.next\" \"**/.source\" \"**/.turbo\" \"**/dist\" \"**/node_modules\" && bunx delete-empty",
24
+ "db:generate": "turbo build --filter=@packages/* && bun --cwd packages/db drizzle-kit generate",
25
+ "db:migrate": "turbo build --filter=@packages/* && bun --cwd packages/db drizzle-kit migrate",
26
+ "db:studio": "turbo build --filter=@packages/* && bun --cwd packages/db drizzle-kit studio",
27
+ "predev": "turbo build --filter=@packages/*",
28
+ "dev": "turbo dev --ui tui",
29
+ "devtools": "turbo devtools",
30
+ "format": "prettier --write --ignore-unknown *",
31
+ "postinstall": "bun .github/scripts/deps-manager.ts",
32
+ "lint": "turbo lint --summarize",
33
+ "prepare": "bunx simple-git-hooks",
34
+ "start": "turbo start"
35
+ },
36
+ "simple-git-hooks": {
37
+ "pre-commit": "bunx lint-staged --verbose && bun run build",
38
+ "commit-msg": "bunx commitlint --edit $1"
39
+ },
40
+ "commitlint": {
41
+ "extends": [
42
+ "@commitlint/config-conventional"
43
+ ]
44
+ },
45
+ "lint-staged": {
46
+ "*": [
47
+ "oxlint",
48
+ "prettier --write --ignore-unknown"
49
+ ],
50
+ "package.json": [
51
+ "bun .github/scripts/deps-manager.ts",
52
+ "sort-package-json"
53
+ ]
54
+ },
55
+ "prettier": {
56
+ "printWidth": 100,
57
+ "semi": false
58
+ },
59
+ "devDependencies": {
60
+ "@commitlint/cli": "catalog:",
61
+ "@commitlint/config-conventional": "catalog:",
62
+ "@ianvs/prettier-plugin-sort-imports": "catalog:",
63
+ "@octokit/rest": "catalog:",
64
+ "@types/bun": "catalog:",
65
+ "@types/node": "catalog:",
66
+ "globby": "catalog:",
67
+ "lint-staged": "catalog:",
68
+ "oxlint": "catalog:",
69
+ "prettier": "catalog:",
70
+ "prettier-plugin-tailwindcss": "catalog:",
71
+ "simple-git-hooks": "catalog:",
72
+ "sort-package-json": "catalog:",
73
+ "turbo": "catalog:"
74
+ },
75
+ "packageManager": "bun@1.3.5",
76
+ "catalog": {
77
+ "@commitlint/cli": "^20.2.0",
78
+ "@commitlint/config-conventional": "^20.2.0",
79
+ "@fontsource-variable/dm-sans": "^5.2.8",
80
+ "@fontsource-variable/jetbrains-mono": "^5.2.8",
81
+ "@hono/zod-validator": "^0.7.6",
82
+ "@hookform/resolvers": "^5.2.2",
83
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
84
+ "@octokit/rest": "^22.0.1",
85
+ "@remixicon/react": "^4.7.0",
86
+ "@t3-oss/env-core": "^0.13.10",
87
+ "@tailwindcss/postcss": "^4.1.18",
88
+ "@tanstack/react-form": "^1.27.6",
89
+ "@tanstack/react-query": "^5.90.12",
90
+ "@tanstack/react-query-devtools": "^5.91.1",
91
+ "@types/bun": "latest",
92
+ "@types/mdx": "^2.0.13",
93
+ "@types/node": "latest",
94
+ "@types/react": "^19.2.1",
95
+ "@types/react-dom": "^19.2.1",
96
+ "babel-plugin-react-compiler": "^1.0.0",
97
+ "better-auth": "^1.4.9",
98
+ "class-variance-authority": "^0.7.1",
99
+ "clsx": "^2.1.1",
100
+ "cmdk": "^1.1.1",
101
+ "concurrently": "^9.2.1",
102
+ "date-fns": "^4.1.0",
103
+ "dotenv": "^17.2.3",
104
+ "drizzle-kit": "^0.31.8",
105
+ "drizzle-orm": "^0.45.1",
106
+ "embla-carousel-react": "^8.6.0",
107
+ "fumadocs-core": "^16.3.2",
108
+ "fumadocs-mdx": "^14.2.2",
109
+ "fumadocs-ui": "^16.3.2",
110
+ "globby": "^16.1.0",
111
+ "hono": "^4.11.1",
112
+ "input-otp": "^1.4.2",
113
+ "lint-staged": "^16.2.7",
114
+ "lucide-react": "^0.562.0",
115
+ "next": "^16.1.1",
116
+ "next-themes": "^0.4.6",
117
+ "oxlint": "^1.35.0",
118
+ "postgres": "^3.4.7",
119
+ "prettier": "^3.7.4",
120
+ "prettier-plugin-tailwindcss": "^0.7.2",
121
+ "radix-ui": "^1.4.3",
122
+ "react": "^19.2.3",
123
+ "react-day-picker": "^9.13.0",
124
+ "react-dom": "^19.2.3",
125
+ "react-hook-form": "^7.69.0",
126
+ "react-resizable-panels": "^3.0.6",
127
+ "recharts": "2.15.4",
128
+ "simple-git-hooks": "^2.13.1",
129
+ "sonner": "^2.0.7",
130
+ "sort-package-json": "^3.6.0",
131
+ "tailwind-merge": "^3.4.0",
132
+ "tailwindcss": "^4.1.18",
133
+ "tsdown": "^0.18.2",
134
+ "turbo": "^2.7.1",
135
+ "tw-animate-css": "^1.4.0",
136
+ "typescript": "^5.9.3",
137
+ "vaul": "^1.1.2",
138
+ "zod": "^4.2.1"
139
+ }
140
+ }