Skip to content

Commit 8ea36cc

Browse files
face lift
1 parent 11b6fd3 commit 8ea36cc

63 files changed

Lines changed: 5412 additions & 20445 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ build/
2121
azure/overrides.yaml
2222
aws/overrides.yaml
2323
gcp/overrides.yaml
24+
azure/k8s/secret.yaml
25+
aws/k8s/secret.yaml
26+
gcp/k8s/secret.yaml
2427

2528
# ignore teffaform inits
2629
.terraform/
@@ -44,3 +47,4 @@ tfplan
4447
**/*.asc
4548
**/*.tgz
4649
**/*.tgz.prov
50+

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
- **Search & Organization**: Advanced search capabilities across your document library
2525

2626
### 🤖 **AI Chat Assistant**
27-
- **Intelligent Conversations**: Chat with an AI assistant powered by Ollama's phi:latest model
27+
- **Intelligent Conversations**: Chat with an AI assistant powered by Ollama's tinyllama:1.1b-chat model
2828
- **Context-Aware Responses**: AI that understands your business context and documents
2929
- **Local AI Processing**: Privacy-focused AI that runs entirely on your infrastructure
3030

@@ -39,7 +39,7 @@ Boring Paper Co is built using a **microservices architecture** with 5 core serv
3939
| **SDK** | Core business logic and API | Go, Echo framework |
4040
| **ContainerXDR** | Security monitoring & terminal | Go, WebSocket support |
4141
| **AI Chat** | AI conversation interface | Go, Ollama integration |
42-
| **Ollama** | Local AI model inference | Ollama, phi:latest model |
42+
| **Ollama** | Local AI model inference | Ollama, tinyllama:1.1b-chat model |
4343

4444
### Key Technical Features
4545

aws/k8s/secret.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ data:
88
# Base64 encoded values - replace with your actual encoded API_KEY and REGION
99
# To encode: echo -n "your-api-key/region" | base64
1010
# Decrypt API_KEY for flag, then encrypt with your own API_KEY and Region
11-
API_KEY: "" # Add your base64 encoded API_KEY here
12-
REGION: ""
11+
API_KEY: ""
12+
REGION: ""

local/docker-compose.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
build:
1010
context: ../sdk
1111
ports:
12-
- "5000:5000"
12+
- "5050:5000" # Changed to 5050 to avoid macOS AirPlay conflict on 5000
1313
env_file:
1414
- .env
1515
environment:
@@ -38,17 +38,16 @@ services:
3838
networks:
3939
- bpc-net
4040

41-
# ───────────── UI ───────────────
41+
# ───────────── UI (TypeScript Edition) ───────────────
4242
ui:
4343
build:
44-
context: ../ui # uses the Dockerfile we just created
44+
context: ../ui # uses the new TypeScript UI with Vite
4545
ports:
4646
- "8080:80" # host:container → browse http://localhost:8080
4747
depends_on:
4848
- sdk-service # ensure backend is up first
4949
environment:
5050
# Runtime base URL for your frontend to call the SDK API **inside** the Docker network
51-
# (adapt the variable name to whatever your build expects, e.g. VITE_*/REACT_APP_*)
5251
VITE_API_BASE_URL: http://sdk-service:5000
5352
VITE_OLLAMA_URL: http://ollama-service:11434
5453
VITE_AICHAT_URL: http://aichat-service:5001

ui/.gitignore

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
3-
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.js
7-
8-
# testing
9-
/coverage
10-
11-
# production
12-
/build
13-
14-
# misc
15-
.DS_Store
16-
.env.local
17-
.env.development.local
18-
.env.test.local
19-
.env.production.local
20-
1+
# Logs
2+
logs
3+
*.log
214
npm-debug.log*
225
yarn-debug.log*
236
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

ui/Dockerfile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
########## 1️⃣ Build stage ####################################
1+
# Build stage
22
FROM node:20-alpine AS builder
33
WORKDIR /app
44

5-
# Copy only package files and install deps
5+
# Copy package files
66
COPY package*.json ./
7-
RUN npm ci --legacy-peer-deps
7+
RUN npm ci
88

9-
# Copy the rest of the source
9+
# Copy source files
1010
COPY . .
1111

12+
# Build the application
1213
RUN npm run build
1314

14-
########## 2️⃣ Runtime stage ##################################
15+
# Runtime stage
1516
FROM nginx:1.25-alpine
17+
18+
# Copy nginx configuration
1619
COPY nginx.conf /etc/nginx/conf.d/default.conf
17-
COPY --from=builder /app/build /usr/share/nginx/html
20+
21+
# Copy built files
22+
COPY --from=builder /app/dist /usr/share/nginx/html
1823

1924
EXPOSE 80
25+
2026
CMD ["nginx", "-g", "daemon off;"]

ui/README.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# The Boring Paper Company - TypeScript Edition
2+
3+
A modern TypeScript React application for a paper manufacturing company with custom watermark functionality and shopping cart features.
4+
5+
## Features
6+
7+
- 🛍️ **Product Catalog** - Browse and add paper products to cart
8+
- 💧 **Custom Watermarks** - Upload images or text to create custom watermarks
9+
- 🛒 **Shopping Cart** - Manage items with quantity controls
10+
- 🤖 **AI Chat Assistant** - Interactive chatbot with security controls
11+
- 📤 **File Upload** - Secure file scanning with backend API integration
12+
- 🎨 **Vintage Theme** - Dark, elegant design with creamy accents
13+
-**TypeScript** - Fully typed for better development experience
14+
- 🚀 **Vite** - Fast development and optimized builds
15+
16+
## Tech Stack
17+
18+
- **React 18** with TypeScript
19+
- **Material-UI** (MUI) v7 for components
20+
- **React Router** for navigation
21+
- **Vite** for build tooling
22+
- **Context API** for state management
23+
- **Backend APIs** - SDK, Chat, XDR services
24+
25+
## Getting Started
26+
27+
### Installation
28+
29+
\`\`\`bash
30+
npm install
31+
\`\`\`
32+
33+
### Development
34+
35+
\`\`\`bash
36+
npm run dev
37+
\`\`\`
38+
39+
Runs on http://localhost:3000
40+
41+
### Build
42+
43+
\`\`\`bash
44+
npm run build
45+
\`\`\`
46+
47+
### Preview
48+
49+
\`\`\`bash
50+
npm run preview
51+
\`\`\`
52+
53+
## Project Structure
54+
55+
\`\`\`
56+
bpc/
57+
├── src/
58+
│ ├── assets/ # Static assets (images, logos)
59+
│ ├── components/ # Reusable components
60+
│ ├── context/ # React Context providers
61+
│ ├── pages/ # Page components
62+
│ ├── theme/ # MUI theme configuration
63+
│ ├── types/ # TypeScript interfaces
64+
│ ├── App.tsx # Main app component
65+
│ └── main.tsx # Entry point
66+
├── public/ # Public assets
67+
└── package.json # Dependencies
68+
\`\`\`
69+
70+
## Features Overview
71+
72+
### Product Catalog
73+
- View available paper products
74+
- Add items to shopping cart
75+
- Category filtering
76+
- Stock status indicators
77+
78+
### Custom Watermarks
79+
- Upload image files (PNG, JPEG, GIF, WebP)
80+
- Create text-based watermarks
81+
- Adjust opacity and scale
82+
- Position control (X/Y coordinates)
83+
- Live preview
84+
- Edit and delete watermarks
85+
- Optional backend file scanning via API
86+
87+
### Shopping Cart
88+
- Add/remove items
89+
- Quantity controls
90+
- Price calculation
91+
- Order summary
92+
- Cart persistence during session
93+
94+
### AI Chat Assistant
95+
- Interactive chatbot with AI responses
96+
- Security protection toggle
97+
- Real-time message handling
98+
- Error handling and recovery
99+
100+
### Backend API Integration
101+
The app connects to backend services:
102+
- `/api/chat/` - AI chat service (port 5001)
103+
- `/api/sdk/` - File upload and scanning (port 5000)
104+
- `/api/xdr/` - Container XDR service (port 8081, WebSocket)
105+
- `/api/ollama/` - LLM service (port 11434)
106+
107+
## Development Notes
108+
109+
This is a demo/educational project showcasing:
110+
- TypeScript best practices
111+
- React Context API
112+
- Material-UI theming
113+
- File upload handling
114+
- State management
115+
116+
Not intended for production use without additional security hardening.

0 commit comments

Comments
 (0)