|
1 | 1 | /** |
2 | 2 | * Minimal third-party console template. |
3 | 3 | * |
4 | | - * Wraps createConsole() with the auth provider + toaster so that login, |
5 | | - * registration, and password-reset work out of the box against the backend |
6 | | - * pointed to by VITE_SERVER_URL. |
| 4 | + * `createConsole({})` is enough — every slot (auth pages, home, organizations, |
| 5 | + * AppContent) defaults to the implementation shipped from @object-ui/app-shell, |
| 6 | + * so this starter renders a fully functional console out of the box against |
| 7 | + * the backend at VITE_SERVER_URL. |
7 | 8 | * |
8 | | - * Customise by: |
9 | | - * - Replacing pages in ./pages with your own |
10 | | - * - Adding a real AppContent that renders your business screens |
11 | | - * - Wiring your own theme/branding around <ConsoleApp/> |
12 | | - * |
13 | | - * The shell (auth gate, /home, /organizations, /apps/:appName/* routing, |
14 | | - * adapter + metadata providers) is fully owned by createConsole. Extend |
15 | | - * through the config object below — no package internals to fork. |
| 9 | + * To customise: pass any of `authPages`, `homePage`, `organizationsPage`, or |
| 10 | + * `AppContent` overrides into `createConsole(...)`. See |
| 11 | + * @object-ui/app-shell/src/console/types.ts for the full surface. |
16 | 12 | */ |
17 | 13 |
|
18 | 14 | import { createConsole } from '@object-ui/app-shell'; |
19 | 15 | import { AuthProvider } from '@object-ui/auth'; |
20 | 16 | import { Toaster } from 'sonner'; |
21 | | -import { |
22 | | - MyAppContent, |
23 | | - MyHomeLayout, |
24 | | - MyHomePage, |
25 | | - MyOrganizationsLayout, |
26 | | - MyOrganizationsPage, |
27 | | - MyLoginPage, |
28 | | - MyRegisterPage, |
29 | | - MyForgotPasswordPage, |
30 | | -} from './pages'; |
31 | 17 |
|
32 | 18 | const SERVER_URL = import.meta.env.VITE_SERVER_URL || ''; |
33 | 19 | const AUTH_URL = `${SERVER_URL}/api/v1/auth`; |
34 | 20 |
|
35 | | -const ConsoleApp = createConsole({ |
36 | | - basename: '/', |
37 | | - authPages: { |
38 | | - Login: MyLoginPage, |
39 | | - Register: MyRegisterPage, |
40 | | - ForgotPassword: MyForgotPasswordPage, |
41 | | - }, |
42 | | - homePage: { Layout: MyHomeLayout, Page: MyHomePage }, |
43 | | - organizationsPage: { Layout: MyOrganizationsLayout, Page: MyOrganizationsPage }, |
44 | | - AppContent: MyAppContent, |
45 | | -}); |
| 21 | +const ConsoleApp = createConsole({ basename: '/' }); |
46 | 22 |
|
47 | 23 | export function App() { |
48 | 24 | return ( |
|
0 commit comments