This commit is contained in:
hitchhiker 2025-04-19 19:26:03 +02:00
parent e7ddf755ea
commit e427cd2eb3
24 changed files with 35 additions and 35 deletions

View File

@ -1,6 +1,6 @@
CLIENT_BASE_PATH=/ CLIENT_BASE_PATH=/
CLIENT_API_URL=https://localhost:7205 CLIENT_API_URL=https://localhost:7205
CLIENT_APP_NAME=Merchant Operator App CLIENT_APP_NAME=App
CLIENT_DEBUG=true CLIENT_DEBUG=true
CLIENT_MAP_TILE_ENDPOINT=https://tiles.locationiq.com/v3/streets/vector.json CLIENT_MAP_TILE_ENDPOINT=https://tiles.locationiq.com/v3/streets/vector.json
CLIENT_MAP_TILE_API_KEY=pk.19d62daa998822ac22861d96a0424b58 CLIENT_MAP_TILE_API_KEY=pk.19d62daa998822ac22861d96a0424b58

View File

@ -1,6 +1,6 @@
CLIENT_BASE_PATH=/ CLIENT_BASE_PATH=/
CLIENT_API_URL=https:// CLIENT_API_URL=https://
CLIENT_APP_NAME=Merchant Operator App CLIENT_APP_NAME=App
CLIENT_DEBUG=true CLIENT_DEBUG=true
CLIENT_MAP_TILE_ENDPOINT=https:// CLIENT_MAP_TILE_ENDPOINT=https://
CLIENT_MAP_TILE_API_KEY= CLIENT_MAP_TILE_API_KEY=

View File

@ -1,6 +1,6 @@
# Merchant Operator Web # Web
Merchant Operator App is a browser-only React SPA that lets local businesses create, edit, and audit their own merchant records on Local—a community-commerce network running on the peer-to-peer FogBox stack. Its mission is to decentralize ownership of commercial data and return technological control to merchants and their customers. Data is written locally first, then synchronised through FogBox nodes—no central server—ensuring autonomy and resilience. Open, well-documented APIs let any citizen-developer extend, fork, or integrate the codebase without gatekeepers. App is a browser-only React SPA that lets local businesses create, edit, and audit their own merchant records on Local—a community-commerce network running on the peer-to-peer FogBox stack. Its mission is to decentralize ownership of commercial data and return technological control to merchants and their customers. Data is written locally first, then synchronised through FogBox nodes—no central server—ensuring autonomy and resilience. Open, well-documented APIs let any citizen-developer extend, fork, or integrate the codebase without gatekeepers.
## Architecture ## Architecture

View File

@ -6,7 +6,7 @@ services:
environment: environment:
- CLIENT_BASE_PATH=${CLIENT_BASE_PATH:-/} - CLIENT_BASE_PATH=${CLIENT_BASE_PATH:-/}
- CLIENT_API_URL=${CLIENT_API_URL:-} - CLIENT_API_URL=${CLIENT_API_URL:-}
- CLIENT_APP_NAME=${CLIENT_APP_NAME:-Merchant Operator App} - CLIENT_APP_NAME=${CLIENT_APP_NAME:-App}
- CLIENT_DEBUG=${CLIENT_DEBUG:-false} - CLIENT_DEBUG=${CLIENT_DEBUG:-false}
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"

View File

@ -65,7 +65,7 @@ if [ -d "$TARGET_DIR" ]; then
# #
[ -f "$TEMP_DIR/apiUrl" ] || echo "https://localhost:7205" >"$TEMP_DIR/apiUrl" [ -f "$TEMP_DIR/apiUrl" ] || echo "https://localhost:7205" >"$TEMP_DIR/apiUrl"
[ -f "$TEMP_DIR/basePath" ] || echo "/" >"$TEMP_DIR/basePath" [ -f "$TEMP_DIR/basePath" ] || echo "/" >"$TEMP_DIR/basePath"
[ -f "$TEMP_DIR/appName" ] || echo "Merchant Operator App" >"$TEMP_DIR/appName" [ -f "$TEMP_DIR/appName" ] || echo "App" >"$TEMP_DIR/appName"
[ -f "$TEMP_DIR/debug" ] || echo "false" >"$TEMP_DIR/debug" [ -f "$TEMP_DIR/debug" ] || echo "false" >"$TEMP_DIR/debug"
echo "Generating app-config.js..." echo "Generating app-config.js..."

View File

@ -1,8 +1,8 @@
# Merchant Operator App Documentation # App Documentation
## Project Overview ## Project Overview
Merchant Operator App is a browser-only React SPA for local businesses to manage their merchant records on a decentralized commerce network. It uses a peer-to-peer architecture with local-first data storage and synchronization through FogBox nodes. App is a browser-only React SPA for local businesses to manage their merchant records on a decentralized commerce network. It uses a peer-to-peer architecture with local-first data storage and synchronization through FogBox nodes.
## Agent Guidelines ## Agent Guidelines

View File

@ -1,6 +1,6 @@
# Authentication Documentation # Authentication Documentation
This document explains the authentication setup for the Merchant Operator App. This document explains the authentication setup for the App.
## OIDC Authentication ## OIDC Authentication

View File

@ -10,7 +10,7 @@ The application uses the following client-side environment variables, all prefix
|---------------------|--------------------------------------------|-------------------------| |---------------------|--------------------------------------------|-------------------------|
| `CLIENT_API_URL` | Base URL for backend API requests | `https://localhost:7205`| | `CLIENT_API_URL` | Base URL for backend API requests | `https://localhost:7205`|
| `CLIENT_BASE_PATH` | Base path for client-side routing | `/` | | `CLIENT_BASE_PATH` | Base path for client-side routing | `/` |
| `CLIENT_APP_NAME` | Application name displayed in UI | `Merchant Operator App` | | `CLIENT_APP_NAME` | Application name displayed in UI | `App` |
| `CLIENT_DEBUG` | Enable debug mode | `false` | | `CLIENT_DEBUG` | Enable debug mode | `false` |
## How to Set Variables ## How to Set Variables
@ -26,7 +26,7 @@ Example `.env.development`:
``` ```
CLIENT_BASE_PATH=/ CLIENT_BASE_PATH=/
CLIENT_API_URL=https://localhost:7205 CLIENT_API_URL=https://localhost:7205
CLIENT_APP_NAME=Merchant Operator App CLIENT_APP_NAME=App
CLIENT_DEBUG=true CLIENT_DEBUG=true
``` ```
@ -44,7 +44,7 @@ services:
environment: environment:
- CLIENT_API_URL=https://api.example.com - CLIENT_API_URL=https://api.example.com
- CLIENT_BASE_PATH=/merchant-app - CLIENT_BASE_PATH=/merchant-app
- CLIENT_APP_NAME=Merchant Operator App - CLIENT_APP_NAME=App
- CLIENT_DEBUG=false - CLIENT_DEBUG=false
``` ```
@ -58,7 +58,7 @@ services:
environment: environment:
- CLIENT_API_URL=https://api.example.com - CLIENT_API_URL=https://api.example.com
- CLIENT_BASE_PATH=/merchant-app - CLIENT_BASE_PATH=/merchant-app
- CLIENT_APP_NAME=Merchant Operator App - CLIENT_APP_NAME=App
- CLIENT_DEBUG=false - CLIENT_DEBUG=false
``` ```
@ -70,7 +70,7 @@ Create a `.env` file in the same directory as your `docker-compose.yml`:
# .env # .env
CLIENT_API_URL=https://api.example.com CLIENT_API_URL=https://api.example.com
CLIENT_BASE_PATH=/merchant-app CLIENT_BASE_PATH=/merchant-app
CLIENT_APP_NAME=Merchant Operator App CLIENT_APP_NAME=App
CLIENT_DEBUG=false CLIENT_DEBUG=false
# ... other variables # ... other variables
``` ```
@ -78,7 +78,7 @@ CLIENT_DEBUG=false
#### Using Docker run command #### Using Docker run command
```bash ```bash
docker run -e CLIENT_BASE_PATH=/merchant-app -e CLIENT_API_URL=https://api.example.com -e CLIENT_APP_NAME="Merchant Operator App" -e CLIENT_DEBUG=false your-image-name docker run -e CLIENT_BASE_PATH=/merchant-app -e CLIENT_API_URL=https://api.example.com -e CLIENT_APP_NAME="App" -e CLIENT_DEBUG=false your-image-name
``` ```
## How Runtime Environment Variables Work ## How Runtime Environment Variables Work

View File

@ -1,6 +1,6 @@
# Merchant Operator App Configuration # App Configuration
This document describes the configuration options and mechanisms used in the Merchant Operator App. This document describes the configuration options and mechanisms used in the App.
## Environment Variables ## Environment Variables
@ -30,7 +30,7 @@ In production (Docker), environment variables are loaded from the container envi
|----------------------|-------------|---------------| |----------------------|-------------|---------------|
| `CLIENT_API_URL` | URL of the API server | Required, or can be set to "DETECT" for auto-detection | | `CLIENT_API_URL` | URL of the API server | Required, or can be set to "DETECT" for auto-detection |
| `CLIENT_BASE_PATH` | Base path of the application | "/" | | `CLIENT_BASE_PATH` | Base path of the application | "/" |
| `CLIENT_APP_NAME` | Name of the application | "Merchant Operator App" | | `CLIENT_APP_NAME` | Name of the application | "App" |
| `CLIENT_DEBUG` | Enable debug mode | "false" | | `CLIENT_DEBUG` | Enable debug mode | "false" |
| `CLIENT_MAP_TILE_ENDPOINT` | Endpoint for map tiles | "" | | `CLIENT_MAP_TILE_ENDPOINT` | Endpoint for map tiles | "" |
| `CLIENT_MAP_TILE_API_KEY` | API key for map tiles | "" | | `CLIENT_MAP_TILE_API_KEY` | API key for map tiles | "" |

View File

@ -25,7 +25,7 @@ cp .env.template .env
|---------------------|--------------------------------------------|-------------------------| |---------------------|--------------------------------------------|-------------------------|
| CLIENT_BASE_PATH | Base path where the app will be served | `/` | | CLIENT_BASE_PATH | Base path where the app will be served | `/` |
| CLIENT_API_URL | Base URL for backend API | `https://localhost:7205`| | CLIENT_API_URL | Base URL for backend API | `https://localhost:7205`|
| CLIENT_APP_NAME | Application name displayed in UI | `Merchant Operator App` | | CLIENT_APP_NAME | Application name displayed in UI | `App` |
| CLIENT_DEBUG | Enable debug mode | `false` | | CLIENT_DEBUG | Enable debug mode | `false` |
| ENABLE_TLS | Whether to enable TLS | `false` | | ENABLE_TLS | Whether to enable TLS | `false` |
| TRAEFIK_ENTRYPOINT | Traefik entrypoint to use | `web` | | TRAEFIK_ENTRYPOINT | Traefik entrypoint to use | `web` |
@ -60,7 +60,7 @@ services:
environment: environment:
- CLIENT_BASE_PATH=/app - CLIENT_BASE_PATH=/app
- CLIENT_API_URL=https://api.example.com - CLIENT_API_URL=https://api.example.com
- CLIENT_APP_NAME=Merchant Operator App - CLIENT_APP_NAME=App
- CLIENT_DEBUG=false - CLIENT_DEBUG=false
- CLIENT_OIDC_AUTHORITY=https://auth.example.com - CLIENT_OIDC_AUTHORITY=https://auth.example.com
- CLIENT_OIDC_CLIENT_ID=your-client-id - CLIENT_OIDC_CLIENT_ID=your-client-id

View File

@ -13,7 +13,7 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Merchant Operator App</title> <title>App</title>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>

View File

@ -16,7 +16,7 @@ I am an expert software engineer with a unique characteristic: my memory resets
- **Exports**: Use named exports only, avoid default exports - **Exports**: Use named exports only, avoid default exports
### Project Summary ### Project Summary
- **Name**: Merchant Operator Web Application - **Name**: Web Application
- **Type**: Client-side only React application for Merchant management - **Type**: Client-side only React application for Merchant management
- **Core Features**: Menu management, order tracking, Merchant operations - **Core Features**: Menu management, order tracking, Merchant operations
- **Tech Stack**: React, TypeScript, Tailwind CSS, Effector, Vite - **Tech Stack**: React, TypeScript, Tailwind CSS, Effector, Vite

View File

@ -1,9 +1,9 @@
# Project Brief: Merchant Operator Web Application # Project Brief: Web Application
## Project Overview ## Project Overview
A client-side React application for Merchant owners to manage menus, track orders, and handle operations. A client-side React application for Merchant owners to manage menus, track orders, and handle operations.
Merchant Operator App is a browser-only React SPA that lets local businesses create, edit, and audit their own merchant records on Local—a community-commerce network running on the peer-to-peer FogBox stack. Its mission is to decentralize ownership of commercial data and return technological control to merchants and their customers. Data is written locally first, then synchronised through FogBox nodes—no central server—ensuring autonomy and resilience. Open, well-documented APIs let any citizen-developer extend, fork, or integrate the codebase without gatekeepers. App is a browser-only React SPA that lets local businesses create, edit, and audit their own merchant records on Local—a community-commerce network running on the peer-to-peer FogBox stack. Its mission is to decentralize ownership of commercial data and return technological control to merchants and their customers. Data is written locally first, then synchronised through FogBox nodes—no central server—ensuring autonomy and resilience. Open, well-documented APIs let any citizen-developer extend, fork, or integrate the codebase without gatekeepers.
## Core Features ## Core Features

View File

@ -1,4 +1,4 @@
# System Patterns: Merchant Operator Web Application # System Patterns: Web Application
## Architecture Overview ## Architecture Overview
The application follows a domain-driven, Effector-based Flux architecture. The application follows a domain-driven, Effector-based Flux architecture.

View File

@ -1,4 +1,4 @@
# Technical Context: Merchant Operator Web Application # Technical Context: Web Application
## Technology Stack ## Technology Stack

View File

@ -1,7 +1,7 @@
// Runtime environment variables - Generated by generate-app-config.js // Runtime environment variables - Generated by generate-app-config.js
window.appConfig = { window.appConfig = {
apiUrl: "https://localhost:7205", apiUrl: "https://localhost:7205",
appName: "Merchant Operator App", appName: "App",
basePath: "/", basePath: "/",
debug: true, debug: true,
mapTileApiKey: "pk.19d62daa998822ac22861d96a0424b58", mapTileApiKey: "pk.19d62daa998822ac22861d96a0424b58",

View File

@ -94,7 +94,7 @@ if (!process.env.CLIENT_BASE_PATH) {
configContent += ' basePath: "/",\n'; configContent += ' basePath: "/",\n';
} }
if (!process.env.CLIENT_APP_NAME) { if (!process.env.CLIENT_APP_NAME) {
configContent += ' appName: "Merchant Operator App",\n'; configContent += ' appName: "App",\n';
} }
if (!process.env.CLIENT_DEBUG) { if (!process.env.CLIENT_DEBUG) {
configContent += " debug: " + (isProduction ? "false" : "true") + ",\n"; configContent += " debug: " + (isProduction ? "false" : "true") + ",\n";

View File

@ -99,7 +99,7 @@ export const AuthCallback: React.FC = () => {
<div className="flex items-center justify-center min-h-screen bg-[#131215]"> <div className="flex items-center justify-center min-h-screen bg-[#131215]">
<div className="w-full max-w-md p-8 space-y-8 bg-[#26242a] rounded-lg shadow-lg"> <div className="w-full max-w-md p-8 space-y-8 bg-[#26242a] rounded-lg shadow-lg">
<div className="text-center"> <div className="text-center">
<h1 className="text-2xl font-bold text-white">Merchant Operator</h1> <h1 className="text-2xl font-bold text-white">App</h1>
{status === "processing" && ( {status === "processing" && (
<div className="mt-6"> <div className="mt-6">

View File

@ -92,7 +92,7 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {
<div className="flex items-center justify-center min-h-screen bg-[#131215]"> <div className="flex items-center justify-center min-h-screen bg-[#131215]">
<div className="w-full max-w-md p-8 space-y-8 bg-[#26242a] rounded-lg shadow-lg"> <div className="w-full max-w-md p-8 space-y-8 bg-[#26242a] rounded-lg shadow-lg">
<div className="text-center"> <div className="text-center">
<h1 className="text-2xl font-bold text-white">Merchant Operator</h1> <h1 className="text-2xl font-bold text-white">App</h1>
<div className="mt-6"> <div className="mt-6">
<div className="flex flex-col items-center justify-center"> <div className="flex flex-col items-center justify-center">

View File

@ -76,7 +76,7 @@ export const LoginPage: React.FC = () => {
<div className="flex items-center justify-center min-h-screen bg-[#131215]"> <div className="flex items-center justify-center min-h-screen bg-[#131215]">
<div className="w-full max-w-md p-8 space-y-8 bg-[#26242a] rounded-lg shadow-lg"> <div className="w-full max-w-md p-8 space-y-8 bg-[#26242a] rounded-lg shadow-lg">
<div className="text-center"> <div className="text-center">
<h1 className="text-2xl font-bold text-white">Merchant Operator</h1> <h1 className="text-2xl font-bold text-white">App</h1>
<p className="mt-2 text-gray-400"> <p className="mt-2 text-gray-400">
Sign in with your identity provider Sign in with your identity provider
</p> </p>

View File

@ -17,7 +17,7 @@ export const Dashboard: React.FC = () => {
<CardContent> <CardContent>
<p>Hello, {user?.name || "Merchant"}!</p> <p>Hello, {user?.name || "Merchant"}!</p>
<p className="mt-2 text-gray-400"> <p className="mt-2 text-gray-400">
Welcome to the Merchant Operator App. Use the sidebar to navigate Welcome to the App. Use the sidebar to navigate
to different sections. to different sections.
</p> </p>
</CardContent> </CardContent>

View File

@ -16,7 +16,7 @@ const LoginPage = () => {
return ( return (
<div className="flex flex-col items-center justify-center min-h-screen bg-[#131215]"> <div className="flex flex-col items-center justify-center min-h-screen bg-[#131215]">
<div className="text-center text-white mb-8"> <div className="text-center text-white mb-8">
<h1 className="text-3xl font-bold mb-4">Merchant Operator App</h1> <h1 className="text-3xl font-bold mb-4">App</h1>
<p className="text-[#adaab7] mb-8"> <p className="text-[#adaab7] mb-8">
Please log in to access the application Please log in to access the application
</p> </p>

View File

@ -14,7 +14,7 @@ export const Header: React.FC = () => {
return ( return (
<header className="bg-[#26242a] border-b border-[#3a3842] p-4 flex justify-between items-center"> <header className="bg-[#26242a] border-b border-[#3a3842] p-4 flex justify-between items-center">
<div className="text-xl font-bold">Merchant Operator</div> <div className="text-xl font-bold">App</div>
<div className="flex items-center space-x-4"> <div className="flex items-center space-x-4">
{user && ( {user && (

View File

@ -55,7 +55,7 @@ export const Sidebar: React.FC = () => {
</nav> </nav>
<div className="p-4 border-t border-[#3a3842] text-xs text-gray-500"> <div className="p-4 border-t border-[#3a3842] text-xs text-gray-500">
<p>© 2023 Merchant Operator</p> <p>© 2023 App</p>
</div> </div>
</aside> </aside>
); );