Skip to content

Commit

Permalink
convert to a NextJS webapp
Browse files Browse the repository at this point in the history
  • Loading branch information
deepu105 committed Feb 25, 2025
1 parent 0322ea9 commit 587005e
Show file tree
Hide file tree
Showing 72 changed files with 2,512 additions and 490 deletions.
12 changes: 12 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
OPENAI_API_KEY="YOUR_API_KEY"

# Okta FGA
FGA_API_URL=https://api.<region>.fga.dev
FGA_API_TOKEN_ISSUER=auth.fga.dev
FGA_API_AUDIENCE=https://api.<region>.fga.dev/
FGA_STORE_ID=<store_id>
FGA_CLIENT_ID=<client_id>
FGA_CLIENT_SECRET=<client_secret>

# Turn on demo mode
# NEXT_PUBLIC_DEMO="true"
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,11 @@ coverage/

# Misc
.cache/
.temp/
.temp/

# next.js
/.next/
/out/

# vercel
.vercel
46 changes: 46 additions & 0 deletions .gitignore copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.env

# vscode
.vscode
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"trailingComma": "all",
"semi": true,
"tabWidth": 2,
"printWidth": 120
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ Manager Level +
1. Install the dependencies

```sh
npm install
bun install # or npm install
```

2. Create a `.env` file using the format below:
2. Create a `.env.local` file using the format below:

```sh
# OpenAI
Expand Down Expand Up @@ -119,12 +119,12 @@ npm install
### Run the application

```sh
npm start
bun start # or npm start
```

## Technical Stack

This application is built with TypeScript, Node.js, LlamaIndex, and OpenFGA.
This application is built with TypeScript, Next.js, TailwindCSS, LlamaIndex, and OpenFGA.

## Data Sources

Expand Down
1,277 changes: 1,277 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/app/globals.css",
"baseColor": "zinc",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"ui": "@/components/ui",
"utils": "@/utils",
"lib": "@/utils",
"hooks": "@/utils"
},
"iconLibrary": "lucide"
}
5 changes: 5 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
8 changes: 8 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import withLlamaIndex from 'llamaindex/next';

/** @type {import('next').NextConfig} */
const nextConfig = {
transpilePackages: ['auth0-ai-js'],
};

export default withLlamaIndex(nextConfig);
67 changes: 43 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
{
"name": "smart-hr-assistant-cli",
"name": "auth0-smart-hr-assistant",
"version": "1.0.0",
"description": "An interactive HR Assistant Chatbot",
"main": "dist/index.js",
"bin": {
"smart-hr": "./dist/index.js"
},
"scripts": {
"build": "tsc",
"start": "ts-node src/index.ts",
"dev": "ts-node src/index.ts",
"prepare": "npm run build",
"dev": "next dev",
"build": "next build",
"start": "next build && next start",
"lint": "next lint",
"format": "prettier --write \"src\"",
"fga:init": "npx tsx ./scripts/fga-init.ts",
"fga:test": "fga model test --tests tests.fga.yaml",
"fga:transform": "fga model transform --file schema.fga"
Expand All @@ -21,23 +18,45 @@
"assistant",
"chatbot"
],
"author": "",
"license": "ISC",
"engines": {
"node": ">=18"
},
"author": "Deepu K Sasidharan <[email protected]>",
"license": "Apache-2.0",
"dependencies": {
"@openfga/sdk": "^0.8.0",
"chalk": "4.1.2",
"commander": "^11.0.0",
"dotenv": "^16.4.7",
"inquirer": "^8.2.5",
"llamaindex": "^0.8.31",
"marked": "^4.3.0",
"marked-terminal": "^5.2.0"
"ai": "^4.1.45",
"auth0-ai-js": "github:auth0-lab/auth0-ai-js#alpha-2",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"llamaindex": "^0.9.2",
"lucide-react": "^0.475.0",
"marked": "^15.0.7",
"next": "^15.1.5",
"next-themes": "^0.4.4",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-markdown": "^10.0.0",
"react-toastify": "11.0.3",
"sonner": "^1.7.2",
"tailwind-merge": "^2.6.0",
"tailwindcss-animate": "^1.0.7",
"use-stick-to-bottom": "^1.0.44",
"vaul": "^1.1.2",
"zod": "^3.24.2",
"zod-to-json-schema": "^3.23.2"
},
"devDependencies": {
"@types/inquirer": "*",
"@types/marked": "^4.3.0",
"@types/node": "*",
"ts-node": "*",
"typescript": "*"
}
"@types/node": "^22.13.4",
"@types/react": "19.0.9",
"@types/react-dom": "19.0.3",
"autoprefixer": "^10.4.20",
"eslint": "^9.20.1",
"eslint-config-next": "^15.1.7",
"postcss": "8.5.2",
"prettier": "^3.4.2",
"tailwindcss": "3.4.17",
"typescript": "5.7.3"
},
"packageManager": "[email protected]+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
}
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
13 changes: 13 additions & 0 deletions public/images/auth0-ai-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 0 additions & 84 deletions src/agent.ts

This file was deleted.

Loading

0 comments on commit 587005e

Please sign in to comment.