Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
89499be
feat(Webapp): Created web app for commanddash
wadhia-yash Jul 5, 2024
d666ce4
fix(Prismjs): Removed unused library
wadhia-yash Jul 5, 2024
0f021e0
ci: add Azure Static Web Apps workflow file
samyakkkk Jul 5, 2024
2a91dc0
ci: add Azure Static Web Apps workflow file
samyakkkk Jul 5, 2024
62d2290
Delete .github/workflows/azure-static-web-apps-black-sand-05586260f.yml
samyakkkk Jul 5, 2024
dd1cff5
Update azure-static-web-apps-lemon-glacier-048ee240f.yml
samyakkkk Jul 5, 2024
86a13ec
Update azure-static-web-apps-lemon-glacier-048ee240f.yml
samyakkkk Jul 5, 2024
d404d96
Update azure-static-web-apps-lemon-glacier-048ee240f.yml
samyakkkk Jul 5, 2024
ca6479f
(feat): specifiy minimum node version
samyakkkk Jul 5, 2024
783238a
(feat): azure adapter added
samyakkkk Jul 5, 2024
10513de
Update azure-static-web-apps-lemon-glacier-048ee240f.yml
samyakkkk Jul 5, 2024
a0c7f35
(feat): index.html as fallback
samyakkkk Jul 5, 2024
b688c08
Merge branch 'web-app' of github.com:Welltested-AI/fluttergpt into we…
samyakkkk Jul 5, 2024
135af80
feat(Agents info): Added agent name, description and logo on the chat…
wadhia-yash Jul 6, 2024
3d0caee
Update azure-static-web-apps-lemon-glacier-048ee240f.yml
samyakkkk Jul 6, 2024
cb4bfd4
Update azure-static-web-apps-lemon-glacier-048ee240f.yml
samyakkkk Jul 7, 2024
c80970c
fix(Adapter): Changed the adapter settings from azure to node
wadhia-yash Jul 8, 2024
5b63c76
Add or update the Azure App Service build and deployment workflow config
samyakkkk Jul 8, 2024
2b217d1
fix(Github action): updated deployment path in the yml file
wadhia-yash Jul 8, 2024
96ce873
fix(Github action): Resolved indentation error in yml file
wadhia-yash Jul 8, 2024
9808a45
fix(Github workflow): Changed the path of installing dependency
wadhia-yash Jul 8, 2024
32e4ba0
fix(Workflow): Modified the workflow to deploy the web-app
wadhia-yash Jul 8, 2024
6139a92
fix(Workflow): Modified the workflow to deploy the sveltekit-app
wadhia-yash Jul 8, 2024
07e431f
fix(Workflow): Updated the release.zip path
wadhia-yash Jul 8, 2024
a6a8916
fix(Workflow): Updated the workflow of the installation and running p…
wadhia-yash Jul 8, 2024
aec0310
fix(Workflow): Updated the workflow
wadhia-yash Jul 8, 2024
0b1f20b
fix(Workflow): Corrected the path to start the app
wadhia-yash Jul 8, 2024
f01a21a
fix(Workflow): Added script file to start
wadhia-yash Jul 8, 2024
1620cc2
fix(package.json): changed script to run the code
wadhia-yash Jul 8, 2024
e689089
fix(package.json): changed script and workflow to run the script of …
wadhia-yash Jul 8, 2024
a3f1850
Merge branch 'develop' into web-app
wadhia-yash Jul 8, 2024
2a58a08
feat(Folder): Renamed to web folder
wadhia-yash Jul 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/web-app_web-app-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and deploy Node.js app to Azure Web App - web-app-prod

on:
push:
branches:
- web-app
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Node.js version
uses: actions/setup-node@v3
with:
node-version: "18.x"

- name: npm install, build, and test
run: |
cd commanddash_web_app
npm install
npm run build --if-present
npm run test --if-present
- name: Zip artifact for deployment
run: |
cd commanddash_web_app/build
zip -r ../release.zip build node_modules package.json package-lock.json
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: sveltekit-app
path: release.zip

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: "Production"
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
permissions:
id-token: write #This is required for requesting the JWT

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: sveltekit-app

- name: Unzip artifact for deployment
run: unzip release.zip -d deploy

- name: Login to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_818727A488FB487EA3BCC61BEC337FDD }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_58CC6F3841FB49A38469650AD296DCC8 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_7B7BF9D41759471DBA0ED64C44AF88AE }}

- name: "Deploy to Azure Web App"
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: "web-app-prod"
slot-name: "Production"
package: deploy
Binary file modified vscode/media/.DS_Store
Binary file not shown.
23 changes: 23 additions & 0 deletions web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
node_modules

# Output
.output
.vercel
/.svelte-kit
/build

# OS
.DS_Store
Thumbs.db

# Env
.env
.env.*
!.env.example
!.env.test

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

package-lock.json
1 change: 1 addition & 0 deletions web/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
38 changes: 38 additions & 0 deletions web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# create-svelte

Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).

## Creating a project

If you're seeing this, you've probably already done this step. Congrats!

```bash
# create a new project in the current directory
npm create svelte@latest

# create a new project in my-app
npm create svelte@latest my-app
```

## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```bash
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

## Building

To create a production version of your app:

```bash
npm run build
```

You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
41 changes: 41 additions & 0 deletions web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "commanddash-web-app",
"version": "0.0.1",
"private": true,
"engines": {
"node": ">=18.13.0"
},
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"start": "node build/index.js"
},
"devDependencies": {
"@iconify-json/carbon": "^1.1.36",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-node": "^5.2.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/showdown": "^2.0.6",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.39",
"svelte": "^4.2.7",
"svelte-adapter-azure-swa": "^0.20.0",
"svelte-check": "^3.6.0",
"tailwindcss": "^3.4.4",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"unplugin-icons": "^0.19.0",
"vite": "^5.0.3"
},
"type": "module",
"dependencies": {
"@lottiefiles/svelte-lottie-player": "^0.3.1",
"@tailwindcss/typography": "^0.5.13",
"showdown": "^2.1.0",
"tailwind-scrollbar": "^3.1.0"
}
}
6 changes: 6 additions & 0 deletions web/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
13 changes: 13 additions & 0 deletions web/src/app.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
}

export {};
12 changes: 12 additions & 0 deletions web/src/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover" class="h-full dark:bg-gray-900">
<div id="app" class="contents h-full">%sveltekit.body%</div>
</body>
</html>
7 changes: 7 additions & 0 deletions web/src/lib/components/NavConversationItem.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<a
data-sveltekit-noscroll
href="#"
class="group flex h-10 flex-none items-center gap-1.5 rounded-lg pl-2.5 pr-2 text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700
? 'bg-gray-100 dark:bg-gray-700'
: ''}"
>Task</a>
56 changes: 56 additions & 0 deletions web/src/lib/components/NavMenu.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<script lang="ts">
import NavConversationItem from "./NavConversationItem.svelte";
import { env as envPublic } from "$env/dynamic/public";
</script>

<div class="sticky top-0 flex flex-none items-center justify-between px-3 py-3.5 max-sm:pt-0">
<a
class="flex items-center rounded-xl text-lg font-semibold"
href="#"
>
{envPublic.PUBLIC_APP_NAME}
</a>
</div>

<div
class="scrollbar-custom flex flex-col gap-1 overflow-y-auto rounded-r-xl from-gray-50 px-3 pb-3 pt-2 max-sm:bg-gradient-to-t md:bg-gradient-to-l dark:from-gray-800/30"
>
<h4
class="mb-1.5 mt-4 pl-0.5 text-sm text-gray-400 first:mt-0 dark:text-gray-500"
>
Today
</h4>
<NavConversationItem />
</div>
<div
class="mt-0.5 flex flex-col gap-1 rounded-r-xl p-3 text-sm md:bg-gradient-to-l md:from-gray-50 md:dark:from-gray-800/30"
>
<button
type="button"
class="flex h-9 flex-none items-center gap-1.5 rounded-lg pl-2.5 pr-2 text-gray-500 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700"
>
Theme
</button>
<a
href="#"
class="flex h-9 flex-none items-center gap-1.5 rounded-lg pl-2.5 pr-2 text-gray-500 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700"
>
Assistants
<span
class="ml-auto rounded-full border border-gray-300 px-2 py-0.5 text-xs text-gray-500 dark:border-gray-500 dark:text-gray-400"
>New</span
>
</a>
<a
href="#"
class="flex h-9 flex-none items-center gap-1.5 rounded-lg pl-2.5 pr-2 text-gray-500 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700"
>
Settings
</a>
<a
href="#"
class="flex h-9 flex-none items-center gap-1.5 rounded-lg pl-2.5 pr-2 text-gray-500 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700"
>
About & Privacy
</a>
</div>
65 changes: 65 additions & 0 deletions web/src/lib/components/chat/ChatInput.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<script lang="ts">
import { isDesktop } from "$lib/utils/isDesktop";
import { onMount, createEventDispatcher } from "svelte";

export let value: string = "";
export let placeholder: string = "";
export let minRows = 1;
export let maxRows: null | number = null;
export let disabled: boolean = false;

let textareaElement: HTMLTextAreaElement;

const dispatch = createEventDispatcher<{ submit: void }>();

$: minHeight = `${1 + minRows * 1.5}em`;
$: maxHeight = maxRows ? `${1 + maxRows * 1.5}em` : `auto`;

function handleKeydown(event: KeyboardEvent) {
//submit on enter
if (event.key === "Enter" && !event.shiftKey) {
event.preventDefault();

textareaElement.blur();

if (isDesktop(window)) {
textareaElement.focus();
}

dispatch("submit");
}
}

onMount(() => {
if (isDesktop(window)) {
textareaElement.focus();
}
});
</script>

<div class="relative min-w-0 flex-1" on:paste>
<pre
class="scrollbar-custom invisible overflow-x-hidden overflow-y-scroll whitespace-pre-wrap break-words p-3"
aria-hidden="true"
style="min-height: {minHeight}; max-height: {maxHeight}"></pre>
<textarea
enterkeyhint="send"
tabindex="0"
rows="1"
bind:value
bind:this={textareaElement}
class="scrollbar-custom absolute top-0 m-0 h-full w-full resize-none scroll-p-3 overflow-x-hidden overflow-y-scroll border-0 bg-transparent p-3 outline-none focus:ring-0 focus-visible:ring-0"
{placeholder}
{disabled}
on:keydown={handleKeydown}
/>
</div>

<style>
pre,
textarea {
font-family: inherit;
box-sizing: border-box;
line-height: 1.5;
}
</style>
Loading