create-gentiq-app 0.7.6-beta.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.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Aryan Shekarlaban
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,30 @@
1
+ import fs from 'fs-extra';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = path.dirname(__filename);
7
+
8
+ async function copyTemplate() {
9
+ const src = path.join(__dirname, '..', '..', 'templates', 'starter');
10
+ const dest = path.join(__dirname, 'templates', 'starter');
11
+
12
+ console.log(`Copying template from ${src} to ${dest}...`);
13
+
14
+ await fs.ensureDir(dest);
15
+ await fs.emptyDir(dest);
16
+
17
+ await fs.copy(src, dest, {
18
+ filter: (src) => {
19
+ const basename = path.basename(src);
20
+ return !['node_modules', '.venv', '__pycache__', '.ruff_cache', 'dist', '.storage', 'gentiq.db', 'uv.lock', 'package-lock.json', 'pnpm-lock.yaml'].includes(basename);
21
+ }
22
+ });
23
+
24
+ console.log('Template copied successfully!');
25
+ }
26
+
27
+ copyTemplate().catch(err => {
28
+ console.error('Error copying template:', err);
29
+ process.exit(1);
30
+ });
package/index.js ADDED
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env node
2
+
3
+ import * as p from '@clack/prompts';
4
+ import color from 'picocolors';
5
+ import fs from 'fs-extra';
6
+ import path from 'path';
7
+ import { fileURLToPath } from 'url';
8
+
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = path.dirname(__filename);
11
+
12
+ async function main() {
13
+ console.clear();
14
+
15
+ p.intro(`${color.bgBlue(color.black(' create-gentiq-app '))}`);
16
+
17
+ // Determine target directory
18
+ let targetDir = process.argv[2];
19
+
20
+ if (!targetDir) {
21
+ const dirResponse = await p.text({
22
+ message: 'Where should we create your project?',
23
+ placeholder: './my-gentiq-app',
24
+ initialValue: './my-gentiq-app',
25
+ validate(value) {
26
+ if (value.length === 0) return 'Directory cannot be empty';
27
+ },
28
+ });
29
+
30
+ if (p.isCancel(dirResponse)) {
31
+ p.cancel('Operation cancelled');
32
+ process.exit(0);
33
+ }
34
+
35
+ targetDir = dirResponse;
36
+ }
37
+
38
+ const projectPath = path.resolve(process.cwd(), targetDir);
39
+
40
+ if (fs.existsSync(projectPath) && fs.readdirSync(projectPath).length > 0) {
41
+ const overwrite = await p.confirm({
42
+ message: `Directory ${targetDir} is not empty. Continue anyway?`,
43
+ initialValue: false,
44
+ });
45
+
46
+ if (p.isCancel(overwrite) || !overwrite) {
47
+ p.cancel('Operation cancelled');
48
+ process.exit(0);
49
+ }
50
+ }
51
+
52
+ const s = p.spinner();
53
+ s.start('Scaffolding project...');
54
+
55
+ try {
56
+ // 1. Copy files from template
57
+ // In dev, the template is in ../../templates/starter
58
+ // In prod when published, it might be in different relative path, but assuming we pack it together
59
+ // Let's resolve the starter template path. Since this is in packages/cli, it's 2 levels up.
60
+ let templateDir = path.join(__dirname, '..', '..', 'templates', 'starter');
61
+
62
+ // Fallback if packed differently on npm
63
+ if (!fs.existsSync(templateDir)) {
64
+ templateDir = path.join(__dirname, 'templates', 'starter');
65
+ }
66
+
67
+ await fs.copy(templateDir, projectPath, {
68
+ filter: (src) => {
69
+ const basename = path.basename(src);
70
+ return !['node_modules', '.venv', '__pycache__', '.ruff_cache', 'dist'].includes(basename);
71
+ }
72
+ });
73
+
74
+ // 2. Adjust frontend package.json
75
+ const frontendPkgPath = path.join(projectPath, 'frontend', 'package.json');
76
+ if (fs.existsSync(frontendPkgPath)) {
77
+ let pkgConfig = await fs.readJson(frontendPkgPath);
78
+ // Remove workspace dependency, replace with latest
79
+ pkgConfig.dependencies['gentiq'] = 'latest';
80
+ await fs.writeJson(frontendPkgPath, pkgConfig, { spaces: 2 });
81
+ }
82
+
83
+ // 3. Adjust backend pyproject.toml
84
+ // Already removed tool.uv.sources in the template, so it relies on the 'gentiq' pip package by default.
85
+ // If there's any other workspace specific replace, we can do it here.
86
+
87
+ s.stop(`Project scaffolded successfully!`);
88
+
89
+ p.note(
90
+ `${color.cyan('cd')} ${targetDir}\n\n` +
91
+ `${color.bold('Frontend:')}\n` +
92
+ `${color.cyan('cd')} frontend\n` +
93
+ `${color.cyan('npm')} install\n` +
94
+ `${color.cyan('npm')} run dev\n\n` +
95
+ `${color.bold('Backend:')}\n` +
96
+ `${color.cyan('cd')} backend\n` +
97
+ `${color.cyan('uv')} sync\n` +
98
+ `${color.cyan('uv')} run uvicorn main:app.api --reload --port 8000`,
99
+ 'Next Steps'
100
+ );
101
+
102
+ p.outro(`Good luck with your Gentiq app! Need help? Visit our docs.`);
103
+ } catch (error) {
104
+ s.stop('Failed to scaffold project');
105
+ console.error(error);
106
+ process.exit(1);
107
+ }
108
+ }
109
+
110
+ main().catch(console.error);
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "create-gentiq-app",
3
+ "version": "0.7.6-beta.1",
4
+ "description": "CLI to scaffold a new Gentiq application",
5
+ "type": "module",
6
+ "bin": {
7
+ "create-gentiq-app": "./index.js"
8
+ },
9
+ "files": [
10
+ "index.js",
11
+ "copy-template.js",
12
+ "templates"
13
+ ],
14
+ "dependencies": {
15
+ "@clack/prompts": "^0.7.0",
16
+ "picocolors": "^1.0.0",
17
+ "fs-extra": "^11.2.0"
18
+ },
19
+ "scripts": {
20
+ "start": "node index.js"
21
+ }
22
+ }
@@ -0,0 +1,72 @@
1
+ # Gentiq Default Template Application
2
+
3
+ **Location:** `/templates/default`
4
+
5
+ A world-class conversational AI scaffold built fully on the Gentiq Framework. This template serves as a complete, reference-ready application ready for extension and branding.
6
+
7
+ ## Quick Start (Minimal Environment)
8
+
9
+ 1. **Copy Environment**: Copy `.env.example` to `.env` in the project root and fill in your values (MongoDB, MinIO, AI Providers).
10
+ 2. **Setup Backend**:
11
+
12
+ ```bash
13
+ cd templates/default/backend && uv sync
14
+ ```
15
+
16
+ 3. **Run Backend**:
17
+
18
+ ```bash
19
+ uv run uvicorn main:app.api --reload --port 8000
20
+ ```
21
+
22
+ 4. **Setup Frontend**:
23
+
24
+ ```bash
25
+ cd templates/default/frontend && npm install
26
+ ```
27
+
28
+ 5. **Run Frontend**:
29
+
30
+ ```bash
31
+ npm run dev
32
+ ```
33
+
34
+ ## Development
35
+
36
+ The template app is configured to pull in core functionality from the local `packages/` directory for real-time development.
37
+
38
+ ### Backend Entrypoint (`templates/default/backend/main.py`)
39
+
40
+ Our backend leverages the `GentiqApp` factory to dynamically spin-up the core server logic.
41
+
42
+ ```python
43
+ from gentiq import GentiqApp
44
+
45
+ app = GentiqApp()
46
+ api = app.api # The FastAPI instance
47
+ ```
48
+
49
+ ### Frontend Entrypoint (`templates/default/frontend/src/App.tsx`)
50
+
51
+ The frontend is a lightweight Vite application that exports UI instances from the `gentiq` React package.
52
+
53
+ ```tsx
54
+ import { GentiqProvider, ChatUI, AdminPanel } from 'gentiq'
55
+ import 'gentiq/style.css'
56
+
57
+ export default function App() {
58
+ return (
59
+ <GentiqProvider>
60
+ {/* ... routes ... */}
61
+ </GentiqProvider>
62
+ )
63
+ }
64
+ ```
65
+
66
+ ## Features Included (Out-of-the-Box)
67
+
68
+ - **AI Streaming**: Real-time agent streaming via PydanticAI and Vercel SDK.
69
+ - **Admin Dashboard**: Comprehensive user analytics, history logs, and permissioning system.
70
+ - **Atomic Balance**: Integrated tracking and enforcement of per-user token and request limits.
71
+ - **MinIO/S3 Persistence**: Robust file storage for chat attachments and assistant multimodal context.
72
+ - **JWT Security Suite**: Encrypted user and administrative authentication flows.
@@ -0,0 +1,36 @@
1
+ # Default Backend Application
2
+
3
+ **Location:** `/templates/default/backend`
4
+
5
+ The production-ready FastAPI backend for the reference implementation application. This project demonstrates how to leverage the Gentiq framework to initialize a complete ai-agent ecosystem in mere lines of code.
6
+
7
+ ## Getting Started
8
+
9
+ 1. **Setup Core Environment**: Copy `.env.example` in the project root to `.env` and fill in necessary database and AI provider secrets.
10
+ 2. **Setup Dependencies**:
11
+
12
+ ```bash
13
+ uv sync
14
+ ```
15
+
16
+ 3. **Run Server**:
17
+
18
+ ```bash
19
+ uv run uvicorn main:app.api --reload --port 8000
20
+ ```
21
+
22
+ ## Logic Entrypoint (`main.py`)
23
+
24
+ The application consumes the `GentiqApp` factory from your local Python package. This factory handles all standard boilerplate for MongoDB persistence, JWT security, and chatbot orchestration.
25
+
26
+ ```python
27
+ from gentiq import GentiqApp
28
+ from pydantic_ai import Agent
29
+
30
+ agent = Agent(...)
31
+ app = GentiqApp(agent)
32
+ ```
33
+
34
+ ## Development
35
+
36
+ This backend is linked to the local `packages/gentiq-python` package in **editable mode** using `uv`. Any changes made within the core framework library will be immediately detected and reflected here during the next fast-API reload.
@@ -0,0 +1,60 @@
1
+ from dataclasses import dataclass
2
+
3
+ from fastapi import APIRouter
4
+ from pydantic_ai import Agent
5
+
6
+ from gentiq import (
7
+ AgentDeps,
8
+ GentiqApp,
9
+ create_title_agent,
10
+ )
11
+
12
+
13
+ # 1. Define custom context (any Pydantic model or dataclass)
14
+ @dataclass
15
+ class AppContext:
16
+ # Add any application-specific state here (e.g. user preferences, active project Id)
17
+ pass
18
+
19
+
20
+ # 2. Define custom agent with specified context type
21
+ instructions = """
22
+ You are a helpful AI assistant.
23
+ """
24
+
25
+ agent = Agent[AgentDeps[AppContext]](name="agent", instructions=instructions, model="openai:gpt-5.1")
26
+
27
+
28
+ # 3. Add custom tools
29
+ # @agent.tool
30
+ # async def my_tool(ctx: RunContext[AgentDeps[AppContext]], param: str) -> str:
31
+ # """
32
+ # A tool description goes here.
33
+ # """
34
+ # return f"Processed {param}"
35
+
36
+
37
+ # 4. Initialize the core backend framework application
38
+ # The framework automatically injects internal Stores into AgentDeps
39
+ app = GentiqApp[AppContext](
40
+ agent,
41
+ app_name="Gentiq App",
42
+ context=AppContext(),
43
+ db_engine="sqlite", # or mongodb for production
44
+ storage_engine="filesystem", # or minio for production
45
+ title_agent=create_title_agent(model_name="gpt-5-nano"),
46
+ send_to_logfire=True,
47
+ )
48
+
49
+
50
+ # 5. (Optional) Extend the API with custom routes protected by Gentiq's authentication
51
+ custom_router = APIRouter()
52
+
53
+ # @custom_router.get("/my-custom-endpoint")
54
+ # async def my_endpoint(user: Annotated[User, Depends(get_current_user)]):
55
+ # return {"message": f"Hello {user.name}!"}
56
+
57
+ app.add_router(custom_router, prefix="/ext", tags=["Extensions"])
58
+
59
+
60
+ # Command to run: uv run uvicorn main:app.api --reload --port 8000
@@ -0,0 +1,34 @@
1
+ [project]
2
+ name = "gentiq-app"
3
+ version = "0.1.0"
4
+ description = ""
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ dependencies = [
8
+ "gentiq",
9
+ ]
10
+
11
+ [tool.ruff]
12
+ line-length = 120
13
+ target-version = "py312"
14
+
15
+ [tool.ruff.lint]
16
+ select = [
17
+ "F",
18
+ "E",
19
+ "W",
20
+ "I",
21
+ "UP",
22
+ "B",
23
+ "C90",
24
+ "RUF"
25
+ ]
26
+ ignore = ["C901", "E501", "E741", "W605", "F403", "F405", "B904"]
27
+
28
+ [tool.ruff.lint.isort]
29
+ lines-after-imports = 2
30
+ known-first-party = ["gentiq"]
31
+ combine-as-imports = true
32
+
33
+ [tool.ruff.lint.pydocstyle]
34
+ convention = "google"
@@ -0,0 +1,56 @@
1
+ # Default Frontend Application
2
+
3
+ **Location:** `/templates/default/frontend`
4
+
5
+ The conversational React UI built by consuming the Gentiq React library. This project is a world-class reference implementation for building AI chatbots with [Vite](https://vite.dev/) and the [Vercel AI SDK](https://sdk.vercel.ai/).
6
+
7
+ ## Getting Started
8
+
9
+ 1. **Install Dependencies**:
10
+
11
+ ```bash
12
+ npm install
13
+ ```
14
+
15
+ 2. **Setup Library**:
16
+
17
+ ```bash
18
+ cd ../../../packages/gentiq-react && pnpm run build
19
+ ```
20
+
21
+ 3. **Run Dev Server**:
22
+
23
+ ```bash
24
+ npm run dev
25
+ ```
26
+
27
+ ## Development Flow
28
+
29
+ This application is linked to the local `packages/gentiq-react` package via a local file dependency (`file:../../../packages/gentiq-react`).
30
+
31
+ ### Hot Reloading
32
+
33
+ If you make changes to the **core library UI code** inside `packages/gentiq-react`, you must run its build script for those changes to reflect here:
34
+
35
+ ```bash
36
+ cd packages/gentiq-react && pnpm run build
37
+ ```
38
+
39
+ Then, the host application dev-server (Vite) will automatically detect the updated bundled files and perform a HMR/Refresh.
40
+
41
+ ### Architecture (`src/App.tsx`)
42
+
43
+ The application uses the `GentiqProvider` to initialize global state and renders the `ChatUI` and `AdminPanel` components directly exported from the framework.
44
+
45
+ ```tsx
46
+ import { GentiqProvider, ChatUI, AdminPanel } from 'gentiq'
47
+ import 'gentiq/style.css'
48
+
49
+ export default function App() {
50
+ return (
51
+ <GentiqProvider>
52
+ {/* ... routes ... */}
53
+ </GentiqProvider>
54
+ )
55
+ }
56
+ ```
@@ -0,0 +1,23 @@
1
+ import js from '@eslint/js'
2
+ import globals from 'globals'
3
+ import reactHooks from 'eslint-plugin-react-hooks'
4
+ import reactRefresh from 'eslint-plugin-react-refresh'
5
+ import tseslint from 'typescript-eslint'
6
+ import { defineConfig, globalIgnores } from 'eslint/config'
7
+
8
+ export default defineConfig([
9
+ globalIgnores(['dist']),
10
+ {
11
+ files: ['**/*.{ts,tsx}'],
12
+ extends: [
13
+ js.configs.recommended,
14
+ tseslint.configs.recommended,
15
+ reactHooks.configs.flat.recommended,
16
+ reactRefresh.configs.vite,
17
+ ],
18
+ languageOptions: {
19
+ ecmaVersion: 2020,
20
+ globals: globals.browser,
21
+ },
22
+ },
23
+ ])
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Chatbot</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.tsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "frontend",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc -b && vite build",
9
+ "lint": "eslint .",
10
+ "preview": "vite preview"
11
+ },
12
+ "dependencies": {
13
+ "gentiq": "workspace:*",
14
+ "react": "^19.2.0",
15
+ "react-dom": "^19.2.0",
16
+ "react-router-dom": "^7.13.1"
17
+ },
18
+ "devDependencies": {
19
+ "@eslint/js": "^9.39.1",
20
+ "@types/node": "^24.10.1",
21
+ "@types/react": "^19.2.7",
22
+ "@types/react-dom": "^19.2.3",
23
+ "@vitejs/plugin-react": "^5.1.1",
24
+ "eslint": "^9.39.1",
25
+ "eslint-plugin-react-hooks": "^7.0.1",
26
+ "eslint-plugin-react-refresh": "^0.4.24",
27
+ "globals": "^16.5.0",
28
+ "typescript": "~5.9.3",
29
+ "typescript-eslint": "^8.48.0",
30
+ "vite": "^7.3.1"
31
+ }
32
+ }
@@ -0,0 +1,10 @@
1
+ <svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 1280" width="500" height="500">
2
+ <style>
3
+ .s0 { opacity: 1;fill: #17535d }
4
+ .s1 { opacity: .99;fill: #fab185 }
5
+ </style>
6
+ <g id="gentiq (7)">
7
+ <path id="Path 1" fill-rule="evenodd" class="s0" d="m616.5 12.22c19.25-0.09 38.15 0.29 42 0.84 3.85 0.54 11.73 1.43 17.5 1.98 5.77 0.55 16.35 1.85 23.5 2.91 7.15 1.05 16.6 2.62 21 3.49 4.4 0.88 9.8 2.02 12 2.53 2.2 0.52 7.15 1.65 11 2.5 3.85 0.86 8.58 2 10.5 2.54 1.92 0.54 7.77 2.15 13 3.6 5.23 1.44 16.02 4.77 24 7.4 7.98 2.63 17.65 5.99 21.5 7.48 3.85 1.48 11.95 4.74 18 7.24 6.05 2.5 14.6 6.16 19 8.14 4.4 1.98 13.4 6.35 20 9.72 6.6 3.36 14.48 7.47 17.5 9.11 3.02 1.65 11.35 6.5 18.5 10.77 7.15 4.27 18.17 11.2 24.49 15.4 6.32 4.2 12.17 8.16 13 8.82 0.83 0.65 7.36 5.55 14.51 10.88 7.15 5.33 13.23 9.97 13.5 10.31 0.27 0.34 2.73 2.42 5.45 4.62 2.72 2.2 5.43 4.45 6.02 5 0.59 0.55 4.89 4.35 9.55 8.45 4.67 4.1 15.04 14 23.05 22 8.02 8 18.22 18.6 22.67 23.55 4.46 4.95 11.4 13.07 15.43 18.04 4.03 4.97 11.43 14.42 16.43 21 5.01 6.58 12.65 17.36 16.97 23.96 4.33 6.6 8.56 13.15 9.4 14.57 0.84 1.41 4.08 6.81 7.19 12 3.11 5.18 7.29 12.36 9.29 15.93 2 3.57 7.6 14.6 12.44 24.5 4.84 9.9 10.51 22.05 12.6 27 2.08 4.95 4.36 10.35 5.07 12 0.71 1.65 2.26 5.48 3.44 8.5 1.19 3.02 4.44 12.25 7.22 20.5 2.79 8.25 5.42 16.35 5.84 18 0.43 1.65 1.72 6.15 2.87 10 1.15 3.85 3.86 14.43 6.03 23.5 2.16 9.07 4.38 19.2 4.94 22.5 0.56 3.3 1.5 8.7 2.1 12 0.59 3.3 1.68 10.05 2.43 15 0.74 4.95 1.85 13.27 2.47 18.5 0.61 5.23 1.56 18.95 2.11 30.5 0.55 11.55 0.99 34.61 0.99 51.25 0 19.16-0.37 30.43-1 30.75-0.55 0.27-1 2.64-1.01 5.25 0 2.61-0.43 7.45-0.96 10.75-0.52 3.3-1.7 11.17-2.62 17.5-0.92 6.33-2.02 13.52-2.44 16-0.43 2.48-1.29 7.42-1.93 11-0.63 3.58-2.7 13.02-4.6 21-1.9 7.98-3.93 16.3-4.51 18.5-0.58 2.2-2.41 8.5-4.05 14-1.64 5.5-4.8 15.4-7.01 22-2.21 6.6-4.39 12.9-4.85 14-0.46 1.1-2.22 5.71-3.92 10.25-1.71 4.54-3.44 8.24-3.85 8.22-0.41-0.02-2.55-1.5-4.75-3.29-2.2-1.8-6.25-4.85-9-6.79-2.75-1.94-9.95-6.45-16-10.03-6.05-3.58-14.83-8.34-19.5-10.57-4.67-2.23-10.64-5.01-13.25-6.18-2.61-1.16-8.91-3.51-14-5.21-5.09-1.71-10.71-3.51-12.5-4-1.79-0.5-4.94-1.38-7-1.96-2.06-0.58-6.9-1.73-10.75-2.54-3.85-0.82-9.47-1.94-12.5-2.48-3.02-0.54-10.9-1.64-17.5-2.44-6.6-0.81-18.52-1.46-26.5-1.45-7.98 0-20.13 0.68-27 1.5-6.88 0.81-13.85 1.75-15.5 2.08-1.65 0.32-7.27 1.43-12.5 2.47-5.23 1.04-12.65 2.83-16.5 3.98-3.85 1.16-9.02 2.67-11.5 3.38-2.48 0.7-9.45 3.31-15.5 5.8-6.05 2.49-14.6 6.3-19 8.46-4.4 2.17-12.05 6.39-17 9.38-4.95 3-13.5 8.66-19 12.58-5.5 3.92-12.7 9.48-16 12.36-3.3 2.88-8.88 7.99-12.41 11.36-3.52 3.36-9.6 9.72-13.5 14.12-3.9 4.4-7.32 8.23-7.59 8.5-0.27 0.27-2.09 2.52-4.04 5-1.94 2.48-4.39 5.85-5.43 7.5-1.04 1.65-2.38 3.47-2.96 4.05-0.59 0.58-3.12 4.4-5.63 8.5-2.5 4.1-5.89 9.7-7.53 12.45-1.63 2.75-4.16 7.48-5.61 10.5-1.45 3.02-4.03 8.42-5.73 12-1.71 3.58-3.1 6.95-3.09 7.5 0 0.55-0.69 2.35-1.54 4-0.85 1.65-2.83 6.83-4.39 11.5-1.56 4.67-4.24 14.12-5.95 21-1.71 6.87-4.01 19.25-5.1 27.5-1.42 10.7-1.99 20.73-1.99 35 0 14.2 0.58 24.35 1.98 35 1.09 8.25 3.53 21.08 5.43 28.5 1.9 7.42 4.63 16.87 6.07 21 1.44 4.12 3.03 8.4 3.54 9.5 0.5 1.1 1.87 4.47 3.03 7.5 1.16 3.03 4.23 9.78 6.82 15 2.59 5.22 5.48 10.62 6.42 12 0.94 1.37 1.73 2.72 1.74 3 0.01 0.28-1.91 1.07-4.26 1.77-2.35 0.7-8.55 2.17-13.78 3.28-5.23 1.11-11.98 2.47-15 3.03-3.02 0.55-7.75 1.43-10.5 1.95-2.75 0.52-10.63 1.65-17.5 2.53-6.88 0.87-16.33 2-21 2.5-4.67 0.5-17.27 1.4-28 2.01-11.32 0.65-29.56 0.85-43.5 0.48-13.2-0.35-27.83-1.06-32.5-1.57-4.67-0.52-14.8-1.66-22.5-2.54-7.7-0.88-17.6-2.21-22-2.95-4.4-0.75-14.98-2.78-23.5-4.5-8.52-1.73-18.88-4.05-23-5.15-4.13-1.1-10.2-2.68-13.5-3.51-3.3-0.83-10.27-2.86-15.5-4.51-5.23-1.65-12.88-4.1-17-5.45-4.13-1.35-8.4-2.85-9.5-3.33-1.1-0.47-6.5-2.54-12-4.6-5.5-2.05-11.8-4.52-14-5.49-2.2-0.97-8.73-3.88-14.5-6.47-5.77-2.59-15.45-7.18-21.5-10.21-6.05-3.02-14.38-7.3-18.5-9.51-4.13-2.2-7.95-4.36-8.5-4.78-0.55-0.42-3.25-2.02-6-3.54-2.75-1.52-12.65-7.69-22-13.71-9.35-6.02-23.75-16.02-32-22.22-8.25-6.21-16.78-12.8-18.96-14.65-2.18-1.85-8.68-7.41-14.44-12.36-5.77-4.95-17.28-15.75-25.58-24-8.3-8.25-17.33-17.48-20.07-20.5-2.74-3.02-7.71-8.65-11.05-12.5-3.34-3.85-9.97-11.95-14.75-18-4.77-6.05-9.02-11.45-9.44-12-0.42-0.55-3.51-4.83-6.87-9.5-3.36-4.67-8.78-12.55-12.05-17.5-3.26-4.95-8.45-13.05-11.52-18-3.07-4.95-8.47-14.17-11.99-20.5-3.53-6.33-9.38-17.58-13-25-3.63-7.42-7.59-15.75-8.8-18.5-1.21-2.75-3.22-7.25-4.45-10-1.24-2.75-2.6-6.13-3.02-7.5-0.43-1.38-1.6-4.3-2.61-6.5-1.01-2.2-3.68-9.17-5.94-15.5-2.27-6.33-4.71-13.3-5.43-15.5-0.73-2.2-2.52-8.05-3.99-13-1.46-4.95-3.06-10.13-3.55-11.5-0.49-1.38-2.5-9.25-4.47-17.5-1.98-8.25-4.02-16.8-4.54-19-0.52-2.2-1.42-6.7-2-10-0.58-3.3-1.67-9.6-2.42-14-0.75-4.4-1.83-11.6-2.41-16-0.58-4.4-1.54-12.5-2.13-18-0.59-5.5-1.51-10.11-2.05-10.25-0.6-0.16-0.97-11.89-0.96-31 0-16.91 0.44-39.3 0.97-49.75 0.53-10.45 1.45-23.73 2.03-29.5 0.59-5.77 1.55-14.1 2.13-18.5 0.58-4.4 1.67-11.6 2.42-16 0.75-4.4 1.84-10.7 2.42-14 0.58-3.3 1.48-7.8 2-10 0.52-2.2 2.56-10.75 4.54-19 1.97-8.25 3.98-16.13 4.47-17.5 0.48-1.38 1.84-5.88 3.02-10 1.18-4.13 4.4-14.02 7.15-22 2.75-7.98 5.36-15.4 5.81-16.5 0.44-1.1 1.97-4.7 3.39-8 1.43-3.3 2.6-6.34 2.61-6.75 0.02-0.41 1.2-3.34 2.64-6.5 1.43-3.16 3.3-7.32 4.15-9.25 0.86-1.93 4.59-9.8 8.3-17.5 3.71-7.7 9.76-19.4 13.45-26 3.68-6.6 9.22-16.05 12.3-21 3.08-4.95 8.58-13.5 12.22-19 3.64-5.5 7.72-11.57 9.05-13.5 1.34-1.93 4.43-6.2 6.87-9.5 2.43-3.3 7.79-10.28 11.91-15.5 4.11-5.22 10.67-13.1 14.56-17.5 3.89-4.4 9.08-10.25 11.53-13 2.44-2.75 10.77-11.3 18.5-19.01 7.73-7.7 19.23-18.52 25.55-24.04 6.32-5.51 15.1-12.94 19.5-16.49 4.4-3.56 10.02-7.96 12.5-9.77 2.48-1.82 7.43-5.45 11-8.06 3.57-2.62 9.43-6.72 13-9.11 3.57-2.39 8.3-5.57 10.5-7.06 2.2-1.49 9.85-6.21 17-10.48 7.15-4.28 15.48-9.13 18.5-10.78 3.02-1.66 10.92-5.75 17.53-9.1 6.62-3.36 15.17-7.53 19-9.27 3.84-1.75 10.12-4.52 13.97-6.17 3.85-1.66 12.4-5.11 19-7.67 6.6-2.56 18.64-6.87 26.75-9.58 8.11-2.7 16.44-5.33 18.5-5.85 2.06-0.52 7.12-1.9 11.25-3.06 4.12-1.17 10.43-2.8 14-3.63 3.57-0.84 8.07-1.88 10-2.32 1.93-0.45 7.1-1.54 11.5-2.42 4.4-0.89 10.25-2.05 13-2.58 2.75-0.53 7.25-1.24 10-1.57 2.75-0.34 7.25-1.02 10-1.52 2.75-0.5 10.4-1.45 17-2.1 6.6-0.65 16.95-1.48 23-1.84 6.05-0.36 26.75-0.72 46-0.8zm-42.29 288.46c-6.99 0.78-16.76 2.31-21.71 3.4-4.95 1.09-11.48 2.67-14.5 3.51-3.02 0.84-7.98 2.24-11 3.12-3.02 0.88-10.45 3.5-16.5 5.83-6.05 2.33-14.82 6-19.5 8.16-4.68 2.15-12.77 6.32-18 9.26-5.23 2.94-13.32 7.87-18 10.95-4.68 3.09-11.2 7.62-14.5 10.08-3.3 2.45-8.93 6.92-12.5 9.92-3.57 3.01-12.15 11.12-19.05 18.03-6.9 6.91-15.61 16.38-19.34 21.06-3.73 4.68-10.49 14.13-15.01 21-4.53 6.88-9.98 15.65-12.11 19.5-2.13 3.85-5.64 10.6-7.79 15-2.15 4.4-5.5 11.82-7.43 16.5-1.94 4.68-4.38 11.2-5.43 14.5-1.06 3.3-3.22 10.5-4.81 16-1.59 5.5-3.42 12.7-4.06 16-0.64 3.3-1.58 8.25-2.08 11-0.5 2.75-1.58 9.95-2.39 16-0.95 7.05-1.49 19.36-1.49 34.25-0.01 12.79 0.45 26.51 1.02 30.5 0.56 3.99 1.5 10.17 2.07 13.75 0.58 3.58 1.73 9.88 2.57 14 0.84 4.13 2.88 12.23 4.53 18 1.65 5.77 4.12 13.88 5.5 18 1.37 4.13 2.84 7.95 3.27 8.5 0.42 0.55 1.68 3.48 2.79 6.5 1.11 3.02 3.79 9.1 5.94 13.5 2.15 4.4 5.66 11.15 7.78 15 2.13 3.85 7.59 12.63 12.14 19.5 4.54 6.88 11.3 16.33 15.02 21 3.73 4.67 12.09 13.9 18.58 20.5 6.5 6.6 14.62 14.29 18.05 17.09 3.43 2.8 10.05 7.98 14.73 11.51 4.68 3.53 12.1 8.74 16.5 11.58 4.4 2.83 10.02 6.3 12.5 7.7 2.48 1.4 9.45 4.99 15.5 7.97 6.05 2.98 13.25 6.42 16 7.65 2.75 1.23 12.2 4.61 21 7.5 8.8 2.9 21.62 6.44 28.5 7.89 6.87 1.44 14.52 3.04 17 3.55 2.48 0.51 13.27 1.48 24 2.15 15.34 0.97 23.66 0.97 39 0.01 10.73-0.67 21.3-1.6 23.5-2.08 2.2-0.47 6.7-1.37 10-1.99 3.3-0.63 8.92-1.82 12.5-2.66 3.58-0.84 10.1-2.58 14.5-3.87 4.4-1.29 12.27-3.89 17.5-5.78 5.23-1.89 11.51-4.29 13.96-5.33 2.46-1.04 10.33-4.84 17.5-8.44 7.17-3.61 18.21-9.87 24.54-13.92 6.33-4.04 12.68-8.3 14.12-9.44 1.45-1.15 3.87-2.99 5.39-4.09 1.53-1.1 3.56-2.67 4.52-3.5 0.97-0.83 4.51-3.75 7.88-6.5 3.37-2.75 11.85-10.86 18.86-18.02 7-7.16 16.15-17.51 20.34-23 4.19-5.49 10.3-14.03 13.6-18.98 3.29-4.95 7.48-11.7 9.3-15 1.83-3.3 5.43-10.27 8.02-15.5 2.58-5.23 5.41-11.08 6.28-13 0.88-1.92 2.57-5.98 3.75-9 1.18-3.02 3.02-8.2 4.08-11.5 1.07-3.3 3.22-10.5 4.78-16 1.56-5.5 3.34-12.02 3.96-14.5 0.61-2.48 1.6-7.42 2.18-11 0.59-3.58 1.51-9.65 2.04-13.5 0.54-3.85 1.34-13.98 1.79-22.5 0.44-8.52 0.44-22.25 0-30.5-0.45-8.25-1.25-18.15-1.79-22-0.53-3.85-1.46-9.92-2.05-13.5-0.59-3.58-2.01-10.33-3.14-15-1.14-4.67-2.44-9.62-2.89-11-0.45-1.37-1.84-5.87-3.08-10-1.24-4.12-3.56-10.87-5.15-15-1.59-4.12-3.6-9.07-4.47-11-0.87-1.93-3.71-7.77-6.31-13-2.59-5.23-5.55-11.07-6.56-13-1.01-1.93-3.99-6.87-6.62-11-2.63-4.12-7.45-11.32-10.7-16-3.25-4.68-9.5-12.77-13.89-18-4.39-5.23-13.1-14.45-19.36-20.5-6.26-6.05-15.21-14.06-19.88-17.8-4.68-3.74-10.92-8.47-13.88-10.5-2.96-2.04-9.26-6.13-14-9.1-4.74-2.97-13.12-7.77-18.62-10.66-5.5-2.89-14.5-7.13-20-9.42-5.5-2.28-10.9-4.56-12-5.06-1.1-0.49-6.05-2.24-11-3.88-4.95-1.65-11.02-3.49-13.5-4.09-2.48-0.6-9.23-2.16-15-3.47-5.77-1.3-15.9-3.11-22.5-4.02-6.81-0.93-20.87-1.79-32.5-1.97-11.27-0.17-22.66-0.08-25.29 0.21-2.63 0.29-10.51 1.16-17.5 1.94z"/>
8
+ <path id="Path 2" class="s1" d="m953.5 831.1c-2.75 0.49-7.7 1.38-11 1.99-3.3 0.61-8.48 1.77-11.5 2.57-3.02 0.81-9.33 2.84-14 4.52-4.67 1.68-13 5.31-18.5 8.06-5.5 2.75-12.48 6.61-15.5 8.58-3.02 1.97-8.2 5.61-11.5 8.08-3.3 2.47-9.33 7.44-13.39 11.05-4.07 3.6-10.64 10.38-14.61 15.05-3.96 4.67-10.02 12.77-13.46 18-3.44 5.22-7.84 12.65-9.78 16.5-1.94 3.85-5.1 11.05-7.02 16-1.92 4.95-4.35 11.92-5.39 15.5-1.04 3.58-2.57 9.65-3.39 13.5-0.83 3.85-2 13.3-2.61 21-0.81 10.28-0.8 17.79 0.02 28.25 0.62 7.84 2.22 18.86 3.55 24.5 1.33 5.64 3.42 13.17 4.65 16.75 1.22 3.58 4 10.55 6.17 15.5 2.17 4.95 6.32 13.05 9.22 18 2.91 4.95 7.71 12.22 10.66 16.15 2.96 3.94 8.08 10.19 11.38 13.89 3.3 3.7 10.05 10.13 15 14.28 4.95 4.15 13.05 10.21 18 13.47 4.95 3.25 11.92 7.4 15.5 9.2 3.58 1.81 10.55 4.92 15.5 6.91 4.95 1.99 12.83 4.69 17.5 6 4.67 1.3 9.85 2.69 11.5 3.07 1.65 0.39 6.83 1.33 11.5 2.1 5.11 0.84 15.89 1.4 27 1.4 10.17 0 20.08-0.41 22-0.92 1.92-0.5 6.2-1.45 9.5-2.1 3.3-0.65 10.27-2.42 15.5-3.93 5.22-1.5 13.55-4.41 18.5-6.46 4.95-2.05 13.05-5.96 18-8.68 4.95-2.73 13.5-8.3 19-12.39 5.5-4.08 13.97-11.38 18.82-16.21 4.86-4.83 12.1-13.06 16.09-18.28 3.99-5.22 9.09-12.65 11.32-16.5 2.23-3.85 5.93-10.83 8.21-15.5 2.28-4.67 5.68-13.22 7.55-19 1.87-5.78 3.86-12.3 4.41-14.5 0.55-2.2 1.7-8.39 2.55-13.75 0.98-6.14 1.55-16.31 1.54-27.5 0-12.91-0.53-20.88-1.94-29.25-1.06-6.33-3.1-15.33-4.52-20-1.43-4.67-3.03-9.29-3.56-10.25-0.53-0.96-0.97-2.2-0.97-2.75 0-0.55-0.86-2.91-1.92-5.25-1.06-2.34-2.98-6.5-4.28-9.25-1.29-2.75-4.32-8.38-6.72-12.5-2.41-4.13-5.99-9.75-7.98-12.5-1.98-2.75-4.5-6.1-5.6-7.45-1.1-1.35-4.03-4.71-6.5-7.48-2.47-2.76-5.63-6.17-7-7.56-1.38-1.39-5.65-5.28-9.5-8.64-3.85-3.36-11.5-9.16-17-12.89-5.5-3.73-14.3-8.85-19.55-11.38-5.26-2.53-10.88-5.15-12.5-5.82-1.62-0.68-6.33-2.39-10.45-3.8-4.13-1.42-10.65-3.26-14.5-4.09-3.85-0.84-10.83-2.16-15.5-2.94-5.29-0.88-15.11-1.38-26-1.32-9.63 0.05-19.75 0.49-22.5 0.97z"/>
9
+ </g>
10
+ </svg>
@@ -0,0 +1,112 @@
1
+ import { BrowserRouter, Route, Routes } from 'react-router-dom'
2
+ import { GentiqProvider, ChatUI, AdminPanel, RequireAuth, UserLoginPage, SharedChatView } from 'gentiq'
3
+ import type { GentiqComponents } from 'gentiq'
4
+ import 'gentiq/style.css'
5
+ import './index.css'
6
+
7
+ // ---------------------------------------------------------------------------
8
+ // Auth adapter
9
+ // ---------------------------------------------------------------------------
10
+ const LocalStorageAuthAdapter = {
11
+ getToken: () => localStorage.getItem('token'),
12
+ setToken: (token: string) => localStorage.setItem('token', token),
13
+ clearToken: () => localStorage.removeItem('token'),
14
+ getHeaders: (): Record<string, string> => {
15
+ const token = localStorage.getItem('token');
16
+ return token ? { 'Authorization': `Bearer ${token}` } : {};
17
+ },
18
+ }
19
+
20
+ // ---------------------------------------------------------------------------
21
+ // Component overrides registered through the unified GentiqComponents map.
22
+ // ---------------------------------------------------------------------------
23
+ const appComponents: GentiqComponents = {
24
+ // Add your custom tool components here:
25
+ // toolComponents: {
26
+ // my_tool_name: MyCustomToolComponent,
27
+ // },
28
+ }
29
+
30
+ // ---------------------------------------------------------------------------
31
+ // App
32
+ // ---------------------------------------------------------------------------
33
+ export default function App() {
34
+ return (
35
+ <GentiqProvider
36
+ app={{
37
+ name: "My Gentiq App",
38
+ logo: "/favicon.svg",
39
+ favicon: "/favicon.svg",
40
+ basePath: "/chat",
41
+ cacheNamespace: "my_app_cache",
42
+ }}
43
+ api={{
44
+ authAdapter: LocalStorageAuthAdapter,
45
+ }}
46
+ components={appComponents}
47
+ history={{
48
+ enabled: true,
49
+ showDelete: true,
50
+ showRename: true,
51
+ showPin: true,
52
+ showShare: true
53
+ }}
54
+ welcome={{
55
+ greeting: "welcome.message",
56
+ prompts: [] // Add initial quick prompts here
57
+ }}
58
+ threadActions={{
59
+ feedback: true,
60
+ retry: true,
61
+ }}
62
+ composer={{
63
+ placeholder: "chat.input_placeholder",
64
+ attachments: {
65
+ enabled: true,
66
+ maxSize: 10 * 1024 * 1024, // 10MB
67
+ types: ["image/*", ".pdf", ".txt", ".md", ".docx"]
68
+ }
69
+ }}
70
+ theme={{
71
+ radius: 16,
72
+ accent: '#3c85f1',
73
+ }}
74
+ i18n={{
75
+ resources: {
76
+ en: {
77
+ chat: {
78
+ input_placeholder: 'Type your message...',
79
+ },
80
+ welcome: {
81
+ message: "Hello! How can I help you today?",
82
+ }
83
+ }
84
+ }
85
+ }}
86
+ >
87
+ <BrowserRouter>
88
+ <Routes>
89
+ <Route path="/login" element={<UserLoginPage />} />
90
+ <Route path="/admin/*" element={<AdminPanel />} />
91
+ <Route path="/shared/:shareId" element={<SharedChatView />} />
92
+ <Route
93
+ path="/chat/*"
94
+ element={
95
+ <RequireAuth>
96
+ <ChatUI />
97
+ </RequireAuth>
98
+ }
99
+ />
100
+ <Route
101
+ path="/"
102
+ element={
103
+ <RequireAuth>
104
+ <ChatUI />
105
+ </RequireAuth>
106
+ }
107
+ />
108
+ </Routes>
109
+ </BrowserRouter>
110
+ </GentiqProvider>
111
+ )
112
+ }
@@ -0,0 +1,38 @@
1
+ :root {
2
+ /* Phase 1 Verification Overrides */
3
+ --gentiq-primary: oklch(62.637% 0.17799 258.408);
4
+ --gentiq-radius: 16px;
5
+
6
+ --gentiq-font-family: "Lato", "Vazirmatn", ui-sans-serif, system-ui, sans-serif;
7
+
8
+ /* Map the template variables to the tokens if needed,
9
+ though the library already does this.
10
+ Removing the literal values so tokens win. */
11
+ }
12
+
13
+ body {
14
+ font-family: var(--gentiq-font-family), system-ui, -apple-system, sans-serif !important;
15
+ font-weight: 400; /* Force regular weight */
16
+ -webkit-font-smoothing: antialiased;
17
+ -moz-osx-font-smoothing: grayscale;
18
+ line-height: 1.5;
19
+ }
20
+
21
+ /* Custom scrollbar for a cleaner look */
22
+ ::-webkit-scrollbar {
23
+ width: 6px;
24
+ height: 6px;
25
+ }
26
+
27
+ ::-webkit-scrollbar-track {
28
+ background: transparent;
29
+ }
30
+
31
+ ::-webkit-scrollbar-thumb {
32
+ background: rgba(0, 0, 0, 0.1);
33
+ border-radius: 10px;
34
+ }
35
+
36
+ .dark ::-webkit-scrollbar-thumb {
37
+ background: rgba(255, 255, 255, 0.1);
38
+ }
@@ -0,0 +1,9 @@
1
+ import { StrictMode } from 'react'
2
+ import { createRoot } from 'react-dom/client'
3
+ import App from './App.tsx'
4
+
5
+ createRoot(document.getElementById('root')!).render(
6
+ <StrictMode>
7
+ <App />
8
+ </StrictMode>,
9
+ )
@@ -0,0 +1,28 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
+ "target": "ES2022",
5
+ "useDefineForClassFields": true,
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "module": "ESNext",
8
+ "types": ["vite/client"],
9
+ "skipLibCheck": true,
10
+
11
+ /* Bundler mode */
12
+ "moduleResolution": "bundler",
13
+ "allowImportingTsExtensions": true,
14
+ "verbatimModuleSyntax": true,
15
+ "moduleDetection": "force",
16
+ "noEmit": true,
17
+ "jsx": "react-jsx",
18
+
19
+ /* Linting */
20
+ "strict": true,
21
+ "noUnusedLocals": true,
22
+ "noUnusedParameters": true,
23
+ "erasableSyntaxOnly": true,
24
+ "noFallthroughCasesInSwitch": true,
25
+ "noUncheckedSideEffectImports": true
26
+ },
27
+ "include": ["src"]
28
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.app.json" },
5
+ { "path": "./tsconfig.node.json" }
6
+ ]
7
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "ES2023",
5
+ "lib": ["ES2023"],
6
+ "module": "ESNext",
7
+ "types": ["node"],
8
+ "skipLibCheck": true,
9
+
10
+ /* Bundler mode */
11
+ "moduleResolution": "bundler",
12
+ "allowImportingTsExtensions": true,
13
+ "verbatimModuleSyntax": true,
14
+ "moduleDetection": "force",
15
+ "noEmit": true,
16
+
17
+ /* Linting */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "erasableSyntaxOnly": true,
22
+ "noFallthroughCasesInSwitch": true,
23
+ "noUncheckedSideEffectImports": true
24
+ },
25
+ "include": ["vite.config.ts"]
26
+ }
@@ -0,0 +1,25 @@
1
+ import { defineConfig } from 'vite'
2
+ import react from '@vitejs/plugin-react'
3
+
4
+ // https://vite.dev/config/
5
+ export default defineConfig({
6
+ plugins: [
7
+ react({
8
+ babel: {
9
+ compact: false,
10
+ },
11
+ }),
12
+ ],
13
+ optimizeDeps: {
14
+ exclude: ['gentiq'],
15
+ },
16
+ server: {
17
+ proxy: {
18
+ '/api': {
19
+ target: 'http://localhost:8000',
20
+ changeOrigin: true,
21
+ },
22
+ },
23
+ },
24
+ })
25
+