Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
04fa19d
Add or update the Azure App Service build and deployment workflow config
mvadher Oct 2, 2024
e36a630
Update main_mvapp.yml
mvadher Oct 2, 2024
1178c38
main_mvapp.yml
mvadher Oct 2, 2024
7e887e7
Update theme-config.ts
mvadher Oct 10, 2024
fa7401b
Update theme-config.ts
mvadher Oct 10, 2024
51a619c
Update theme-config.ts
mvadher Nov 1, 2024
a310859
Update theme-config.ts
mvadher Nov 1, 2024
ca21975
Update theme-config.ts
mvadher Nov 1, 2024
63b08e8
Update theme-config.ts
mvadher Nov 1, 2024
7191370
Update theme-config.ts
mvadher Nov 1, 2024
0860cf1
Update theme-config.ts
mvadher Nov 1, 2024
da5dc39
Update globals.css
mvadher Nov 2, 2024
ade83db
Update globals.css
mvadher Nov 2, 2024
a86de4c
Update button.tsx
mvadher Nov 3, 2024
c0d9a33
Update button.tsx
mvadher Nov 3, 2024
82b367e
Update button.tsx
mvadher Nov 3, 2024
87d58b9
Update globals.css
mvadher Nov 3, 2024
189c34d
Update button.tsx
mvadher Nov 3, 2024
bc6efb3
Update button.tsx
mvadher Nov 3, 2024
f4b787b
Update button.tsx
mvadher Nov 3, 2024
0aa7aa1
Update globals.css
mvadher Nov 3, 2024
4ecd989
Update button.tsx
mvadher Nov 3, 2024
de676a7
Add files via upload
mvadher Nov 3, 2024
92e799e
Rename ai-icon.png to ai-icon1.png
mvadher Nov 3, 2024
a702fbb
Rename HalloweenJackoLanternPumpkinTall.png to ai-icon.png
mvadher Nov 3, 2024
992a2ca
Update button.tsx
mvadher Nov 3, 2024
b84a599
Update button.tsx
mvadher Nov 3, 2024
3ff0fd5
Update globals.css
mvadher Nov 3, 2024
9598956
Update theme-config.ts
mvadher Nov 3, 2024
8b6b734
Delete src/app/favicon.ico
mvadher Nov 3, 2024
06d3f5d
Add files via upload
mvadher Nov 3, 2024
12c8855
Rename Favicon.ico.png to Favicon.ico
mvadher Nov 3, 2024
a087ea7
Update globals.css
mvadher Nov 3, 2024
53eae5e
Update hero.tsx
mvadher Nov 3, 2024
1b06d5a
Update hero.tsx
mvadher Nov 3, 2024
103a90a
Update hero.tsx
mvadher Nov 3, 2024
8c5b740
Keyvault setting
mvadher Apr 19, 2025
ec70b02
add generate-msdoc API for Word document upload to OneDrive
mvadher Apr 20, 2025
3052378
Merge branch 'main' into mvadher/issue510
mvadher Apr 20, 2025
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
73 changes: 73 additions & 0 deletions .github/workflows/main_mvapp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build and deploy Python app to Azure Web App - mvapp

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python version
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Create and start virtual environment
run: |
python -m venv venv
source venv/bin/activate

- name: Install dependencies
run: |
source venv/bin/activate
pip install -r requirements.txt

# Optional: Add step to run tests here (PyTest, Django test suites, etc.)

- name: Zip artifact for deployment
run: zip -r release.zip . -x "venv/*"

- name: Upload artifact for deployment jobs
uses: actions/upload-artifact@v4
with:
name: python-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

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

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

- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_06E5C5435BC7414FB166FB23024F3C82 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_F872316154384EC089D46A6C30966422 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_A8661C914A404B19B853D3847956A86C }}

- name: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v3
id: deploy-to-webapp
with:
app-name: 'mvapp'
slot-name: 'Production'
63 changes: 63 additions & 0 deletions src/app/(authenticated)/api/generate-msdoc/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { NextRequest, NextResponse } from "next/server";
import { Client } from "@microsoft/microsoft-graph-client";
import { ConfidentialClientApplication } from "@azure/msal-node";
import { Document, Packer, Paragraph, TextRun } from "docx";
import "isomorphic-fetch";

export async function POST(req: NextRequest) {
const { filename, content } = await req.json();

if (!filename || !content) {
return NextResponse.json({ error: "Missing filename or content" }, { status: 400 });
}

try {
const msalConfig = {
auth: {
clientId: process.env.MS_GRAPH_CLIENT_ID!,
authority: `https://login.microsoftonline.com/${process.env.MS_GRAPH_TENANT_ID}`,
clientSecret: process.env.MS_GRAPH_CLIENT_SECRET!,
},
};

const cca = new ConfidentialClientApplication(msalConfig);
const tokenResponse = await cca.acquireTokenByClientCredential({
scopes: ["https://graph.microsoft.com/.default"],
});

const accessToken = tokenResponse?.accessToken;
if (!accessToken) {
return NextResponse.json({ error: "Failed to acquire token" }, { status: 401 });
}

// Create Word document
const doc = new Document({
sections: [
{
children: [
new Paragraph({ children: [new TextRun({ text: filename, bold: true, size: 28 })] }),
new Paragraph({ children: [new TextRun(content)] }),
],
},
],
});

const buffer = await Packer.toBuffer(doc);

const graphClient = Client.init({
authProvider: (done) => done(null, accessToken),
});

const uploadResponse = await graphClient
.api(`/me/drive/root:/${filename}.docx:/content`)
.put(buffer);

return NextResponse.json({
message: "File created in OneDrive",
fileUrl: uploadResponse.webUrl,
});
} catch (err: any) {
console.error(err);
return NextResponse.json({ error: err.message }, { status: 500 });
}
}
Binary file added src/app/Favicon.ico
Binary file not shown.
Binary file removed src/app/favicon.ico
Binary file not shown.
10 changes: 5 additions & 5 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
--card-foreground: 222.2 84% 4.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;
--primary: 136 80% 29%;
--primary: 206.04, 43.8%, 23.73%;
--primary-foreground: 210 40% 98%;
--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;
--destructive: 0 84.2% 60.2%;
--destructive: 40.7 99.2% 48.4%;
--destructive-foreground: 210 40% 98%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
Expand All @@ -33,20 +33,20 @@
--card-foreground: 210 40% 98%;
--popover: 222.2 84% 4.9%;
--popover-foreground: 210 40% 98%;
--primary: 136 80% 42%;
--primary: 206.04, 43.8%, 76.27%;
--primary-foreground: 222.2 47.4% 11.2%;
--secondary: 217.2 32.6% 17.5%;
--secondary-foreground: 210 40% 98%;
--muted: 217.2 32.6% 17.5%;
--muted-foreground: 215 20.2% 65.1%;
--accent: 217.2 32.6% 17.5%;
--accent-foreground: 210 40% 98%;
--destructive: 0 62.8% 30.6%;
--destructive: 40.7 99.2% 51.6%;
--destructive-foreground: 210 40% 98%;
--border: 217.2 32.6% 17.5%;
--input: 217.2 32.6% 17.5%;
--ring: 212.7 26.8% 83.9;
}
}
}

@layer base {
Expand Down
4 changes: 2 additions & 2 deletions src/features/theme/theme-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const AI_NAME = "Azure Chat";
export const AI_DESCRIPTION = "Azure Chat is a friendly AI assistant.";
export const AI_NAME = "Dayta Lab AI";
export const AI_DESCRIPTION = "Experience secure, private AI solutions designed to transform data into valuable insights for your business. At Dayta Lab, your data privacy is our priority—analyze, generate, and manage insights with confidence on our trusted platform.";
export const CHAT_DEFAULT_PERSONA = AI_NAME + " default";

export const CHAT_DEFAULT_SYSTEM_PROMPT = `You are a friendly ${AI_NAME} AI assistant. You must always return in markdown format.
Expand Down
4 changes: 2 additions & 2 deletions src/features/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const buttonVariants = cva(
{
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90",
default: "bg-primary text-primary-foreground hover:bg-destructive/90",
destructive:
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
"bg-destructive text-destructive-foreground hover:bg-destructive/90)",
outline:
"border border-input bg-background hover:bg-accent hover:text-accent-foreground",
secondary:
Expand Down
6 changes: 3 additions & 3 deletions src/features/ui/hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ interface HeroProps extends PropsWithChildren {

export const Hero: FC<HeroProps> = (props) => {
return (
<div className="border-b w-full py-16">
<div className="container max-w-4xl h-full flex flex-col gap-16">
<div className="border-b w-full py-4">
<div className="container max-w-4xl h-full flex flex-col gap-4">
<div className="flex gap-6 flex-col items-start">
<h1 className="text-4xl font-bold flex gap-2 items-center">
{props.title}
</h1>
<p className="text-muted-foreground max-w-xl">{props.description}</p>
<p className="text-muted-foreground max-w-4xl">{props.description}</p>
</div>
<div className="grid grid-cols-3 gap-2">{props.children}</div>
</div>
Expand Down
Binary file added src/public/ai-icon11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.