create-strata 1.0.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.
Files changed (52) hide show
  1. package/README.md +54 -0
  2. package/dist/cli.js +4222 -0
  3. package/dist/templates/.env.example +22 -0
  4. package/dist/templates/docker-compose.yml +14 -0
  5. package/dist/templates/overlays/api/docs/API.md +49 -0
  6. package/dist/templates/overlays/server-htmx/public/assets/app.css +89 -0
  7. package/dist/templates/overlays/server-htmx/resources/views/errors/error.eta +14 -0
  8. package/dist/templates/overlays/server-htmx/resources/views/errors/forbidden.eta +4 -0
  9. package/dist/templates/overlays/server-htmx/resources/views/errors/not-found.eta +4 -0
  10. package/dist/templates/overlays/server-htmx/resources/views/layouts/app.eta +34 -0
  11. package/dist/templates/overlays/server-htmx/resources/views/organizations/_table.eta +23 -0
  12. package/dist/templates/overlays/server-htmx/resources/views/organizations/index.eta +37 -0
  13. package/dist/templates/overlays/server-htmx/resources/views/pages/home.eta +4 -0
  14. package/dist/templates/overlays/server-htmx/resources/views/partials/_flash.eta +3 -0
  15. package/dist/templates/overlays/spa-react/frontend/build.ts +17 -0
  16. package/dist/templates/overlays/spa-react/frontend/bun-env.d.ts +4 -0
  17. package/dist/templates/overlays/spa-react/frontend/bun.lock +51 -0
  18. package/dist/templates/overlays/spa-react/frontend/dev-server.ts +66 -0
  19. package/dist/templates/overlays/spa-react/frontend/index.html +12 -0
  20. package/dist/templates/overlays/spa-react/frontend/package.json +21 -0
  21. package/dist/templates/overlays/spa-react/frontend/src/App.tsx +59 -0
  22. package/dist/templates/overlays/spa-react/frontend/src/api/client.ts +86 -0
  23. package/dist/templates/overlays/spa-react/frontend/src/app.css +98 -0
  24. package/dist/templates/overlays/spa-react/frontend/src/auth/AuthContext.tsx +103 -0
  25. package/dist/templates/overlays/spa-react/frontend/src/auth/tokenStorage.ts +15 -0
  26. package/dist/templates/overlays/spa-react/frontend/src/main.tsx +22 -0
  27. package/dist/templates/overlays/spa-react/frontend/src/pages/HomePage.tsx +72 -0
  28. package/dist/templates/overlays/spa-react/frontend/src/pages/LoginPage.tsx +70 -0
  29. package/dist/templates/overlays/spa-react/frontend/src/pages/NotFoundPage.tsx +12 -0
  30. package/dist/templates/overlays/spa-react/frontend/tsconfig.json +17 -0
  31. package/dist/templates/package.json +22 -0
  32. package/dist/templates/public/assets/site.css +29 -0
  33. package/dist/templates/src/bootstrap/config.ts +29 -0
  34. package/dist/templates/src/bootstrap/createApp.ts +94 -0
  35. package/dist/templates/src/bootstrap/database.ts +30 -0
  36. package/dist/templates/src/bootstrap/preload.ts +5 -0
  37. package/dist/templates/src/bootstrap/providers/auth.ts +41 -0
  38. package/dist/templates/src/bootstrap/providers/cache.ts +28 -0
  39. package/dist/templates/src/bootstrap/providers/config.ts +27 -0
  40. package/dist/templates/src/bootstrap/providers/index.ts +14 -0
  41. package/dist/templates/src/bootstrap/providers/storage.ts +11 -0
  42. package/dist/templates/src/bootstrap/server.ts +25 -0
  43. package/dist/templates/src/db/fresh.ts +19 -0
  44. package/dist/templates/src/db/migrate.ts +35 -0
  45. package/dist/templates/src/lib/view.ts +21 -0
  46. package/dist/templates/src/modules/site/index.ts +29 -0
  47. package/dist/templates/src/routes.ts +6 -0
  48. package/dist/templates/strata.config.ts +7 -0
  49. package/dist/templates/tsconfig.json +14 -0
  50. package/dist/templates/views/home.eta +5 -0
  51. package/dist/templates/views/layouts/app.eta +18 -0
  52. package/package.json +29 -0
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # create-strata
2
+
3
+ Starter for [Strata](https://github.com/EyK-26/strata), a Bun + TypeScript HTTP framework. The wizard asks for each layer, then writes an app you own.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ bunx create-strata my-app
9
+ bunx create-strata my-app --yes
10
+ bunx create-strata /tmp/my-app --yes --frontend server-htmx --database postgres --auth cookie --docker
11
+ ```
12
+
13
+ A directory path works as well as a bare name. The last path segment becomes the project name.
14
+
15
+ In a terminal, lists use up/down and Enter, or a number key. Extras (MFA, email verification, SCIM, metrics) are toggled one at a time, and only the ones that apply to your auth choice are offered.
16
+
17
+ ## Layers
18
+
19
+ | Flag | Choices |
20
+ | --- | --- |
21
+ | `--frontend` | `api`, `server-htmx`, `spa-react`, `hybrid` |
22
+ | `--database` | `sqlite`, `postgres`, `mysql` (pick one) |
23
+ | `--auth` | `headers`, `cookie`, `token`, `jwt`, `cookie-token`, `cookie-token-jwt` |
24
+ | `--tenancy` | `none`, `column`, `rls` (`rls` needs Postgres; other engines fall back to `column`) |
25
+ | `--cache` | `array`, `redis` |
26
+ | `--queue` | `sync`, `redis` |
27
+ | `--mail` | `log`, `smtp` |
28
+
29
+ Extras: `--mfa`, `--email-verification`, `--scim`, `--metrics` and their `--no-` forms. Docker Compose is optional (`--docker`, `--no-docker`, `--docker-services=postgres,redis`) and only includes services for the tools you picked. `--docker` with Postgres or MySQL also writes Adminer on port 8080.
30
+
31
+ Choices are recorded in `strata.layers.json`.
32
+
33
+ ## After generating
34
+
35
+ ```bash
36
+ cd my-app
37
+ cp .env.example .env
38
+ bun install
39
+ bun run db:migrate
40
+ bun run dev
41
+ ```
42
+
43
+ The `strata` binary is installed into the app's `node_modules/.bin`, not globally, so use the `bun run` scripts or `bunx strata <command>` from inside the app directory. Running `bunx strata` outside a Strata app resolves an unrelated npm package named `strata`.
44
+
45
+ ## Relationship to @getstrata/starter
46
+
47
+ `create-strata` and [`@getstrata/starter`](https://www.npmjs.com/package/@getstrata/starter) ship the same generator from the same source at the same version. `bunx create-strata` is the documented entry point because `bunx` resolves the package name; `bunx @getstrata/starter` also works.
48
+
49
+ ## Docs
50
+
51
+ - [Getting started](https://github.com/EyK-26/strata/blob/main/docs/GETTING-STARTED.md)
52
+ - [Starter and layers](https://github.com/EyK-26/strata/blob/main/docs/STARTER.md)
53
+ - [Building apps](https://github.com/EyK-26/strata/blob/main/docs/BUILDING-APPS.md)
54
+ - [Auth choices](https://github.com/EyK-26/strata/blob/main/docs/AUTH.md)