Skip to content

Add prototype structure for banking demo #1205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Environment variables for the demo
OPENAI_API_KEY=
2 changes: 2 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__
*.pyc
4 changes: 4 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Backend

This folder contains the Python backend using FastAPI and the OpenAI Agents SDK.
Run `uvicorn backend.main:app --reload` to start the development server.
Empty file added backend/__init__.py
Empty file.
8 changes: 8 additions & 0 deletions backend/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from fastapi import FastAPI

app = FastAPI()


@app.get("/health")
def health() -> dict[str, str]:
return {"status": "ok"}
12 changes: 12 additions & 0 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[project]
name = "banking-backend"
version = "0.1.0"
requires-python = ">=3.11"
dependencies = [
"fastapi",
"uvicorn",
"openai",
]

[tool.ruff]
line-length = 88
9 changes: 9 additions & 0 deletions backend/tests/test_main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from fastapi.testclient import TestClient
from backend.main import app


def test_health() -> None:
client = TestClient(app)
response = client.get("/health")
assert response.status_code == 200
assert response.json() == {"status": "ok"}
3 changes: 3 additions & 0 deletions docs/banking-demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Agentic Private Banker Demo

This document provides a high-level overview of the multi-agent banking prototype.
3 changes: 3 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.next
out
4 changes: 4 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Frontend

This folder contains the NextJS frontend for the Agentic Private Banker demo.
Run `npm install` and `npm run dev` to start the development server.
6 changes: 6 additions & 0 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
};

module.exports = nextConfig;
15 changes: 15 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "banking-frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"next": "latest",
"react": "latest",
"react-dom": "latest"
}
}
10 changes: 10 additions & 0 deletions frontend/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';

export default function Home() {
return (
<div>
<h1>Agentic Private Banker (Demo)</h1>
<p>Prototype frontend using NextJS.</p>
</div>
);
}
Empty file added frontend/public/.gitkeep
Empty file.
2 changes: 2 additions & 0 deletions frontend/tests/example.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Placeholder test file for frontend
export {}; // to make this a module
19 changes: 19 additions & 0 deletions frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
6 changes: 6 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
# Start frontend and backend for the Agentic Private Banker demo

( cd backend && uvicorn backend.main:app --reload & )
( cd frontend && npm run dev & )
wait
3 changes: 3 additions & 0 deletions test_repo/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Example environment variables.
OPENAI_API_KEY=your-key-here
BACKEND_URL=http://localhost:8000
Empty file added test_repo/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions test_repo/backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
__pycache__
*.pyc
.env
3 changes: 3 additions & 0 deletions test_repo/backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Backend

This folder contains the FastAPI backend for the banking demo.
Empty file added test_repo/backend/__init__.py
Empty file.
11 changes: 11 additions & 0 deletions test_repo/backend/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""FastAPI backend for the banking demo."""

from fastapi import FastAPI

app = FastAPI()


@app.get("/health")
def health() -> dict[str, str]:
"""Return service health status."""
return {"status": "ok"}
8 changes: 8 additions & 0 deletions test_repo/backend/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[project]
name = "banking-demo-backend"
version = "0.1.0"
dependencies = [
"fastapi",
"uvicorn",
"openai",
]
11 changes: 11 additions & 0 deletions test_repo/backend/tests/test_demo_main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from fastapi.testclient import TestClient

from test_repo.backend.main import app

client = TestClient(app)


def test_health() -> None:
response = client.get("/health")
assert response.status_code == 200
assert response.json() == {"status": "ok"}
3 changes: 3 additions & 0 deletions test_repo/docs/banking-demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Banking Demo Prototype

This document outlines the high-level structure for the banking demo prototype.
3 changes: 3 additions & 0 deletions test_repo/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.next
out
3 changes: 3 additions & 0 deletions test_repo/frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Frontend

This folder contains the Next.js prototype for the banking demo.
Empty file.
6 changes: 6 additions & 0 deletions test_repo/frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
};

module.exports = nextConfig;
15 changes: 15 additions & 0 deletions test_repo/frontend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "banking-demo-frontend",
"version": "0.1.0",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"test": "echo \"No tests\""
},
"dependencies": {
"next": "14.0.0",
"react": "18.2.0",
"react-dom": "18.2.0"
}
}
8 changes: 8 additions & 0 deletions test_repo/frontend/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';

// Home page for the prototype.
const Home: React.FC = () => {
return <div>Prototype Frontend</div>;
};

export default Home;
Empty file.
3 changes: 3 additions & 0 deletions test_repo/frontend/tests/example.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test('placeholder', () => {
expect(true).toBe(true);
});
19 changes: 19 additions & 0 deletions test_repo/frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
5 changes: 5 additions & 0 deletions test_repo/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# Launch backend and frontend for the demo.

(cd "$(dirname "$0")/backend" && uvicorn main:app --reload &)
(cd "$(dirname "$0")/frontend" && npm run dev)