create-aron-app 0.1.6 → 0.1.7
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/dist/index.js +50 -115
- package/package.json +5 -2
- package/templates/{_base/.cursor → .cursor}/rules/api_architecture.mdc +27 -33
- package/templates/{_base/.cursor → .cursor}/rules/coding_standards.mdc +1 -1
- package/templates/{_base/.cursor → .cursor}/rules/convex_rules.mdc +78 -422
- package/templates/.cursor/rules/frontend_architecture_core.mdc +495 -0
- package/templates/.cursor/rules/frontend_architecture_nextjs.mdc +458 -0
- package/templates/.cursor/rules/frontend_architecture_reactrouter.mdc +473 -0
- package/templates/apps/api/_generated/api.d.ts +57 -0
- package/templates/apps/api/_generated/api.js +23 -0
- package/templates/apps/api/_generated/dataModel.d.ts +60 -0
- package/templates/apps/api/_generated/server.d.ts +143 -0
- package/templates/apps/api/_generated/server.js +93 -0
- package/templates/apps/api/http.ts +16 -0
- package/templates/apps/nextjs/.env.example +10 -0
- package/templates/{nextjs → apps/nextjs}/project.json +5 -5
- package/templates/{nextjs → apps/nextjs}/src/app/(auth)/not-allowed/page.tsx +1 -0
- package/templates/apps/nextjs/src/app/(dashboard)/layout.tsx +22 -0
- package/templates/apps/nextjs/src/app/(dashboard)/page.tsx +12 -0
- package/templates/{nextjs → apps/nextjs}/src/app/(dashboard)/todos/[id]/page.tsx +5 -2
- package/templates/apps/nextjs/src/app/(dashboard)/todos/page.tsx +19 -0
- package/templates/apps/nextjs/src/middleware.ts +18 -0
- package/templates/apps/nextjs/src/surfaces/home/bootstrap.ts +9 -0
- package/templates/apps/nextjs/src/surfaces/home/home.tsx +27 -0
- package/templates/apps/nextjs/src/surfaces/home/install.tsx +17 -0
- package/templates/apps/nextjs/src/surfaces/home/layout.tsx +44 -0
- package/templates/apps/nextjs/src/surfaces/home/main/create.tsx +34 -0
- package/templates/apps/nextjs/src/surfaces/sidebar/install.tsx +23 -0
- package/templates/apps/nextjs/src/surfaces/sidebar/layout.tsx +118 -0
- package/templates/apps/nextjs/src/surfaces/sidebar/nav_main/create.tsx +19 -0
- package/templates/apps/nextjs/src/surfaces/sidebar/nav_main/nav_config.ts +22 -0
- package/templates/apps/nextjs/src/surfaces/sidebar/nav_main/nav_main.tsx +25 -0
- package/templates/apps/nextjs/src/surfaces/sidebar/nav_secondary/create.tsx +21 -0
- package/templates/apps/nextjs/src/surfaces/sidebar/nav_secondary/nav_secondary.tsx +33 -0
- package/templates/apps/nextjs/src/surfaces/sidebar/sidebar.tsx +23 -0
- package/templates/{nextjs/src/ui/sidebar/nav_link.tsx → apps/nextjs/src/surfaces/sidebar/ui/sidebar_nav_link.tsx} +13 -10
- package/templates/apps/nextjs/src/surfaces/sidebar/user_menu/create.tsx +28 -0
- package/templates/apps/nextjs/src/surfaces/sidebar/user_menu/user_menu.tsx +42 -0
- package/templates/apps/nextjs/src/surfaces/todos/all_todos/all_todos.tsx +29 -0
- package/templates/apps/nextjs/src/surfaces/todos/all_todos/all_todos_controller.ts +61 -0
- package/templates/apps/nextjs/src/surfaces/todos/all_todos/bootstrap.ts +21 -0
- package/templates/apps/nextjs/src/surfaces/todos/all_todos/header/create.tsx +23 -0
- package/templates/apps/nextjs/src/surfaces/todos/all_todos/install.tsx +23 -0
- package/templates/apps/nextjs/src/surfaces/todos/all_todos/layout.tsx +44 -0
- package/templates/apps/nextjs/src/surfaces/todos/all_todos/main/create.tsx +49 -0
- package/templates/apps/nextjs/src/surfaces/todos/all_todos/main/main.tsx +70 -0
- package/templates/apps/nextjs/src/surfaces/todos/all_todos/main/new_todo_sheet/create.tsx +56 -0
- package/templates/apps/nextjs/src/surfaces/todos/all_todos/main/new_todo_sheet/new_todo_sheet.tsx +99 -0
- package/templates/apps/nextjs/src/surfaces/todos/all_todos/main/new_todo_sheet/schema.ts +11 -0
- package/templates/apps/nextjs/src/surfaces/todos/single_todo/bootstrap.ts +32 -0
- package/templates/apps/nextjs/src/surfaces/todos/single_todo/header/create.tsx +26 -0
- package/templates/apps/nextjs/src/surfaces/todos/single_todo/header/header.tsx +22 -0
- package/templates/apps/nextjs/src/surfaces/todos/single_todo/install.tsx +27 -0
- package/templates/apps/nextjs/src/surfaces/todos/single_todo/layout.tsx +55 -0
- package/templates/apps/nextjs/src/surfaces/todos/single_todo/main/create.tsx +38 -0
- package/templates/apps/nextjs/src/surfaces/todos/single_todo/main/main.tsx +49 -0
- package/templates/apps/nextjs/src/surfaces/todos/single_todo/single_todo.tsx +29 -0
- package/templates/apps/nextjs/src/surfaces/todos/single_todo/single_todo_controller.ts +13 -0
- package/templates/apps/nextjs/src/utils/auth.ts +18 -0
- package/templates/apps/react-router/.env.example +10 -0
- package/templates/apps/react-router/.react-router/types/+future.ts +9 -0
- package/templates/apps/react-router/.react-router/types/+routes.ts +71 -0
- package/templates/apps/react-router/.react-router/types/+server-build.d.ts +18 -0
- package/templates/apps/react-router/.react-router/types/src/+types/root.ts +59 -0
- package/templates/apps/react-router/.react-router/types/src/routes/(auth)/+types/layout.ts +62 -0
- package/templates/apps/react-router/.react-router/types/src/routes/(auth)/sign-in/+types/index.ts +65 -0
- package/templates/apps/react-router/.react-router/types/src/routes/(dashboard)/+types/index.ts +65 -0
- package/templates/apps/react-router/.react-router/types/src/routes/(dashboard)/+types/layout.ts +62 -0
- package/templates/apps/react-router/.react-router/types/src/routes/(dashboard)/todos/+types/[id].ts +65 -0
- package/templates/apps/react-router/.react-router/types/src/routes/(dashboard)/todos/+types/index.ts +65 -0
- package/templates/{react-router → apps/react-router}/project.json +4 -4
- package/templates/apps/react-router/src/app.css +3 -0
- package/templates/{react-router → apps/react-router}/src/components/error_boundary.tsx +1 -1
- package/templates/{react-router → apps/react-router}/src/providers/api_auth_provider.tsx +2 -0
- package/templates/{react-router/src/routes/auth → apps/react-router/src/routes/(auth)}/layout.tsx +1 -1
- package/templates/apps/react-router/src/routes/(dashboard)/index.tsx +19 -0
- package/templates/apps/react-router/src/routes/(dashboard)/layout.tsx +37 -0
- package/templates/apps/react-router/src/routes/(dashboard)/todos/[id].tsx +19 -0
- package/templates/apps/react-router/src/routes/(dashboard)/todos/index.tsx +19 -0
- package/templates/apps/react-router/src/routes.ts +12 -0
- package/templates/apps/react-router/src/surfaces/home/bootstrap.ts +9 -0
- package/templates/apps/react-router/src/surfaces/home/home.tsx +25 -0
- package/templates/apps/react-router/src/surfaces/home/install.tsx +17 -0
- package/templates/apps/react-router/src/surfaces/home/layout.tsx +35 -0
- package/templates/apps/react-router/src/surfaces/home/main/create.tsx +32 -0
- package/templates/apps/react-router/src/surfaces/sidebar/install.tsx +23 -0
- package/templates/apps/react-router/src/surfaces/sidebar/layout.tsx +110 -0
- package/templates/apps/react-router/src/surfaces/sidebar/nav_main/create.tsx +31 -0
- package/templates/apps/react-router/src/surfaces/sidebar/nav_main/nav_main.tsx +42 -0
- package/templates/apps/react-router/src/surfaces/sidebar/nav_secondary/create.tsx +21 -0
- package/templates/apps/react-router/src/surfaces/sidebar/nav_secondary/nav_secondary.tsx +31 -0
- package/templates/apps/react-router/src/surfaces/sidebar/sidebar.tsx +18 -0
- package/templates/apps/react-router/src/surfaces/sidebar/user_menu/create.tsx +26 -0
- package/templates/{react-router/src/layouts/sidebar/sidebar_aside → apps/react-router/src/surfaces/sidebar/user_menu}/user_menu.tsx +13 -9
- package/templates/apps/react-router/src/surfaces/todos/all_todos/all_todos.tsx +25 -0
- package/templates/apps/react-router/src/surfaces/todos/all_todos/all_todos_controller.ts +47 -0
- package/templates/apps/react-router/src/surfaces/todos/all_todos/bootstrap.ts +18 -0
- package/templates/apps/react-router/src/surfaces/todos/all_todos/header/create.tsx +21 -0
- package/templates/apps/react-router/src/surfaces/todos/all_todos/install.tsx +20 -0
- package/templates/apps/react-router/src/surfaces/todos/all_todos/layout.tsx +35 -0
- package/templates/apps/react-router/src/surfaces/todos/all_todos/main/create.tsx +47 -0
- package/templates/apps/react-router/src/surfaces/todos/all_todos/main/main.tsx +68 -0
- package/templates/apps/react-router/src/surfaces/todos/all_todos/main/new_todo_sheet/create.tsx +54 -0
- package/templates/apps/react-router/src/surfaces/todos/all_todos/main/new_todo_sheet/new_todo_sheet.tsx +97 -0
- package/templates/apps/react-router/src/surfaces/todos/all_todos/main/new_todo_sheet/schema.ts +11 -0
- package/templates/apps/react-router/src/surfaces/todos/single_todo/bootstrap.ts +36 -0
- package/templates/apps/react-router/src/surfaces/todos/single_todo/header/create.tsx +32 -0
- package/templates/apps/react-router/src/surfaces/todos/single_todo/header/header.tsx +25 -0
- package/templates/apps/react-router/src/surfaces/todos/single_todo/install.tsx +27 -0
- package/templates/apps/react-router/src/surfaces/todos/single_todo/layout.tsx +45 -0
- package/templates/apps/react-router/src/surfaces/todos/single_todo/main/create.tsx +35 -0
- package/templates/apps/react-router/src/surfaces/todos/single_todo/main/main.tsx +47 -0
- package/templates/apps/react-router/src/surfaces/todos/single_todo/single_todo.tsx +27 -0
- package/templates/apps/react-router/src/surfaces/todos/single_todo/single_todo_controller.ts +16 -0
- package/templates/{react-router → apps/react-router}/vite.config.ts +27 -3
- package/templates/{_base/biome.json → biome.json} +7 -0
- package/templates/bun.lock +3187 -0
- package/templates/{_base/emails → emails}/project.json +1 -1
- package/templates/{_base/nx.json → nx.json} +11 -0
- package/templates/package.json +92 -0
- package/templates/{_base/tsconfig.base.json → tsconfig.base.json} +4 -1
- package/templates/_base/.cursor/rules/frontend_rules.mdc +0 -268
- package/templates/_base/.env.convex.example +0 -3
- package/templates/_base/_gitignore +0 -58
- package/templates/_base/package.json +0 -73
- package/templates/nextjs/.env.example +0 -8
- package/templates/nextjs/src/app/(dashboard)/layout.tsx +0 -27
- package/templates/nextjs/src/app/(dashboard)/page.tsx +0 -5
- package/templates/nextjs/src/app/(dashboard)/todos/page.tsx +0 -16
- package/templates/nextjs/src/middleware.ts +0 -18
- package/templates/nextjs/src/surfaces/home_surface.tsx +0 -22
- package/templates/nextjs/src/surfaces/todos/all_todos_surface.tsx +0 -97
- package/templates/nextjs/src/surfaces/todos/create_todo_sheet.tsx +0 -107
- package/templates/nextjs/src/surfaces/todos/single_todo_surface.tsx +0 -90
- package/templates/nextjs/src/ui/sidebar/sidebar.tsx +0 -125
- package/templates/react-router/.env.example +0 -8
- package/templates/react-router/src/app.css +0 -3
- package/templates/react-router/src/layouts/sidebar/sidebar_aside/sidebar_aside.tsx +0 -76
- package/templates/react-router/src/layouts/sidebar/sidebar_layout.tsx +0 -22
- package/templates/react-router/src/routes/index.tsx +0 -9
- package/templates/react-router/src/routes/layout.tsx +0 -26
- package/templates/react-router/src/routes/todos/[id].tsx +0 -22
- package/templates/react-router/src/routes/todos/index.tsx +0 -13
- package/templates/react-router/src/routes.ts +0 -12
- package/templates/react-router/src/surfaces/home_surface.tsx +0 -20
- package/templates/react-router/src/surfaces/todos/all_todos_surface.tsx +0 -87
- package/templates/react-router/src/surfaces/todos/create_todo_sheet.tsx +0 -102
- package/templates/react-router/src/surfaces/todos/single_todo_surface.tsx +0 -81
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/SKILL.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-backend-api/SKILL.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-backend-api/scripts/api-specs-context.sh +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-backend-api/scripts/execute-request.sh +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-backend-api/scripts/extract-endpoint-detail.sh +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-backend-api/scripts/extract-tag-endpoints.sh +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-backend-api/scripts/extract-tags.js +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-custom-ui/SKILL.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-custom-ui/core-2/custom-sign-in.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-custom-ui/core-2/custom-sign-up.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-custom-ui/core-3/custom-sign-in.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-custom-ui/core-3/custom-sign-up.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-custom-ui/core-3/show-component.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-nextjs-patterns/SKILL.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-nextjs-patterns/references/api-routes.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-nextjs-patterns/references/caching-auth.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-nextjs-patterns/references/middleware-strategies.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-nextjs-patterns/references/server-actions.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-nextjs-patterns/references/server-vs-client.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/clerk/clerk-webhooks/SKILL.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/shadcn/SKILL.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/shadcn/agents/openai.yml +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/shadcn/assets/shadcn-small.png +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/shadcn/assets/shadcn.png +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/shadcn/cli.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/shadcn/customization.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/shadcn/evals/evals.json +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/shadcn/mcp.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/shadcn/rules/base-vs-radix.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/shadcn/rules/composition.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/shadcn/rules/forms.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/shadcn/rules/icons.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/agents/skills/shadcn/rules/styling.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/commands/builder.md +0 -0
- /package/templates/{_base/.cursor → .cursor}/commands/pr.md +0 -0
- /package/templates/{_base/.github → .github}/workflows/ci.yml +0 -0
- /package/templates/{_base/.nvmrc → .nvmrc} +0 -0
- /package/templates/{_base/.vscode → .vscode}/settings.json +0 -0
- /package/templates/{_base/apps → apps}/api/auth.config.ts +0 -0
- /package/templates/{_base/apps → apps}/api/functions.ts +0 -0
- /package/templates/{_base/apps → apps}/api/project.json +0 -0
- /package/templates/{_base/apps → apps}/api/schema.ts +0 -0
- /package/templates/{_base/apps → apps}/api/todos/crud.ts +0 -0
- /package/templates/{_base/apps → apps}/api/todos/schema.ts +0 -0
- /package/templates/{_base/apps → apps}/api/todos/types.ts +0 -0
- /package/templates/{_base/apps → apps}/api/tsconfig.json +0 -0
- /package/templates/{_base/apps → apps}/api/types.ts +0 -0
- /package/templates/{nextjs → apps/nextjs}/index.d.ts +0 -0
- /package/templates/{nextjs → apps/nextjs}/next-env.d.ts +0 -0
- /package/templates/{nextjs → apps/nextjs}/next.config.js +0 -0
- /package/templates/{nextjs → apps/nextjs}/postcss.config.js +0 -0
- /package/templates/{nextjs → apps/nextjs}/src/app/(auth)/layout.tsx +0 -0
- /package/templates/{nextjs → apps/nextjs}/src/app/(auth)/sign-in/[[...sign-in]]/page.tsx +0 -0
- /package/templates/{nextjs → apps/nextjs}/src/app/app.css +0 -0
- /package/templates/{nextjs → apps/nextjs}/src/app/layout.tsx +0 -0
- /package/templates/{nextjs → apps/nextjs}/src/providers/convex_provider.tsx +0 -0
- /package/templates/{nextjs/src → apps/nextjs/src/utils}/convex.ts +0 -0
- /package/templates/{nextjs → apps/nextjs}/src/utils/font.ts +0 -0
- /package/templates/{nextjs → apps/nextjs}/tsconfig.json +0 -0
- /package/templates/{react-router → apps/react-router}/postcss.config.js +0 -0
- /package/templates/{react-router → apps/react-router}/public/favicon.ico +0 -0
- /package/templates/{react-router → apps/react-router}/react-router.config.ts +0 -0
- /package/templates/{react-router → apps/react-router}/src/root.tsx +0 -0
- /package/templates/{react-router/src/routes/auth/sign-in.tsx → apps/react-router/src/routes/(auth)/sign-in/index.tsx} +0 -0
- /package/templates/{react-router → apps/react-router}/tsconfig.json +0 -0
- /package/templates/{_base/convex.json → convex.json} +0 -0
- /package/templates/{_base/emails → emails}/tsconfig.json +0 -0
- /package/templates/{_base/emails → emails}/welcome_email.tsx +0 -0
- /package/templates/{_base/scripts → scripts}/sync_convex_env.ts +0 -0
- /package/templates/{_base/shared → shared}/assets/image.d.ts +0 -0
- /package/templates/{_base/shared → shared}/assets/src/styles/global.css +0 -0
- /package/templates/{_base/shared → shared}/assets/tsconfig.json +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/alert_dialog.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/badge.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/basic_data_table.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/button.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/button_group.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/card.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/checkbox.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/command.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/dialog.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/dropdown_menu.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/form.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/input.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/label.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/popover.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/radio_group.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/resizable.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/scroll_area.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/select.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/separator.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/sheet.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/side_bar.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/skeleton.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/spinner.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/switch.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/table.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/text_area.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/tooltip.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/base/utils.ts +0 -0
- /package/templates/{_base/shared → shared}/ui/src/hooks/use_keyboard_press.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/hooks/use_keyboard_release.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/hooks/use_mobile.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/hooks/use_mouse_click.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/hooks/use_mouse_location.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/hooks/use_outside_click.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/src/hooks/use_query_params.tsx +0 -0
- /package/templates/{_base/shared → shared}/ui/tsconfig.json +0 -0
- /package/templates/{_base/shared → shared}/utils/src/convex.ts +0 -0
- /package/templates/{_base/shared → shared}/utils/src/time.ts +0 -0
- /package/templates/{_base/shared → shared}/utils/tsconfig.json +0 -0
- /package/templates/{_base/skills-lock.json → skills-lock.json} +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
ActionBuilder,
|
|
13
|
+
HttpActionBuilder,
|
|
14
|
+
MutationBuilder,
|
|
15
|
+
QueryBuilder,
|
|
16
|
+
GenericActionCtx,
|
|
17
|
+
GenericMutationCtx,
|
|
18
|
+
GenericQueryCtx,
|
|
19
|
+
GenericDatabaseReader,
|
|
20
|
+
GenericDatabaseWriter,
|
|
21
|
+
} from "convex/server";
|
|
22
|
+
import type { DataModel } from "./dataModel.js";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Define a query in this Convex app's public API.
|
|
26
|
+
*
|
|
27
|
+
* This function will be allowed to read your Convex database and will be accessible from the client.
|
|
28
|
+
*
|
|
29
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
30
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
31
|
+
*/
|
|
32
|
+
export declare const query: QueryBuilder<DataModel, "public">;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
36
|
+
*
|
|
37
|
+
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
|
|
38
|
+
*
|
|
39
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
40
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
41
|
+
*/
|
|
42
|
+
export declare const internalQuery: QueryBuilder<DataModel, "internal">;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Define a mutation in this Convex app's public API.
|
|
46
|
+
*
|
|
47
|
+
* This function will be allowed to modify your Convex database and will be accessible from the client.
|
|
48
|
+
*
|
|
49
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
50
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
51
|
+
*/
|
|
52
|
+
export declare const mutation: MutationBuilder<DataModel, "public">;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
56
|
+
*
|
|
57
|
+
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
|
|
58
|
+
*
|
|
59
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
60
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
61
|
+
*/
|
|
62
|
+
export declare const internalMutation: MutationBuilder<DataModel, "internal">;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Define an action in this Convex app's public API.
|
|
66
|
+
*
|
|
67
|
+
* An action is a function which can execute any JavaScript code, including non-deterministic
|
|
68
|
+
* code and code with side-effects, like calling third-party services.
|
|
69
|
+
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
|
|
70
|
+
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
|
|
71
|
+
*
|
|
72
|
+
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
|
|
73
|
+
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
74
|
+
*/
|
|
75
|
+
export declare const action: ActionBuilder<DataModel, "public">;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
79
|
+
*
|
|
80
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
81
|
+
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
82
|
+
*/
|
|
83
|
+
export declare const internalAction: ActionBuilder<DataModel, "internal">;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Define an HTTP action.
|
|
87
|
+
*
|
|
88
|
+
* The wrapped function will be used to respond to HTTP requests received
|
|
89
|
+
* by a Convex deployment if the requests matches the path and method where
|
|
90
|
+
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
|
|
91
|
+
*
|
|
92
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
93
|
+
* and a Fetch API `Request` object as its second.
|
|
94
|
+
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
95
|
+
*/
|
|
96
|
+
export declare const httpAction: HttpActionBuilder;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* A set of services for use within Convex query functions.
|
|
100
|
+
*
|
|
101
|
+
* The query context is passed as the first argument to any Convex query
|
|
102
|
+
* function run on the server.
|
|
103
|
+
*
|
|
104
|
+
* This differs from the {@link MutationCtx} because all of the services are
|
|
105
|
+
* read-only.
|
|
106
|
+
*/
|
|
107
|
+
export type QueryCtx = GenericQueryCtx<DataModel>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* A set of services for use within Convex mutation functions.
|
|
111
|
+
*
|
|
112
|
+
* The mutation context is passed as the first argument to any Convex mutation
|
|
113
|
+
* function run on the server.
|
|
114
|
+
*/
|
|
115
|
+
export type MutationCtx = GenericMutationCtx<DataModel>;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* A set of services for use within Convex action functions.
|
|
119
|
+
*
|
|
120
|
+
* The action context is passed as the first argument to any Convex action
|
|
121
|
+
* function run on the server.
|
|
122
|
+
*/
|
|
123
|
+
export type ActionCtx = GenericActionCtx<DataModel>;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* An interface to read from the database within Convex query functions.
|
|
127
|
+
*
|
|
128
|
+
* The two entry points are {@link DatabaseReader.get}, which fetches a single
|
|
129
|
+
* document by its {@link Id}, or {@link DatabaseReader.query}, which starts
|
|
130
|
+
* building a query.
|
|
131
|
+
*/
|
|
132
|
+
export type DatabaseReader = GenericDatabaseReader<DataModel>;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* An interface to read from and write to the database within Convex mutation
|
|
136
|
+
* functions.
|
|
137
|
+
*
|
|
138
|
+
* Convex guarantees that all writes within a single mutation are
|
|
139
|
+
* executed atomically, so you never have to worry about partial writes leaving
|
|
140
|
+
* your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)
|
|
141
|
+
* for the guarantees Convex provides your functions.
|
|
142
|
+
*/
|
|
143
|
+
export type DatabaseWriter = GenericDatabaseWriter<DataModel>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
actionGeneric,
|
|
13
|
+
httpActionGeneric,
|
|
14
|
+
queryGeneric,
|
|
15
|
+
mutationGeneric,
|
|
16
|
+
internalActionGeneric,
|
|
17
|
+
internalMutationGeneric,
|
|
18
|
+
internalQueryGeneric,
|
|
19
|
+
} from "convex/server";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Define a query in this Convex app's public API.
|
|
23
|
+
*
|
|
24
|
+
* This function will be allowed to read your Convex database and will be accessible from the client.
|
|
25
|
+
*
|
|
26
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
27
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
28
|
+
*/
|
|
29
|
+
export const query = queryGeneric;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
33
|
+
*
|
|
34
|
+
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
|
|
35
|
+
*
|
|
36
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
37
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
38
|
+
*/
|
|
39
|
+
export const internalQuery = internalQueryGeneric;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Define a mutation in this Convex app's public API.
|
|
43
|
+
*
|
|
44
|
+
* This function will be allowed to modify your Convex database and will be accessible from the client.
|
|
45
|
+
*
|
|
46
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
47
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
48
|
+
*/
|
|
49
|
+
export const mutation = mutationGeneric;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
53
|
+
*
|
|
54
|
+
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
|
|
55
|
+
*
|
|
56
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
57
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
58
|
+
*/
|
|
59
|
+
export const internalMutation = internalMutationGeneric;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Define an action in this Convex app's public API.
|
|
63
|
+
*
|
|
64
|
+
* An action is a function which can execute any JavaScript code, including non-deterministic
|
|
65
|
+
* code and code with side-effects, like calling third-party services.
|
|
66
|
+
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
|
|
67
|
+
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
|
|
68
|
+
*
|
|
69
|
+
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
|
|
70
|
+
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
71
|
+
*/
|
|
72
|
+
export const action = actionGeneric;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
76
|
+
*
|
|
77
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
78
|
+
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
79
|
+
*/
|
|
80
|
+
export const internalAction = internalActionGeneric;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Define an HTTP action.
|
|
84
|
+
*
|
|
85
|
+
* The wrapped function will be used to respond to HTTP requests received
|
|
86
|
+
* by a Convex deployment if the requests matches the path and method where
|
|
87
|
+
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
|
|
88
|
+
*
|
|
89
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
90
|
+
* and a Fetch API `Request` object as its second.
|
|
91
|
+
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
92
|
+
*/
|
|
93
|
+
export const httpAction = httpActionGeneric;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type HonoWithConvex, HttpRouterWithHono } from "convex-helpers/server/hono";
|
|
2
|
+
import { Hono } from "hono";
|
|
3
|
+
|
|
4
|
+
import type { ActionCtx } from "./_generated/server";
|
|
5
|
+
|
|
6
|
+
const app: HonoWithConvex<ActionCtx> = new Hono();
|
|
7
|
+
|
|
8
|
+
app.get("/", (c) => {
|
|
9
|
+
return c.json({ message: "Hello, world!" });
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
app.get("/health", (c) => {
|
|
13
|
+
return c.json({ message: "OK" });
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export default new HttpRouterWithHono(app);
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "nextjs",
|
|
3
3
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"sourceRoot": "
|
|
4
|
+
"sourceRoot": "apps/nextjs",
|
|
5
5
|
"projectType": "application",
|
|
6
6
|
"tags": [],
|
|
7
7
|
"targets": {
|
|
8
8
|
"dev": {
|
|
9
9
|
"executor": "nx:run-commands",
|
|
10
10
|
"options": {
|
|
11
|
-
"command": "bunx next dev apps/
|
|
11
|
+
"command": "bunx next dev apps/nextjs --port 5001"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"build": {
|
|
15
15
|
"executor": "@nx/next:build",
|
|
16
16
|
"options": {
|
|
17
|
-
"root": "apps/
|
|
18
|
-
"outputPath": "dist/apps/
|
|
17
|
+
"root": "apps/nextjs",
|
|
18
|
+
"outputPath": "dist/apps/nextjs"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Aron Weston 2026.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SidebarInset, SidebarProvider } from "@/ui/base/side_bar";
|
|
6
|
+
import { Sidebar } from "@/web/surfaces/sidebar/sidebar";
|
|
7
|
+
|
|
8
|
+
type DashboardLayoutProps = {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default function DashboardLayout({ children }: DashboardLayoutProps) {
|
|
13
|
+
return (
|
|
14
|
+
<SidebarProvider
|
|
15
|
+
style={{ "--sidebar-width": "265px" } as React.CSSProperties}
|
|
16
|
+
defaultOpen={true}
|
|
17
|
+
>
|
|
18
|
+
<Sidebar />
|
|
19
|
+
<SidebarInset>{children}</SidebarInset>
|
|
20
|
+
</SidebarProvider>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Aron Weston 2026.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { bootstrapHome } from "@/web/surfaces/home/bootstrap";
|
|
6
|
+
import { Home } from "@/web/surfaces/home/home";
|
|
7
|
+
|
|
8
|
+
export default async function HomePage() {
|
|
9
|
+
const bootstrap = await bootstrapHome();
|
|
10
|
+
|
|
11
|
+
return <Home bootstrap={bootstrap} />;
|
|
12
|
+
}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import type { Metadata } from "next";
|
|
6
6
|
|
|
7
7
|
import type { TodoId } from "@/api/todos/types";
|
|
8
|
-
import {
|
|
8
|
+
import { bootstrapSingleTodo } from "@/web/surfaces/todos/single_todo/bootstrap";
|
|
9
|
+
import { SingleTodo } from "@/web/surfaces/todos/single_todo/single_todo";
|
|
9
10
|
|
|
10
11
|
type SingleTodoPageProps = {
|
|
11
12
|
params: Promise<{ id: TodoId }>;
|
|
@@ -19,5 +20,7 @@ export const metadata: Metadata = {
|
|
|
19
20
|
export default async function SingleTodoPage({ params }: SingleTodoPageProps) {
|
|
20
21
|
const { id } = await params;
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
const bootstrap = await bootstrapSingleTodo({ todoId: id });
|
|
24
|
+
|
|
25
|
+
return <SingleTodo bootstrap={bootstrap} />;
|
|
23
26
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Aron Weston 2026.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { Metadata } from "next";
|
|
6
|
+
|
|
7
|
+
import { AllTodos } from "@/web/surfaces/todos/all_todos/all_todos";
|
|
8
|
+
import { bootstrapAllTodos } from "@/web/surfaces/todos/all_todos/bootstrap";
|
|
9
|
+
|
|
10
|
+
export const metadata: Metadata = {
|
|
11
|
+
title: "Todos",
|
|
12
|
+
description: "Todos",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default async function AllTodosPage() {
|
|
16
|
+
const bootstrap = await bootstrapAllTodos();
|
|
17
|
+
|
|
18
|
+
return <AllTodos bootstrap={bootstrap} />;
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { clerkMiddleware, createRouteMatcher } from "@clerk/nextjs/server";
|
|
2
|
+
|
|
3
|
+
const isPublicRoute = createRouteMatcher(["/sign-in(.*)"]);
|
|
4
|
+
|
|
5
|
+
export default clerkMiddleware(async (auth, req) => {
|
|
6
|
+
if (!isPublicRoute(req)) {
|
|
7
|
+
await auth.protect();
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const config = {
|
|
12
|
+
matcher: [
|
|
13
|
+
// Skip Next.js internals and all static files, unless found in search params
|
|
14
|
+
"/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)",
|
|
15
|
+
// Always run for API routes
|
|
16
|
+
"/(api|trpc)(.*)",
|
|
17
|
+
],
|
|
18
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Aron Weston 2026.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
"use client";
|
|
6
|
+
|
|
7
|
+
import { useMemo, useRef } from "react";
|
|
8
|
+
|
|
9
|
+
import type { HomeBootstrap } from "@/web/surfaces/home/bootstrap";
|
|
10
|
+
import { installHome } from "@/web/surfaces/home/install";
|
|
11
|
+
import { createLayout } from "@/web/surfaces/home/layout";
|
|
12
|
+
|
|
13
|
+
export type HomeProps = {
|
|
14
|
+
bootstrap: HomeBootstrap;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const Home = ({ bootstrap }: HomeProps) => {
|
|
18
|
+
const { layout, Layout } = useMemo(() => createLayout(), []);
|
|
19
|
+
const installed = useRef(false);
|
|
20
|
+
|
|
21
|
+
if (!installed.current) {
|
|
22
|
+
installed.current = true;
|
|
23
|
+
installHome({ layout, bootstrap });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return <Layout />;
|
|
27
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Aron Weston 2026.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { HomeBootstrap } from "@/web/surfaces/home/bootstrap";
|
|
6
|
+
import type { HomeLayoutController } from "@/web/surfaces/home/layout";
|
|
7
|
+
|
|
8
|
+
export type InstallHomeOpts = {
|
|
9
|
+
layout: HomeLayoutController;
|
|
10
|
+
bootstrap: HomeBootstrap;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const installHome = ({ layout, bootstrap }: InstallHomeOpts) => {
|
|
14
|
+
import("@/web/surfaces/home/main/create").then(({ createMain }) => {
|
|
15
|
+
layout.setMain(createMain({ bootstrap }));
|
|
16
|
+
});
|
|
17
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Aron Weston 2026.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
"use client";
|
|
6
|
+
|
|
7
|
+
import { makeObservable, observable, action, runInAction } from "mobx";
|
|
8
|
+
import { observer } from "mobx-react-lite";
|
|
9
|
+
import type { ComponentType } from "react";
|
|
10
|
+
|
|
11
|
+
import { Skeleton } from "@/ui/base/skeleton";
|
|
12
|
+
|
|
13
|
+
export class HomeLayoutController {
|
|
14
|
+
Main: ComponentType | undefined = undefined;
|
|
15
|
+
|
|
16
|
+
constructor() {
|
|
17
|
+
makeObservable(this, {
|
|
18
|
+
Main: observable.ref,
|
|
19
|
+
setMain: action,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
setMain(Main: ComponentType) {
|
|
24
|
+
runInAction(() => {
|
|
25
|
+
this.Main = Main;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const createLayout = () => {
|
|
31
|
+
const layout = new HomeLayoutController();
|
|
32
|
+
return {
|
|
33
|
+
layout,
|
|
34
|
+
Layout: observer(() => {
|
|
35
|
+
const Main = layout.Main;
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div className="flex w-full flex-1 flex-col">
|
|
39
|
+
{Main ? <Main /> : <Skeleton className="h-64 w-full rounded-md" />}
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
}),
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Aron Weston 2026.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
"use client";
|
|
6
|
+
|
|
7
|
+
import { useUser } from "@clerk/nextjs";
|
|
8
|
+
import { observer } from "mobx-react-lite";
|
|
9
|
+
import Link from "next/link";
|
|
10
|
+
|
|
11
|
+
import { Button } from "@/ui/base/button";
|
|
12
|
+
import type { HomeBootstrap } from "@/web/surfaces/home/bootstrap";
|
|
13
|
+
|
|
14
|
+
export type CreateHomeMainOpts = {
|
|
15
|
+
bootstrap: HomeBootstrap;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const createMain = ({ bootstrap: _bootstrap }: CreateHomeMainOpts) => {
|
|
19
|
+
return observer(() => {
|
|
20
|
+
const { user } = useUser();
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<main className="flex flex-1 flex-col items-center justify-center gap-4 p-8">
|
|
24
|
+
<h1 className="text-3xl font-bold">
|
|
25
|
+
Welcome{user?.firstName ? `, ${user.firstName}` : ""}
|
|
26
|
+
</h1>
|
|
27
|
+
<p className="text-muted-foreground">Get started by managing your todos.</p>
|
|
28
|
+
<Button asChild>
|
|
29
|
+
<Link href="/todos">View Todos</Link>
|
|
30
|
+
</Button>
|
|
31
|
+
</main>
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Aron Weston 2026.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { SidebarLayoutController } from "@/web/surfaces/sidebar/layout";
|
|
6
|
+
|
|
7
|
+
type InstallSidebarOpts = {
|
|
8
|
+
layout: SidebarLayoutController;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const installSidebar = ({ layout }: InstallSidebarOpts) => {
|
|
12
|
+
import("@/web/surfaces/sidebar/nav_main/create").then(({ createNavMain }) => {
|
|
13
|
+
layout.setNavMain(createNavMain());
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
import("@/web/surfaces/sidebar/nav_secondary/create").then(({ createNavSecondary }) => {
|
|
17
|
+
layout.setNavSecondary(createNavSecondary());
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
import("@/web/surfaces/sidebar/user_menu/create").then(({ createUserMenu }) => {
|
|
21
|
+
layout.setUserMenu(createUserMenu());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Aron Weston 2026.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
"use client";
|
|
6
|
+
|
|
7
|
+
import { action, makeObservable, observable, runInAction } from "mobx";
|
|
8
|
+
import { observer } from "mobx-react-lite";
|
|
9
|
+
import Link from "next/link";
|
|
10
|
+
import type { ComponentType } from "react";
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
Sidebar as BaseSidebar,
|
|
14
|
+
SidebarContent,
|
|
15
|
+
SidebarFooter,
|
|
16
|
+
SidebarHeader,
|
|
17
|
+
SidebarMenu,
|
|
18
|
+
SidebarMenuButton,
|
|
19
|
+
SidebarMenuItem,
|
|
20
|
+
} from "@/ui/base/side_bar";
|
|
21
|
+
import { Skeleton } from "@/ui/base/skeleton";
|
|
22
|
+
|
|
23
|
+
export class SidebarLayoutController {
|
|
24
|
+
NavMain: ComponentType | undefined = undefined;
|
|
25
|
+
NavSecondary: ComponentType | undefined = undefined;
|
|
26
|
+
UserMenu: ComponentType | undefined = undefined;
|
|
27
|
+
|
|
28
|
+
constructor() {
|
|
29
|
+
makeObservable(this, {
|
|
30
|
+
NavMain: observable.ref,
|
|
31
|
+
NavSecondary: observable.ref,
|
|
32
|
+
UserMenu: observable.ref,
|
|
33
|
+
setNavMain: action,
|
|
34
|
+
setNavSecondary: action,
|
|
35
|
+
setUserMenu: action,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
setNavMain(NavMain: ComponentType) {
|
|
40
|
+
runInAction(() => {
|
|
41
|
+
this.NavMain = NavMain;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
setNavSecondary(NavSecondary: ComponentType) {
|
|
46
|
+
runInAction(() => {
|
|
47
|
+
this.NavSecondary = NavSecondary;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
setUserMenu(UserMenu: ComponentType) {
|
|
52
|
+
runInAction(() => {
|
|
53
|
+
this.UserMenu = UserMenu;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const BrandLink = () => {
|
|
59
|
+
return (
|
|
60
|
+
<SidebarMenu>
|
|
61
|
+
<SidebarMenuItem>
|
|
62
|
+
<SidebarMenuButton
|
|
63
|
+
size="lg"
|
|
64
|
+
className="h-auto flex-col items-start gap-0.5 p-0"
|
|
65
|
+
asChild
|
|
66
|
+
>
|
|
67
|
+
<Link
|
|
68
|
+
href="/"
|
|
69
|
+
className="flex flex-row w-full items-center gap-3 px-2 py-2 transition-opacity hover:opacity-80 active:opacity-70 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0 group-data-[collapsible=icon]:[&>div:last-child]:hidden"
|
|
70
|
+
>
|
|
71
|
+
<div className="flex size-10 shrink-0 items-center justify-center rounded-md bg-sidebar-brand text-sm text-white font-semibold group-data-[collapsible=icon]:size-8 group-data-[collapsible=icon]:text-xs">
|
|
72
|
+
A
|
|
73
|
+
</div>
|
|
74
|
+
<div className="flex min-w-0 flex-col">
|
|
75
|
+
<span className="truncate text-base font-bold text-sidebar-foreground">
|
|
76
|
+
App
|
|
77
|
+
</span>
|
|
78
|
+
<span className="truncate text-xs text-sidebar-muted-foreground">
|
|
79
|
+
Template
|
|
80
|
+
</span>
|
|
81
|
+
</div>
|
|
82
|
+
</Link>
|
|
83
|
+
</SidebarMenuButton>
|
|
84
|
+
</SidebarMenuItem>
|
|
85
|
+
</SidebarMenu>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const createSidebarLayout = () => {
|
|
90
|
+
const layout = new SidebarLayoutController();
|
|
91
|
+
return {
|
|
92
|
+
layout,
|
|
93
|
+
Layout: observer(() => {
|
|
94
|
+
const NavMain = layout.NavMain;
|
|
95
|
+
const NavSecondary = layout.NavSecondary;
|
|
96
|
+
const UserMenu = layout.UserMenu;
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<BaseSidebar
|
|
100
|
+
data-slot="app-sidebar"
|
|
101
|
+
className="shadow-sm"
|
|
102
|
+
collapsible="icon"
|
|
103
|
+
>
|
|
104
|
+
<SidebarHeader>
|
|
105
|
+
<BrandLink />
|
|
106
|
+
</SidebarHeader>
|
|
107
|
+
<SidebarContent className="flex flex-1 flex-col gap-4 overflow-hidden px-2">
|
|
108
|
+
{NavMain ? <NavMain /> : <Skeleton className="h-24 bg-sidebar-accent" />}
|
|
109
|
+
</SidebarContent>
|
|
110
|
+
<SidebarFooter className="gap-2">
|
|
111
|
+
{NavSecondary ? <NavSecondary /> : <Skeleton className="h-10 bg-sidebar-accent" />}
|
|
112
|
+
{UserMenu ? <UserMenu /> : <Skeleton className="h-12 bg-sidebar-accent" />}
|
|
113
|
+
</SidebarFooter>
|
|
114
|
+
</BaseSidebar>
|
|
115
|
+
);
|
|
116
|
+
}),
|
|
117
|
+
};
|
|
118
|
+
};
|