Skip to content

Commit 30b9acc

Browse files
committed
chore: wip
1 parent 48dd8a4 commit 30b9acc

File tree

11 files changed

+411
-0
lines changed

11 files changed

+411
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ custom-cli
2323
.idea
2424
.stacks
2525
.vscode
26+
.cursor
2627
.zed
2728
./test.ts
2829
resources/assets/fonts/*.woff
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
description: Code Style & Structure specifics
3+
globs:
4+
---
5+
## Code Style & Structure
6+
7+
- Write concise, technical TypeScript code with accurate examples in the docblock
8+
- If Bun native modules are available, use them
9+
- Use functional and declarative programming patterns; avoid classes unless needed
10+
- Prefer iteration and modularization over code duplication
11+
- Use descriptive variable names with auxiliary verbs (e.g., `isLoading`, `hasError`)
12+
- Use proper jsdoc comments for functions, types, interfaces, and ensure examples are accurate
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
description: Documentation specific rules
3+
globs: docs/**/*.md
4+
---
5+
## Documentation
6+
7+
- Write documentation for all functions, types, interfaces, and ensure examples are accurate
8+
- The `./docs` directory is where the vitepress markdown documentation is stored
9+
- Make sure to update the docs markdown files
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
description: Error Handling and Validation specifics
3+
globs:
4+
---
5+
## Error Handling and Validation
6+
7+
- Prioritize error handling: handle errors and edge cases early
8+
- Use early returns and guard clauses
9+
- Implement proper error logging and user-friendly messages
10+
- Use error boundaries for unexpected errors
11+
- Use `@stacksjs/error-handling`, which is similar to neverthrow, to handle errors and responses
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
description: Key code conventions
3+
globs:
4+
---
5+
## Key Conventions
6+
7+
- If there are two equally valid implementations, the browser version should be preferred
8+
- Aim for 100% test coverage
9+
- Avoid usage of `any`
10+
- Reuse eslint-ignore comments where present, unless not needed
11+
- ensure we log everything properly, including for debug reasons
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
description: Project structure information
3+
globs:
4+
---
5+
## Project Structure
6+
7+
- the `./src` directory is the source code
8+
- the `./test` directory is the test code
9+
- the `./bin` directory is the command-line code
10+
- you can also call the CLI via `./clarity ...`
11+
- the `./docs` directory is the documentation
Lines changed: 328 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,328 @@
1+
---
2+
description: General information based on the latest ./README.md content
3+
globs:
4+
---
5+
# Rapid App & Library Development
6+
7+
Stacks is a rapid development framework, where the goal is to _help you_ create & maintain frontends, backends, and clouds—without having to worry about the boilerplate. _An all-in-one toolkit that meets all your full stack needs._
8+
9+
- Web & Desktop Applications _(including system tray apps)_
10+
- Serverless & Traditional APIs
11+
- Cloud Infrastructure Creation & Maintenance
12+
- Interactive CLIs
13+
- Framework-agnostic Component & Function Libraries
14+
- Deployment & Release Manager _(CI & CD)_
15+
16+
## Convention Over Configuration
17+
18+
As a developer, Stacks helps you every step along the way—in beginner & expert-friendly ways, allowing you to focus on the _what & why_ of your project, all while enabling you to stay in control & ownership of your _(& your users’)_ data.
19+
20+
> “It is the framework’s responsibility to remove patterns that lead to boilerplate code. And Stacks is really good at that.” _- Chris_
21+
22+
<!-- ![Atomic UI & FX Design](./docs/assets/diagram.png) -->
23+
24+
## Get Started
25+
26+
It’s incredibly easy to get started with this framework. Simply run the following command in your terminal:
27+
28+
```bash
29+
curl -Ssf stacksjs.org/install | sh # wip
30+
31+
# alternatively, if Bun >= v1.2.0 is installed already,
32+
# you may also get started via:
33+
bunx buddy new my-project
34+
```
35+
36+
## Usage
37+
38+
The following list includes some of the most common ways to interact with the Stacks API.
39+
40+
_Meet the toolkit, Buddy:_
41+
42+
```bash
43+
buddy install # installs all dependencies
44+
buddy dev # starts one of the dev servers (frontend, API, components, docs, desktop, etc.)
45+
buddy share # creates a sharable link of your local project
46+
buddy build # follow CLI prompts to select which library (or server) to build
47+
buddy commit # follow CLI prompts for committing changes
48+
buddy release # creates the releases for the stack & consequently, publishes them to npm
49+
buddy upgrade # auto-update all deps & the Stacks framework
50+
51+
buddy make:component HelloWorld # scaffolds a Component
52+
buddy make:function HelloWorld # scaffolds a Function
53+
buddy make:model Car # scaffolds a Model
54+
buddy make:action UpdateCar # scaffolds an Action
55+
buddy make:migration create_cars_table # scaffolds a Migration
56+
buddy make:view Car # scaffolds a Page (https://my-project.test/car)
57+
buddy make:command Inspire # scaffolds a Command
58+
buddy make:job SendEmail # scaffolds a Job
59+
buddy make:middleware Logger # scaffolds a new Middleware
60+
buddy make:notification WelcomeEmail # scaffolds a Notification
61+
buddy make:lang de # scaffolds a language file
62+
63+
buddy list # lists all available commands
64+
buddy --help
65+
```
66+
67+
<details>
68+
<summary>View the complete Buddy Toolkit</summary>
69+
70+
```bash
71+
buddy --version # get the Stacks version
72+
buddy --help # view help menu
73+
# please note: you may suffix any command with the
74+
# `command --help` flag to review the help menu
75+
76+
buddy install # installs dependencies
77+
buddy add # adds a stack or dependency
78+
buddy fresh # fresh reinstall of all deps
79+
buddy clean # removes all deps
80+
buddy setup # sets up the project initially
81+
buddy setup:oh-my-zsh # optional: sets up Oh My Zsh with auto-completions & "aliases"
82+
83+
buddy upgrade # upgrades all dependencies
84+
buddy upgrade -i # prompts you to select which updates to apply (wip)
85+
buddy upgrade:dependencies # auto-upgrades package.json deps
86+
buddy upgrade:framework # auto-upgrades deps & the Stacks framework
87+
buddy upgrade:search-engine # auto-upgrades configured search engine
88+
buddy upgrade:shell # upgrades the shell integration
89+
buddy upgrade:binary # upgrades the `stacks` binary
90+
buddy upgrade:bun # upgrades to latest project-defined Bun version
91+
buddy upgrade:all # auto-upgrades all of the above
92+
93+
# if you need any more info on any command listed here, you may suffix
94+
# any of them via the "help option", i.e. `buddy ... --help`
95+
96+
buddy dev # starts the frontend dev server
97+
buddy dev -i # prompts any of the dev servers (components, functions, views, docs, or api)
98+
buddy dev:api # starts the API dev server
99+
buddy dev:dashboard # starts the Admin/Dashboard dev server
100+
buddy dev:desktop # starts the Desktop dev server
101+
buddy dev:views # starts frontend dev server
102+
buddy dev:components # starts component dev server
103+
buddy dev:functions # stubs functions
104+
buddy dev:docs # starts local docs dev server
105+
buddy dev docs # also starts the local docs dev server (colon is optional for all commands)
106+
buddy development # `buddy dev` alias
107+
108+
buddy share # creates a sharable link to your local project
109+
110+
# for Laravel folks, `serve` may ring more familiar than the `dev` name. Hence, we aliased it:
111+
buddy serve
112+
buddy serve:components
113+
buddy serve:desktop
114+
buddy serve:views
115+
buddy serve:functions
116+
buddy serve:docs
117+
118+
# building for production (e.g. AWS, Google Cloud, npm, Vercel, Netlify, et al.)
119+
buddy build # select a specific build (follow CLI prompts)
120+
buddy build:views # builds SSG views
121+
buddy build:desktop # builds Desktop application
122+
buddy build:library # builds any or all libraries
123+
buddy build:functions # builds function library
124+
buddy build:components # builds Vue component library & Web Component library
125+
buddy build:web-components # builds framework agnostic Web Component library (i.e. Custom Elements)
126+
buddy build:vue-components # builds Vue 2 & 3-ready Component library
127+
buddy build:all # builds all your code
128+
129+
# `buddy build` aliases
130+
buddy prod
131+
buddy prod:components
132+
buddy prod:desktop
133+
buddy prod:library
134+
buddy prod:views
135+
buddy prod:functions
136+
buddy prod:vue-components
137+
buddy prod:web-components
138+
buddy prod:all
139+
buddy production # `buddy prod` alias
140+
141+
# sets your application key
142+
buddy key:generate
143+
144+
buddy make:component HelloWorld # bootstraps a HelloWorld component
145+
buddy make:function hello-world # bootstraps a hello-world function
146+
buddy make:view hello-world # bootstraps a hello-word page
147+
buddy make:model Car # bootstraps a Car model
148+
buddy make:database cars # creates a cars database
149+
buddy make:migration create_cars_table # creates a cars migration file
150+
buddy make:factory cars # creates a Car factory file
151+
buddy make:table cars # bootstraps a cars data table
152+
buddy make:notification welcome-email # bootstraps a welcome-email notification
153+
buddy make:lang de # bootstraps a lang/de.yml language file
154+
buddy make:stack my-project # shares logic with `bunx --bun stacks new my-project`
155+
156+
buddy migrate # runs database migrations
157+
buddy migrate:dns # sets the ./config/dns.ts file
158+
159+
buddy dns example.com # list all DNS records for example.com
160+
buddy dns example.com --type MX # list MX records for example.com (proxies dog)
161+
162+
buddy https httpie.io/hello
163+
# http [flags] [METHOD] URL [ITEM [ITEM]]
164+
buddy http --help
165+
buddy http PUT pie.dev/put X-API-Token:123 name=John # Custom HTTP method, HTTP headers and JSON data
166+
buddy http -v pie.dev/get # See the request that is being sent using one of the output options
167+
buddy http -f POST pie.dev/post hello=World # submitting forms
168+
buddy http --offline pie.dev/post hello=offline
169+
buddy http -a USERNAME POST https://api.github.com/repos/httpie/cli/issues/83/comments body='HTTPie is awesome! :heart:'
170+
buddy http pie.dev/post < files/data.json
171+
buddy http pie.dev/image/png > image.png
172+
buddy http --download pie.dev/image/png
173+
buddy http --session=logged-in -a username:password pie.dev/get API-Key:123
174+
buddy http --session=logged-in pie.dev/headers
175+
buddy http localhost:8000 Host:example.com
176+
177+
buddy lint # runs linter
178+
buddy lint:fix # runs linter and fixes issues
179+
180+
buddy commit # follow CLI prompts for committing staged changes
181+
buddy release # creates the releases for the stack & triggers the Release Action (workflow)
182+
buddy changelog # generates CHANGELOG.md
183+
184+
# when deploying your app/s to a remote server or cloud provider
185+
buddy deploy # select a specific deployment (follow CLI prompts)
186+
# buddy deploy:docs # deploys docs to AWS (or other configured provider)
187+
# buddy deploy:functions # deploys functions to AWS (or other configured provider)
188+
# buddy deploy:views # deploys views to AWS (or other configured provider)
189+
# buddy deploy:all # deploys all your code
190+
buddy undeploy # be careful: "undeploys" removes/deletes your deployed resources
191+
192+
buddy cloud:remove # removes cloud setup
193+
buddy cloud:cleanup # removes cloud setup & cleans up all potentially leftover resources
194+
buddy cloud:add --jump-box # adds a jump box to your cloud setup
195+
196+
# select the example to run (follow CLI prompts)
197+
buddy example # prompts you to select which example to run
198+
buddy example:vue # runs the Vue example
199+
buddy example:web-components # runs the Web Component example
200+
201+
# you likely won’t need to run these commands as they are auto-triggered, but they are available
202+
buddy generate # prompts you to select which generator to run
203+
buddy generate:types # generates types for your components, functions, & views
204+
buddy generate:entries # generates entry files for components, functions, & views
205+
buddy generate:web-types # generates Web Component types
206+
buddy generate:vscode-custom-data # generates VSCode custom data
207+
buddy generate:ide-helpers # generates IDE helpers
208+
buddy generate:component-meta # generates component meta
209+
buddy generate:all # runs all generators
210+
211+
# generates your application key
212+
buddy key:generate # generates your application key
213+
214+
# generate your TypeScript declarations
215+
buddy types:generate # generates types for your components, functions, & views
216+
buddy types:fix # auto-fixes types for your components, functions, & views
217+
218+
buddy domains # alias for `buddy domains:list`
219+
buddy domains:add stacksjs.org # adds a domain
220+
buddy domains:remove stacksjs.org # removes a domain
221+
buddy domains:list # lists all domains
222+
buddy domains:update # apply ./config/dns.ts updates
223+
buddy domains:purchase stacksjs.org # purchase a new domain
224+
225+
# test your stack
226+
buddy test # runs test suite (unit & e2e)
227+
buddy test:coverage # runs test coverage
228+
buddy test:types # runs typecheck
229+
230+
# the CLI may be triggered in any
231+
# of the following syntax:
232+
stx fresh
233+
buddy fresh
234+
bud fresh
235+
```
236+
237+
</details>
238+
239+
Read more here about the Stacks CLI in the documentation.
240+
241+
## Features
242+
243+
The Stacks framework is a harmony of several “engines” to build any web and/or desktop application, in highly scalable & privacy-friendly ways. It consists of the following engines:
244+
245+
### Frontend Development
246+
247+
_Develop dynamic UIs with helpers for atomic design, and much more._
248+
249+
- 🧩 **Components** _primitive to develop user interfaces_
250+
- 🤖 **Functions** _primitive to develop business logic (and grant your UI superpowers)_
251+
- 🎨 **UI Kit** _modern & deeply-integrated components_
252+
- 🌐 **Web** _“a routing & templating engine that makes sense”_
253+
- 🖥️ **Desktop** _transforms your web app into a desktop app, plus more_
254+
- 📝 **Documentation** _markdown-based documentation, auto-generated_
255+
- 📚 **Library** _auto-builds & manages component & function libraries_
256+
- ⚡️ Powered by Bun, Tauri, UnoCSS, Vite, VitePress and Vue
257+
258+
### Backend Development
259+
260+
_Develop serverless (or server) functions with countless helpers to build scalable & fast APIs._
261+
262+
- 🪄 **AI** _deep AI integrations & foundational model access_
263+
- 🤖 **APIs** _scalability & maintainability built-in_
264+
- 🏎️ **Cache** _unified caching for DynamoDB, Redis and more_
265+
- ⚙️ **CLIs** _create beautiful CLIs for Linux, Windows, and Mac (dependency-free binaries)_
266+
- 📀 **Database** _DynamoDB, SQLite, MySQL, Postgres, and more_
267+
- 👾 **Errors** _native type-safe error handling_
268+
- 🗓️ **Events** _functional event (front & backend) communication_
269+
- 📢 **Notifications** _emails, SMSs, direct, and push notifications & webhooks_
270+
- 🗺️ **ORM** _automated schemas for scale & a pretty API_
271+
- 💳 **Payments** _unified API for one-off & subscription billing methods for Stripe_
272+
- ⚙️ **Queues** _run any heavy workload in the background_
273+
- 🛠️ **Query Builder** _powerful, type-safe SQL query builder_
274+
- 💬 **Realtime** _“everything you need to build dynamic real-time apps”_
275+
- 🧭 **Router** _smart routing, file-based or Laravel-like_
276+
- 🔎 **Search Engine** _smart searching, advanced filtering & sorting, pagination, headless UI_
277+
- 💾 **Storage** _a secure-by-default File API that feels right_
278+
- 🧪 **Tinker** _a powerful TypeScript REPL_
279+
- 🌪️ **Validation** _e2e type-safety (true frontend & backend harmony)_
280+
- 🎯 **X-Ray** _all you need to debug, log & analyze_
281+
282+
### Cloud Development
283+
284+
_Develop & maintain cloud infrastructure with ease. “Imagine Vercel, Vapor and Forge having been unified.”_
285+
286+
- ☁️ **Server** _local development server & production-ready servers out-of-the-box_
287+
- ⛅️ **Serverless** _on-demand, auto-scaling, zero maintenance_
288+
- ⏰ **Alarms** _built-in cloud infrastructure monitoring to avoid surprises_
289+
- 🚏 **CDN** _zero-config, low-latency, request life-cycle hooks, optimized request compressions (Brotli & gzip)_
290+
- 🔀 **Domain** _version-controlled & zero-config domain management (e.g. DNS management)_
291+
- 🤖 **AI** _fine-tune a foundational model using your application data_
292+
- 📧 **Email** _secure & zero-setup <easy-peasy@custom-domains.com> mailboxes_
293+
- 🔐 **Firewall** _native web application firewall support_
294+
- 📦 **Storage** _unlimited cloud storage & automatic backups_
295+
- 🚜 **Maintenance** _maintain your cloud infrastructure with ease using Buddy & Stacks_
296+
- 🚦 **Infrastructure as Code** _version-controlled cloud infrastructure (AWS, Google next?)_
297+
298+
### CI/CD
299+
300+
_Focus on coding, not publishing._
301+
302+
- 🚀 **Deployment Manager** _takes the sweat out of production deployments—zero-setup push-to-deploy_
303+
- 0️⃣ **Zero Downtime** _deploy with confidence using a zero-downtime deployment strategy_
304+
- 📫 **Release Manager** _libraries (component & function) auto-published to npm, git helpers, and more_
305+
306+
### Developer Experience (DX)
307+
308+
Convention over configuration, while staying wholly configurable. _No more boilerplate._
309+
310+
- 💎 **Automated Upgrades** _no need to worry about upgrading to the latest versions, Stacks upgrades you_
311+
- 🦋 **Pretty Dev URLs** _your-project.localhost instead of localhost:3000_
312+
- 💡 **IDE Integration** _auto-completions, inline docs & a powerful VS Code setup_
313+
- 🪄 **Zero-Config** _yet highly configurable—convention over configuration_
314+
- 💅 **Linter & Formatter** _auto-configured & built into your IDE_
315+
- 💪🏼 **Type Strong** _built-in e2e type-safety_
316+
- ✨ **Git Workflows** _committing with ease_
317+
- 🚗 **Auto Imports** _your components & functions, including date, string, array, & object helpers_
318+
- ⏩ **Code Snippets** _goodbye to the boilerplate code—thank you Sarah Drasner_
319+
- 🔤 **Spell Checker** _be notified once there are typos_
320+
- 🛠️ **Essential Utilities** _powers at your fingertips. Collections, VueUse, and more_
321+
- 👥 **Team Management** _manage your team & their permissions_
322+
- 🧪 **Streamlined Testing** _unit & e2e tests powered by Bun, Vitest & Playwright_
323+
324+
No matter whether you are a beginner or an expert, the approachable Stacks design allows you to learn at your own pace, using our thorough documentation covering every aspect of the framework. Stacks is extremely beginner & expert-friendly.
325+
326+
Develop beautiful, reactive, composable UIs without learning a new set of languages. HTML, CSS, and minimal JavaScript—that’s all you need to dive in now! _Or TypeScript ✌🏼_
327+
328+
> _An actual rapid application development framework for all Full Stack needs. Next-level simplicity & DX._

0 commit comments

Comments
 (0)