From 3cb6229cd9f2b2468a32f7e5e657cdc5edc9a14e Mon Sep 17 00:00:00 2001 From: Atharv1705 Date: Wed, 28 Oct 2026 21:45:16 +0530 Subject: [PATCH] feat: complete platform overhaul, bugfixes, and verified production release --- .gitattributes | 2 + DEPLOYMENT.md | 370 +++++++++++------- clean_base.py | 14 + fix_import.py | 17 + fix_statuschip.py | 20 + frontend/index.html | 9 +- frontend/package-lock.json | 106 +---- frontend/package.json | 5 +- frontend/patch_footer.py | 76 ++++ frontend/patch_footer_dark.py | 78 ++++ frontend/patch_footer_target.py | 49 +++ frontend/patch_phase4_safe.py | 320 +++++++++++++++ frontend/public/css/base.css | 14 +- frontend/public/css/components.css | 19 +- frontend/public/css/dynamic.css | 171 ++++++++ frontend/public/llms.txt | 8 +- frontend/public/robots.txt | 2 +- frontend/public/sitemap.xml | 12 +- frontend/src/components/AdminChatbot.jsx | 38 +- frontend/src/components/CountUp.jsx | 43 ++ .../src/components/ExpandableSummaryBlock.jsx | 45 +-- frontend/src/components/ExpandableValue.jsx | 4 +- frontend/src/components/Footer.jsx | 3 +- frontend/src/components/StatusChip.jsx | 23 ++ frontend/src/index.css | 73 +++- frontend/src/layouts/DashboardLayout.jsx | 5 +- frontend/src/layouts/MarketingLayout.jsx | 5 +- frontend/src/layouts/PublicLayout.jsx | 4 +- frontend/src/main.jsx | 2 + frontend/src/pages/AdminDashboard.jsx | 10 +- frontend/src/pages/AdminUserDetail.jsx | 87 ++-- frontend/src/pages/Contact.jsx | 6 +- frontend/src/pages/Home.jsx | 9 +- frontend/src/pages/Profile.jsx | 4 +- frontend/src/pages/UploadBusiness.jsx | 12 +- frontend/src/pages/UploadPersonal.jsx | 12 +- frontend/src/pages/UserDashboard.jsx | 117 ++++-- frontend/src/utils/motion.js | 46 +++ frontend/vite.config.js | 3 +- nginx/default.conf | 2 +- patch_admin.py | 13 + patch_email.py | 21 + patch_user.py | 23 ++ remove_excel.py | 37 ++ remove_handleexport.py | 33 ++ reset_pass.py | 23 ++ services/api/app/auth/security.py | 20 +- services/api/app/main.py | 2 + services/api/app/routers/chatbot.py | 24 ++ services/api/app/routers/contact.py | 19 +- services/api/app/routers/review.py | 71 +++- services/api/app/routers/upload.py | 35 +- services/api/app/utils/doc_classifier.py | 20 +- services/api/app/utils/emailer.py | 2 + services/api/app/utils/login_email.py | 2 +- services/api/app/utils/scheduler.py | 89 +++-- services/api/check_emails.py | 8 + services/api/requirements.txt | 4 +- services/api/reset_pass.py | 17 + services/api/reset_pass2.py | 17 + services/api/reset_pass3.py | 22 ++ services/api/validate_env.py | 21 +- 62 files changed, 1820 insertions(+), 548 deletions(-) create mode 100644 .gitattributes create mode 100644 clean_base.py create mode 100644 fix_import.py create mode 100644 fix_statuschip.py create mode 100644 frontend/patch_footer.py create mode 100644 frontend/patch_footer_dark.py create mode 100644 frontend/patch_footer_target.py create mode 100644 frontend/patch_phase4_safe.py create mode 100644 frontend/public/css/dynamic.css create mode 100644 frontend/src/components/CountUp.jsx create mode 100644 frontend/src/components/StatusChip.jsx create mode 100644 frontend/src/utils/motion.js create mode 100644 patch_admin.py create mode 100644 patch_email.py create mode 100644 patch_user.py create mode 100644 remove_excel.py create mode 100644 remove_handleexport.py create mode 100644 reset_pass.py create mode 100644 services/api/check_emails.py create mode 100644 services/api/reset_pass.py create mode 100644 services/api/reset_pass2.py create mode 100644 services/api/reset_pass3.py diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..efdba87 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +* text=auto +*.sh text eol=lf diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 0200366..3ccb9c6 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -1,179 +1,285 @@ -# Contabo VPS Deployment Guide +# BookKeepPro β€” Comprehensive Production Deployment Guide -## Prerequisites - -- Docker + Docker Compose installed on the VPS -- Port 80 open in Contabo firewall and VPS firewall (`ufw allow 80`) -- Node.js 18+ installed locally (for the frontend build) +**Target Domain:** [`https://aicpa.duckdns.org`](https://aicpa.duckdns.org) +**Target VPS Server:** `Contabo VPS (13.140.170.213)` +**Stack:** React 19 (Vite) + FastAPI (Python 3.12) + MySQL 8.4 + Docker Compose + Host Nginx (Certbot SSL) --- -## First-time deployment +## 1. System Architecture -### 1. Clone the repo - -```bash -git clone https://github.com/Atharv1705/Bookkeepro.git -cd Bookkeepro +```mermaid +graph TD + Client(["🌐 Web Client (HTTPS)"]) -->|"Port 443 / 80"| HostNginx["Host Nginx Reverse Proxy
(13.140.170.213)
Let's Encrypt SSL Certbot"] + + subgraph DockerCompose ["Docker Compose Stack (Internal Network)"] + HostNginx -->|"Proxy Pass: 127.0.0.1:8081"| ContainerNginx["Nginx Container (Port 80)
- Serves /frontend/dist static files
- Asset cache headers
- Proxy routes"] + + ContainerNginx -->|"/api/* requests"| FastAPI["FastAPI Container (Port 8000)
- Auth & JWT
- Document Processing & OCR
- AI Chatbot & Daily Digest
- APScheduler Reminders"] + + FastAPI -->|"SQLAlchemy connection (Port 3306)"| MySQL["MySQL 8.4 Container
- Persistent volume: mysql_data
- Health check verified"] + + FastAPI -->|"Uploads Volume"| Storage["Persistent Disk Volume
- /app/uploads
- ChromaDB Vector Store"] + end ``` -### 2. Create `.env` from the example +--- -```bash -cp .env.example .env -# Edit .env β€” fill in MYSQL_PASSWORD, SECRET_KEY, SMTP_PASSWORD, OPENROUTER_API_KEY -nano .env -``` +## 2. Pre-Deployment: Local Workstation Preparation -**Required variables in `.env`:** -``` -MYSQL_HOST=db -MYSQL_USER=root -MYSQL_PASSWORD= -MYSQL_DATABASE=bookkeepprodb -SECRET_KEY=<64-char-random-hex> -ALLOWED_ORIGINS=http://,https://bookkeepro.net -OPENROUTER_API_KEY= -SMTP_HOST=smtp.gmail.com -SMTP_PORT=587 -SMTP_USER= -SMTP_PASSWORD= -MAIL_FROM= -ADMIN_EMAIL= -``` +Perform these steps inside your local project folder (`Bookkeep`): -### 3. Build the frontend +### Step 2.1 β€” Fresh Frontend Production Build +Compile and bundle all JSX components, CSS tokens, and assets into production-ready static files: -⚠️ **This step is required.** nginx serves `frontend/dist` directly from the host. -If this folder is missing or stale, the UI will not load. - -```bash -# On VPS or locally (then scp the dist/ folder to VPS) +```powershell cd frontend -npm install npm run build cd .. ``` - -### 4. Start all services - -```bash -docker compose up -d --build +*Expected Output:* +```text +dist/index.html 1.05 kB +dist/assets/index-Q3NiwG1z.css 44.73 kB +dist/assets/index-DYQgi1rI.js 418.74 kB +βœ“ built in 1.5s ``` -This starts: `nginx` (port 80), `app` (FastAPI, internal), `db` (MySQL, internal). - -### 5. Run database migrations - -On first deploy, run the SQL migrations to create all required columns and tables: - -```bash -# Add extracted_data JSON columns (idempotent β€” safe to re-run) -docker exec $(docker compose ps -q app) python migrate.py - -# Apply schema changes for engagement acknowledgement + unique indexes -docker exec $(docker compose ps -q app) python -c " -import subprocess, os -os.chdir('/app/services/api') -subprocess.run(['python', '-c', ''' -from app.db import engine -from sqlalchemy import text -sqls = open('/app/services/api/migrations/v003_p3_p4_changes.sql').read() -with engine.begin() as c: - for stmt in sqls.split(';'): - s = stmt.strip() - if s: - try: c.execute(text(s)) - except Exception as e: print(f\"Skipped: {e}\") -print(\"v003 done\") -''']) -" - -# Create required_document_templates table + seed data -docker exec $(docker compose ps -q app) python -c " -from app.db import engine -from sqlalchemy import text -sqls = open('/app/services/api/migrations/v004_required_document_templates.sql').read() -with engine.begin() as c: - for stmt in sqls.split(';'): - s = stmt.strip() - if s: - try: c.execute(text(s)) - except Exception as e: print(f'Skipped: {e}') -print('v004 done') -" 2>/dev/null || true +### Step 2.2 β€” Validate Environment Schema +Ensure no placeholder passwords or missing keys exist: +```powershell +python services/api/validate_env.py ``` +*Expected Output:* `Environment validation passed.` -### 6. Create the first super admin - -```bash -docker exec -it $(docker compose ps -q app) python create_super_admin.py -``` - -### 7. Verify everything is running - -```bash -docker compose ps # all 3 containers should be Up -curl http://localhost/health # should return {"status":"ok"} -docker compose logs app | tail -20 # check for "Application startup complete" -docker compose logs app | grep "Failed to load" # should be empty +### Step 2.3 β€” Commit and Push to Git +Commit all validated changes, tests, and updated build files: +```powershell +git add . +git commit -m "feat: complete platform overhaul, bugfixes, and verified production release" +git push origin main ``` --- -## Updating to a new version +## 3. VPS Initial Setup & Prerequisites (One-Time) +Log in to your Contabo VPS via SSH: ```bash -git pull +ssh root@13.140.170.213 +``` -# Rebuild frontend if any frontend files changed -cd frontend && npm install && npm run build && cd .. +### Step 3.1 β€” Install System Packages & Docker +If not already installed on the VPS: +```bash +sudo apt-get update && sudo apt-get upgrade -y +sudo apt-get install -y curl git ufw nginx certbot python3-certbot-nginx -# Rebuild and restart (DB volume is preserved β€” no data loss) -docker compose up -d --build app nginx +# Install Docker & Compose plugin +curl -fsSL https://get.docker.com -o get-docker.sh +sh get-docker.sh +sudo systemctl enable --now docker +``` -# Run migrations if schema changed -docker exec $(docker compose ps -q app) python migrate.py - -# Re-run AI extraction backfill if needed -docker exec $(docker compose ps -q app) python backfill_extraction.py +### Step 3.2 β€” Configure Firewall (UFW) +Ensure HTTP, HTTPS, and SSH ports are open: +```bash +sudo ufw allow 22/tcp +sudo ufw allow 80/tcp +sudo ufw allow 443/tcp +sudo ufw --force enable +sudo ufw status ``` --- -## HTTPS (required for production with real client data) +## 4. VPS Host Nginx & Let's Encrypt SSL Configuration + +The Host Nginx handles public incoming connections on ports 80/443, terminates SSL, and forwards traffic to the Docker Nginx container running on `127.0.0.1:8081`. + +### Step 4.1 β€” Create Host Nginx Configuration +Create or edit `/etc/nginx/sites-available/aicpa.duckdns.org`: ```bash -# Install certbot -apt install certbot python3-certbot-nginx +sudo nano /etc/nginx/sites-available/aicpa.duckdns.org +``` -# Get certificate (replace with your domain) -certbot --nginx -d bookkeepro.net -d www.bookkeepro.net +Paste the following configuration: -# Update ALLOWED_ORIGINS in .env to use https:// -# Update FRONTEND_URL in .env to use https:// -docker compose restart app +```nginx +server { + listen 80; + server_name aicpa.duckdns.org 13.140.170.213; + + client_max_body_size 25M; + + location / { + proxy_pass http://127.0.0.1:8081; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 120s; + proxy_send_timeout 120s; + } +} +``` + +### Step 4.2 β€” Enable Site and Test Syntax +```bash +sudo ln -sf /etc/nginx/sites-available/aicpa.duckdns.org /etc/nginx/sites-enabled/ +sudo rm -f /etc/nginx/sites-enabled/default +sudo nginx -t +sudo systemctl reload nginx +``` + +### Step 4.3 β€” Obtain Free Let's Encrypt SSL Certificate +Run Certbot to automatically configure HTTPS: +```bash +sudo certbot --nginx -d aicpa.duckdns.org +``` +When prompted: +1. Enter your contact email. +2. Agree to terms (`Y`). +3. Certbot will test the challenge, install SSL certificates, and configure HTTPS automatic redirection. + +Verify auto-renewal: +```bash +sudo certbot renew --dry-run ``` --- -## Backup database +## 5. Application Deployment via Docker Compose +### Step 5.1 β€” Pull the Code on VPS ```bash -# Run before any major upgrade -docker exec $(docker compose ps -q db) \ - mysqldump -uroot -p"${MYSQL_PASSWORD}" bookkeepprodb \ - > backup_$(date +%Y%m%d_%H%M%S).sql +cd /var/www/Bookkeep # or your deployment directory on the VPS +git pull origin main ``` +### Step 5.2 β€” Verify the Production `.env` File +Ensure `/var/www/Bookkeep/.env` exists and matches the production settings: + +```ini +# DATABASE +MYSQL_HOST=db +MYSQL_PORT=3306 +MYSQL_USER=root +MYSQL_PASSWORD=your_secure_db_password +MYSQL_DATABASE=bookkeepprodb + +# SECURITY +SECRET_KEY=your_generated_secret_key_here +JWT_ALGORITHM=HS256 +ACCESS_TOKEN_EXPIRE_MINUTES=480 + +# SERVER SETTINGS +FRONTEND_URL=https://aicpa.duckdns.org +ALLOWED_ORIGINS=https://aicpa.duckdns.org + +# EMAIL (Gmail SMTP) +ADMIN_EMAIL=atharvg.aiindia@gmail.com +MAIL_FROM=atharvagunjarge5@gmail.com +MAIL_FROM_NAME=AiIndia_CPA +SMTP_HOST=smtp.gmail.com +SMTP_PORT=587 +SMTP_USER=atharvagunjarge5@gmail.com +SMTP_PASSWORD=your_smtp_app_password_here +SMTP_TLS=True +MAIL_SSL_TLS=False + +# OPENROUTER (Chatbot + OCR Models) +OPENROUTER_API_KEY="your_openrouter_api_key_here" +OCR_TEXT_MODEL=meta-llama/llama-3.3-70b-instruct +OCR_VISION_MODEL=qwen/qwen2.5-vl-72b-instruct +OCR_FALLBACK_MODEL=google/gemma-3-27b-it +TESSERACT_LANG=eng+hin +CHAT_MODEL=meta-llama/llama-3.3-70b-instruct +``` + +> [!IMPORTANT] +> Within the Docker Compose network, `MYSQL_HOST` must be set to `db` so FastAPI connects to the MySQL container. + +### Step 5.3 β€” Build & Launch Containers +```bash +# Clean previous containers +docker compose down + +# Build backend and launch all 3 services in detached mode +docker compose build --no-cache app +docker compose up -d +``` + +### Step 5.4 β€” Verify Container Health +Run: +```bash +docker compose ps +``` +All services must show healthy and running: +```text +NAME IMAGE STATUS PORTS +bookkeep-app-1 bookkeep-app Up (healthy) 8000/tcp +bookkeep-db-1 mysql:8.4 Up (healthy) 3306/tcp, 33060/tcp +bookkeep-nginx-1 nginx:1.25-alpine Up 127.0.0.1:8081->80/tcp +``` + +Check the migration output in the backend logs: +```bash +docker compose logs app | tail -n 35 +``` +You should see: +- `[entrypoint] Running DB migrations...` +- `All migrations complete.` +- `Environment validation passed.` +- `Application startup complete.` +- `Uvicorn running on http://0.0.0.0:8000` + --- -## Troubleshooting +## 6. Post-Deployment Smoke Tests -| Symptom | Check | -|---|---| -| UI loads blank / 404 | Run `npm run build` in `frontend/` β€” dist is missing | -| API returns 500 | `docker compose logs app` β€” look for startup errors | -| Chatbot/upload 500 | `docker compose logs app \| grep "Failed to load"` β€” router failed to load | -| Login fails | Check `MYSQL_HOST=db` in `.env` (not `localhost`) | -| Emails not sending | Verify Gmail App Password in `.env`, check SMTP_PASSWORD has no spaces | +Execute these verification checks from your browser and terminal: + +| Test # | Check Item | Test Action | Expected Result | +| :---: | :--- | :--- | :--- | +| **1** | **SSL / HTTPS** | Navigate to `https://aicpa.duckdns.org` | Valid green padlock; redirects HTTP to HTTPS automatically | +| **2** | **Health Endpoint** | `curl -i https://aicpa.duckdns.org/health` | `HTTP/1.1 200 OK` with body `{"status":"ok"}` | +| **3** | **API 404 Guard** | `curl -i https://aicpa.duckdns.org/api/invalid-test` | `404 Not Found` in JSON format (not HTML) | +| **4** | **Client Sign In** | Log in with a client account | Successfully loads User Dashboard with Engagement Letter card | +| **5** | **Deadlines Banner** | Check User Dashboard | If deadlines are within 7 days, warning alert displays | +| **6** | **Document Upload** | Upload sample W-2 or 1099 in Personal Upload | Upload completes, OCR extraction kicks off, document appears in table | +| **7** | **Admin Dashboard** | Log in as Admin (`atharvg.aiindia@gmail.com`) | Shows 14 users, pending count, Daily Digest HTML block | +| **8** | **Approved Return Lock** | Try deleting an approved return in Admin User Detail | Delete button is locked / backend responds with 400 | +| **9** | **Client Review** | Admin sends return for approval; Client reviews | Client sees Approve and Reject buttons; status updates in real-time | +| **10** | **Admin Chatbot** | Open floating chatbot on Admin Dashboard | AI replies with firm statistics and handles bulk action requests | + +--- + +## 7. Operational Maintenance Commands + +### Fast Code Update (Subsequent Releases) +```bash +cd /var/www/Bookkeep +git pull origin main +cd frontend && npm run build && cd .. +docker compose restart nginx +docker compose up -d --build app +``` + +### Live Log Streaming +```bash +# View backend application logs +docker compose logs -f --tail=50 app + +# View web server access & error logs +docker compose logs -f --tail=50 nginx +``` + +### Database Backup +```bash +docker exec $(docker compose ps -q db) mysqldump -uroot -p"$MYSQL_PASSWORD" bookkeepprodb > backup_$(date +%F_%T).sql +``` diff --git a/clean_base.py b/clean_base.py new file mode 100644 index 0000000..bc03a3d --- /dev/null +++ b/clean_base.py @@ -0,0 +1,14 @@ +ο»Ώimport re + +filepath = 'frontend/public/css/base.css' +with open(filepath, 'r', encoding='utf-8') as f: + content = f.read() + +split_str = "/* ============================================================\n MOTION SYSTEM (Phase 3)\n ============================================================ */" +if split_str in content: + content = content.split(split_str)[0].strip() + "\n" + with open(filepath, 'w', encoding='utf-8') as f: + f.write(content) + print("base.css cleaned.") +else: + print("MOTION SYSTEM block not found in base.css.") diff --git a/fix_import.py b/fix_import.py new file mode 100644 index 0000000..7ce1cb5 --- /dev/null +++ b/fix_import.py @@ -0,0 +1,17 @@ +ο»Ώfilepath = 'frontend/src/pages/AdminUserDetail.jsx' +with open(filepath, 'r', encoding='utf-8') as f: + content = f.read() + +import_statement = "import StatusChip from '../components/StatusChip';\n" +if "import StatusChip" not in content: + # Insert after the last import + last_import_idx = content.rfind("import ") + if last_import_idx != -1: + end_of_line = content.find("\n", last_import_idx) + content = content[:end_of_line+1] + import_statement + content[end_of_line+1:] + else: + content = import_statement + content + +with open(filepath, 'w', encoding='utf-8') as f: + f.write(content) +print("Added StatusChip import.") diff --git a/fix_statuschip.py b/fix_statuschip.py new file mode 100644 index 0000000..3ee3fc9 --- /dev/null +++ b/fix_statuschip.py @@ -0,0 +1,20 @@ +ο»Ώfilepath = 'frontend/src/components/StatusChip.jsx' +with open(filepath, 'r', encoding='utf-8') as f: + content = f.read() + +content = content.replace( + '
', + '
' +) +content = content.replace( + 'shadow-sm border border-black/5', + '' +) +content = content.replace( + '
', + '
' +) + +with open(filepath, 'w', encoding='utf-8') as f: + f.write(content) +print("StatusChip fixed") diff --git a/frontend/index.html b/frontend/index.html index ef6d032..9045e75 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,13 +4,14 @@ - - BookKeepPro β€” Bookkeeping, Payroll & Tax Services + + BookKeepPro — Bookkeeping, Payroll & Tax Services - - + + +
diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 3a5b0a8..58177fa 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -13,8 +13,7 @@ "lucide-react": "^1.24.0", "react": "^19.2.7", "react-dom": "^19.2.7", - "react-router-dom": "^7.18.1", - "xlsx": "^0.18.5" + "react-router-dom": "^7.18.1" }, "devDependencies": { "@tailwindcss/postcss": "^4.3.2", @@ -2012,15 +2011,6 @@ } } }, - "node_modules/adler-32": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz", - "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==", - "license": "Apache-2.0", - "engines": { - "node": ">=0.8" - } - }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -2169,28 +2159,6 @@ ], "license": "CC-BY-4.0" }, - "node_modules/cfb": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz", - "integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==", - "license": "Apache-2.0", - "dependencies": { - "adler-32": "~1.3.0", - "crc-32": "~1.2.0" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/codepage": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz", - "integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==", - "license": "Apache-2.0", - "engines": { - "node": ">=0.8" - } - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -2216,18 +2184,6 @@ "url": "https://opencollective.com/express" } }, - "node_modules/crc-32": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", - "license": "Apache-2.0", - "bin": { - "crc32": "bin/crc32.njs" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/csstype": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", @@ -2424,15 +2380,6 @@ "node": ">= 6" } }, - "node_modules/frac": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz", - "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==", - "license": "Apache-2.0", - "engines": { - "node": ">=0.8" - } - }, "node_modules/fraction.js": { "version": "5.3.4", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", @@ -3238,18 +3185,6 @@ "node": ">=0.10.0" } }, - "node_modules/ssf": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz", - "integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==", - "license": "Apache-2.0", - "dependencies": { - "frac": "~1.1.2" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/tailwindcss": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.2.tgz", @@ -3404,45 +3339,6 @@ "optional": true } } - }, - "node_modules/wmf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz", - "integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==", - "license": "Apache-2.0", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/word": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz", - "integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==", - "license": "Apache-2.0", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/xlsx": { - "version": "0.18.5", - "resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz", - "integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==", - "license": "Apache-2.0", - "dependencies": { - "adler-32": "~1.3.0", - "cfb": "~1.2.1", - "codepage": "~1.15.0", - "crc-32": "~1.2.1", - "ssf": "~0.11.2", - "wmf": "~1.0.1", - "word": "~0.3.0" - }, - "bin": { - "xlsx": "bin/xlsx.njs" - }, - "engines": { - "node": ">=0.8" - } } } } diff --git a/frontend/package.json b/frontend/package.json index da38003..a8d63aa 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -15,8 +15,7 @@ "lucide-react": "^1.24.0", "react": "^19.2.7", "react-dom": "^19.2.7", - "react-router-dom": "^7.18.1", - "xlsx": "^0.18.5" + "react-router-dom": "^7.18.1" }, "devDependencies": { "@tailwindcss/postcss": "^4.3.2", @@ -31,4 +30,4 @@ "tailwindcss": "^4.3.2", "vite": "^8.1.1" } -} +} \ No newline at end of file diff --git a/frontend/patch_footer.py b/frontend/patch_footer.py new file mode 100644 index 0000000..ae3802d --- /dev/null +++ b/frontend/patch_footer.py @@ -0,0 +1,76 @@ +ο»Ώimport os + +footer_path = 'src/components/Footer.jsx' +footer_content = '''import { Link } from 'react-router-dom'; + +export default function Footer() { + return ( +
+
+ +
+
+ +
+ + BookKeepPro + +

+ Bookkeeping, payroll and tax preparation for growing businesses - kept precise, kept compliant. +

+
+ +
+

Navigate

+
+ Home + About Us + Services + Contact Us +
+
+ +
+

Reach us

+
+

+ location_on + USA - 2520 Indigo Dr, McKinney, TX 75072 +

+

+ location_on + India - 508 White Square, Hinjewadi Road, Pune 411057 +

+

+ mail + atharvg.aiindia@gmail.com +

+

+ phone + +91 8275367267 +

+
+
+ +
+
+ +
+
+

+ Β© {new Date().getFullYear()} Bookkeeping Business Solutions. All rights reserved. +

+
+ Privacy Policy + Terms of Service +
+
+
+
+ ); +} +''' +with open(footer_path, 'w', encoding='utf-8') as f: + f.write(footer_content) + +print('Footer patched successfully.') diff --git a/frontend/patch_footer_dark.py b/frontend/patch_footer_dark.py new file mode 100644 index 0000000..6b858f5 --- /dev/null +++ b/frontend/patch_footer_dark.py @@ -0,0 +1,78 @@ +ο»Ώimport os + +footer_path = 'src/components/Footer.jsx' +footer_content = '''import { Link } from 'react-router-dom'; + +export default function Footer() { + return ( +
+ +
+ + {/* Brand Section */} +
+ + BookKeepPro + +

+ Bookkeeping, payroll and tax preparation for growing businesses - kept precise, kept compliant. +

+
+ + {/* Links Section */} +
+ +
+

Navigate

+
+ Home + About Us + Services + Contact Us +
+
+ +
+

Reach us

+
+

+ location_on + USA - 2520 Indigo Dr, McKinney, TX 75072 +

+

+ location_on + India - 508 White Square, Hinjewadi Road, Pune 411057 +

+

+ mail + atharvg.aiindia@gmail.com +

+

+ phone + +91 8275367267 +

+
+
+ +
+
+ +
+
+

+ Β© {new Date().getFullYear()} Bookkeeping Business Solutions. All rights reserved. +

+
+ Privacy Policy + Terms of Service +
+
+
+
+ ); +} +''' +with open(footer_path, 'w', encoding='utf-8') as f: + f.write(footer_content) + +print('Footer fully updated to premium dark layout.') diff --git a/frontend/patch_footer_target.py b/frontend/patch_footer_target.py new file mode 100644 index 0000000..13f63cc --- /dev/null +++ b/frontend/patch_footer_target.py @@ -0,0 +1,49 @@ +ο»Ώimport os + +footer_path = 'src/components/Footer.jsx' +footer_content = '''import { Link } from 'react-router-dom'; + +export default function Footer() { + return ( +
+
+ + {/* Left: Brand */} +
+ + BookKeepPro + +

+ Bookkeeping, payroll and tax preparation for growing businesses - kept precise, kept compliant. +

+
+ + {/* Right: Links */} +
+ +
+

Navigate

+ Home + About Us + Services + Contact Us +
+ +
+

Reach Us

+

USA - 2520 Indigo Dr, McKinney, TX 75072

+

India - 508 White Square, Hinjewadi Road, Pune 411057

+ atharvg.aiindia@gmail.com + +91 8275367267 +
+ +
+
+
+ ); +} +''' +with open(footer_path, 'w', encoding='utf-8') as f: + f.write(footer_content) + +print('Footer patched exactly to image.') diff --git a/frontend/patch_phase4_safe.py b/frontend/patch_phase4_safe.py new file mode 100644 index 0000000..ac16956 --- /dev/null +++ b/frontend/patch_phase4_safe.py @@ -0,0 +1,320 @@ +ο»Ώimport os + +base_path = 'src/components' + +# 1. Button.jsx +button_path = os.path.join(base_path, 'Button.jsx') +button_content = '''import React from 'react'; +import { Loader2 } from 'lucide-react'; + +export default function Button({ + children, + variant = 'primary', + size = 'md', + className = '', + type = 'button', + loading = false, + disabled = false, + icon, + ...props +}) { + const baseClass = "btn relative inline-flex items-center justify-center transition-all duration-200 active:translate-y-[1px] disabled:opacity-60 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--emerald)]"; + const variantClass = `btn-${variant}`; + const sizeClass = size === 'sm' ? 'btn-sm' : size === 'xs' ? 'btn-xs px-2 py-1 text-xs' : ''; + + return ( + + ); +} +''' +with open(button_path, 'w', encoding='utf-8') as f: + f.write(button_content) + +# 2. StatusChip.jsx +status_path = os.path.join(base_path, 'StatusChip.jsx') +status_content = '''import React from 'react'; + +export default function StatusChip({ status, note }) { + const s = (status || 'pending').toLowerCase(); + + let badgeClass = 'badge-yellow'; + if (s === 'approved' || s === 'filed' || s === 'verified') badgeClass = 'badge-green'; + if (s === 'rejected' || s === 'error') badgeClass = 'badge-red'; + if (s === 'sent_for_approval') badgeClass = 'badge-blue'; + + const statusText = s.replace(/_/g, ' ').toUpperCase(); + + return ( +
+ {statusText} + {note && ( +
+ Rejection Note: {note} +
+ )} +
+ ); +} +''' +with open(status_path, 'w', encoding='utf-8') as f: + f.write(status_content) + +# 3. ConfirmModal.jsx +modal_path = os.path.join(base_path, 'ConfirmModal.jsx') +modal_content = '''import React, { useEffect } from "react"; +import Button from "./Button"; + +function ConfirmModal({ isOpen, title, message, confirmText, cancelText, onConfirm, onCancel, isDestructive }) { + useEffect(() => { + if (!isOpen) return; + const handleEsc = (e) => { + if (e.key === 'Escape') onCancel(); + }; + window.addEventListener('keydown', handleEsc); + return () => window.removeEventListener('keydown', handleEsc); + }, [isOpen, onCancel]); + + if (!isOpen) return null; + + return ( +
+
+ +
e.stopPropagation()}> + {title &&

{title}

} + {message && ( +
+ {message.split('\\n').map((line, i) => ( + + {line} +
+
+ ))} +
+ )} +
+ + +
+
+
+ ); +} + +export default ConfirmModal; +''' +with open(modal_path, 'w', encoding='utf-8') as f: + f.write(modal_content) + +# 4. ResponsiveTable.jsx +table_path = os.path.join(base_path, 'ResponsiveTable.jsx') +table_content = '''import React from 'react'; + +export default function ResponsiveTable({ columns, data, keyField = 'id', renderCard }) { + if (!data || data.length === 0) { + return ( +
+ inventory_2 +

No records found

+

Try adjusting your filters or upload a new document.

+
+ ); + } + + return ( + <> +
+ + + + {columns.map((col, idx) => ( + + ))} + + + + {data.map(row => ( + + {columns.map((col, idx) => ( + + ))} + + ))} + +
+ {col.label} +
+ {col.render ? col.render(row) : row[col.key]} +
+
+ +
+ {data.map(row => ( +
+ {renderCard ? renderCard(row) : ( +
+ {columns.map((col, idx) => ( +
+ {col.label}: + {col.render ? col.render(row) : row[col.key]} +
+ ))} +
+ )} +
+ ))} +
+ + ); +} +''' +with open(table_path, 'w', encoding='utf-8') as f: + f.write(table_content) + +# 5. Navbar.jsx +navbar_path = os.path.join(base_path, 'Navbar.jsx') +navbar_content = '''import { Link, useLocation, useNavigate } from 'react-router-dom'; +import { useState } from 'react'; + +export default function Navbar({ solid = false }) { + const [isOpen, setIsOpen] = useState(false); + const location = useLocation(); + const navigate = useNavigate(); + + const isActive = (path) => { + if (path === '/' && location.pathname === '/') return true; + if (path !== '/' && location.pathname.startsWith(path)) return true; + return false; + }; + + const navLinks = [ + { name: 'Home', path: '/' }, + { name: 'About Us', path: '/about-us' }, + { name: 'Services', path: '/services' }, + { name: 'Contact Us', path: '/contact' } + ]; + + return ( +
+
+ + BookKeepPro + + + + +
setIsOpen(!isOpen)}> + +
+
+
+ ); +} +''' +with open(navbar_path, 'w', encoding='utf-8') as f: + f.write(navbar_content) + +# 6. Footer.jsx +footer_path = os.path.join(base_path, 'Footer.jsx') +footer_content = '''import { Link } from 'react-router-dom'; + +export default function Footer() { + return ( +
+
+ +
+
+
+ + BookKeepPro + +

+ Bookkeeping, payroll and tax preparation for growing businesses - kept precise, kept compliant. +

+
+ +
+

Navigate

+
+ Home + About Us + Services + Contact Us +
+
+ +
+

Reach us

+
+

+ location_on + USA - 2520 Indigo Dr, McKinney, TX 75072 +

+

+ location_on + India - 508 White Square, Hinjewadi Road, Pune 411057 +

+

+ mail + atharvg.aiindia@gmail.com +

+

+ phone + +91 8275367267 +

+
+
+
+
+ +
+
+

+ Β© {new Date().getFullYear()} Bookkeeping Business Solutions. All rights reserved. +

+
+
+
+ ); +} +''' +with open(footer_path, 'w', encoding='utf-8') as f: + f.write(footer_content) + +print('Phase 4 rewritten safely.') diff --git a/frontend/public/css/base.css b/frontend/public/css/base.css index 433a86f..35dce73 100644 --- a/frontend/public/css/base.css +++ b/frontend/public/css/base.css @@ -13,7 +13,7 @@ /* core palette */ --ink: #17211D; --ink-soft: #2A362F; - --brass: #B0803D; + --brass: #8F6528; --brass-dark: #8F6528; --brass-light: rgba(176, 128, 61, 0.12); --emerald: #1F5D46; @@ -41,7 +41,7 @@ --success-bg: rgba(31, 93, 70, 0.10); --error: #A63A3A; --error-bg: rgba(166, 58, 58, 0.10); - --warn: #B0803D; + --warn: #8F6528; --warn-bg: rgba(176, 128, 61, 0.12); --font-display: 'Fraunces', 'Georgia', serif; @@ -299,3 +299,13 @@ textarea:focus { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } + + +@media (max-width: 640px) { + .btn:not(.btn-icon):not(.toast-close), .btn-sm:not(.btn-icon), .select-input, .input-field { + min-height: 44px; + } + .chatbot-fab { + bottom: 80px; /* move it up so it doesn't cover footer/bottom content on mobile */ + } +} diff --git a/frontend/public/css/components.css b/frontend/public/css/components.css index 900f75a..7761f41 100644 --- a/frontend/public/css/components.css +++ b/frontend/public/css/components.css @@ -195,8 +195,8 @@ flex-shrink: 0; font-family: var(--font-display); } .user-info { min-width: 0; flex: 1; } -.user-info .u-name { font-weight: 600; color: var(--ink); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.user-info .u-email { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; } +.user-info .u-name { font-weight: 600; color: var(--ink); font-size: 14px; word-break: break-word; } +.user-info .u-email { font-size: 12px; color: var(--muted); word-break: break-word; margin-top: 2px; } .user-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 10; flex-wrap: wrap; } /* ── Role Controls ───────────────────────────────────────── */ @@ -227,7 +227,7 @@ } .doc-row:hover { border-color: #cfc7ad; background: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(23,33,29,0.06); } .doc-row-left { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; } -.doc-row-name { font-weight: 600; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +.doc-row-name { font-weight: 600; font-size: 13px; color: var(--ink); word-break: break-word; } .doc-row-type { font-size: 12px; color: var(--muted); } .doc-row-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; } @@ -856,3 +856,16 @@ } + +/* StatusChip */ +.status-chip-container { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 4px; +} +.status-chip-note { + font-size: 12px; + color: var(--error); + font-style: italic; +} diff --git a/frontend/public/css/dynamic.css b/frontend/public/css/dynamic.css new file mode 100644 index 0000000..e24154a --- /dev/null +++ b/frontend/public/css/dynamic.css @@ -0,0 +1,171 @@ +ο»Ώ/* ============================================================ + dynamic.css β€” Ledger motion layer + Uses ONLY existing tokens (colours, Fraunces / IBM Plex fonts). + Concept: a brass rule is "struck under" a checked entry; numbers + tick like a ledger counter. Load AFTER animations.css. + Rules: animate transform/opacity only; entrance animations use + fill-mode `backwards` (never `both`) so hover transforms still work. + ============================================================ */ + +:root { + --ease-out: cubic-bezier(0.16, 1, 0.3, 1); + --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); + --brass-rgb: 176, 128, 61; /* = original brass, for rgba() */ + --emerald-rgb: 31, 93, 70; +} + +/* ---------- Global polish ---------- */ +::selection { background: rgba(var(--brass-rgb), 0.28); color: var(--ink); } +h1, h2, h3 { text-wrap: balance; } +.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } +:focus-visible { outline: 2px solid var(--emerald); outline-offset: 3px; } +.btn:focus-visible, .tab-btn:focus-visible { outline-offset: 2px; } + +/* ---------- Scroll progress rule (width driven by --scroll, set in motion.js) ---------- */ +.scroll-progress { + position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 10000; + background: linear-gradient(90deg, var(--emerald), rgb(var(--brass-rgb))); + transform: scaleX(var(--scroll, 0)); transform-origin: 0 50%; pointer-events: none; +} + +/* ---------- Header / navbar respond to scroll ---------- */ +.navbar:not(.navbar-solid) { position: fixed; transition: background 0.35s, box-shadow 0.35s, border-color 0.35s; } +html[data-scrolled] .navbar:not(.navbar-solid) { + background: rgba(23, 33, 29, 0.92); + box-shadow: 0 10px 28px -14px rgba(23, 33, 29, 0.6); + border-bottom-color: rgba(var(--brass-rgb), 0.35); +} +.app-header { transition: box-shadow 0.3s, background 0.3s; } +html[data-scrolled] .app-header { box-shadow: var(--shadow-sm); } + +/* ---------- Page + entrance choreography ---------- */ +@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.985); } } +@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } } +.page-enter { animation: pageIn 0.5s var(--ease-out) backwards; } + +:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > * { + animation: rise 0.65s var(--ease-out) backwards; + animation-delay: var(--d, 0ms); +} +/* beat the older `fade-up` (fill-mode both) which froze the hover-lift transform */ +.fade-up, .service-card.fade-up, .user-card.fade-up { animation-name: rise; animation-duration: 0.65s; animation-timing-function: var(--ease-out); animation-fill-mode: backwards; } +:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(1) { --d: 40ms; } +:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(2) { --d: 110ms; } +:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(3) { --d: 180ms; } +:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(4) { --d: 250ms; } +:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(5) { --d: 320ms; } +:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(6) { --d: 380ms; } +:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(7) { --d: 430ms; } +:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(8) { --d: 480ms; } +:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(n+9) { --d: 520ms; } + +/* ---------- Cards: lift + pointer spotlight (vars set in motion.js) ---------- */ +:is(.stat-card, .user-card, .service-card, .card) { position: relative; } +:is(.stat-card, .user-card, .service-card, .card):hover { + background-image: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(var(--brass-rgb), 0.10), transparent 62%); +} +.stat-icon { display: inline-flex; transition: transform 0.5s var(--ease-spring); } +.stat-card:hover .stat-icon { transform: translateY(-3px) rotate(-6deg) scale(1.08); } +.stat-card.active-filter { animation: rise 0.65s var(--ease-out) backwards, ringPulse 2.6s 1s ease-out infinite; animation-delay: var(--d, 0ms), 1s; } +@keyframes ringPulse { 0% { box-shadow: 0 0 0 0 rgba(var(--emerald-rgb), 0.28); } 70%, 100% { box-shadow: 0 0 0 10px rgba(var(--emerald-rgb), 0); } } +.user-avatar { transition: transform 0.4s var(--ease-spring), box-shadow 0.3s; } +.user-card:hover .user-avatar { transform: scale(1.1); box-shadow: 0 0 0 4px rgba(var(--brass-rgb), 0.22); } +.service-card img { transition: transform 0.9s var(--ease-out); } +.service-card:hover img { transform: scale(1.06); } + +/* ---------- Buttons: lift, brass sheen, press ---------- */ +.btn { position: relative; overflow: hidden; transition: transform 0.18s var(--ease-out), box-shadow 0.25s, background-color 0.25s, color 0.25s, border-color 0.25s; } +.btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); } +.btn:not(:disabled):active { transform: translateY(1px) scale(0.97); box-shadow: none; } +.btn-primary::before, .login-btn::before { + content: ''; position: absolute; inset: 0; pointer-events: none; + background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.26) 50%, transparent 70%); + transform: translateX(-130%); transition: transform 0.8s var(--ease-out); +} +.btn-primary:not(:disabled):hover::before, .login-btn:hover::before { transform: translateX(130%); } +.login-btn { position: relative; overflow: hidden; } + +/* ---------- Status chips: attention dot / stamp ---------- */ +@keyframes pop { 0% { opacity: 0; transform: scale(0.6); } 100% { opacity: 1; transform: scale(1); } } +@keyframes dotPulse{ 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } } +@keyframes stamp { 0% { opacity: 0; transform: scale(2.2) rotate(-18deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } } +.badge { animation: pop 0.45s var(--ease-spring) backwards; } +/* Attention dot / stamp only on real STATUS chips (StatusChip wraps them in .status-chip-container) β€” not on role/label badges */ +.status-chip-container :is(.badge-yellow, .badge-orange, .badge-blue)::before { + content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; animation: dotPulse 1.8s ease-in-out infinite; +} +.status-chip-container .badge-green::before { content: 'βœ“' / ''; font-weight: 700; display: inline-block; animation: stamp 0.55s 0.15s var(--ease-spring) backwards; } +.status-chip-container .badge-red::before { content: '!' / ''; font-weight: 700; display: inline-block; animation: stamp 0.55s 0.15s var(--ease-spring) backwards; } + +/* ---------- Tabs, inputs, toasts, skeletons ---------- */ +.tab-btn { border-radius: var(--radius-xs) var(--radius-xs) 0 0; } +.tab-btn:hover { background: rgba(var(--brass-rgb), 0.08); color: var(--ink); } +.tab-btn.active { background: linear-gradient(180deg, transparent, rgba(var(--brass-rgb), 0.07)); } +.tab-panel.active { animation: pageIn 0.4s var(--ease-out) backwards; } +input, select, textarea { transition: border-color 0.2s, box-shadow 0.25s; } +input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; border-color: rgb(var(--brass-rgb)); box-shadow: var(--shadow-glow); } +@keyframes toastIn { from { opacity: 0; transform: translateX(28px) scale(0.96); } } +.toast { animation: toastIn 0.5s var(--ease-spring) backwards; } +@keyframes shimmer { to { transform: translateX(100%); } } +.skeleton { position: relative; overflow: hidden; background: var(--border); border-radius: var(--radius-md); } +.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent); animation: shimmer 1.4s infinite; } +.skeleton-card { height: 128px; } + +/* ---------- Upload drop zone ---------- */ +@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } } +.drop-zone { transition: border-color 0.25s, background 0.25s, transform 0.3s var(--ease-spring), box-shadow 0.3s; } +.drop-zone:hover .material-symbols-outlined { animation: bob 1.3s ease-in-out infinite; } +.drop-zone.drag-over { border-style: solid; border-color: rgb(var(--brass-rgb)); background: rgba(var(--brass-rgb), 0.10); transform: scale(1.015); box-shadow: var(--shadow-glow); } +.drop-zone.drag-over .material-symbols-outlined { animation: bob 0.7s ease-in-out infinite; } + +/* ---------- Chatbot + banners ---------- */ +@keyframes ring { 0% { transform: scale(1); opacity: 0.7; } 80%, 100% { transform: scale(1.6); opacity: 0; } } +.chatbot-fab::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(var(--brass-rgb), 0.6); animation: ring 2.8s ease-out infinite; pointer-events: none; } +.chatbot-fab.open::before { animation: none; opacity: 0; } +.chatbot-fab:not(.open):hover { transform: scale(1.08) rotate(-4deg); } +.chatbot-window { transform-origin: bottom right; transition: opacity 0.3s, transform 0.4s var(--ease-spring); } +@keyframes glowNudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--brass-rgb), 0); } 50% { box-shadow: 0 0 0 6px rgba(var(--brass-rgb), 0.18); } } +.engagement-banner:not(.acknowledged) { animation: glowNudge 3.2s 1s ease-in-out 3; } + +/* ---------- Marketing: hero + reveals ---------- */ +/* Ambient light: soft brass + emerald glows drift over the (static) photo. Gradients only β€” no image scaling, so it stays cheap. */ +.hero { isolation: isolate; } +.hero::after { + content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; + background: + radial-gradient(55% 50% at 18% 28%, rgba(var(--brass-rgb), 0.20), transparent 70%), + radial-gradient(50% 60% at 86% 82%, rgba(var(--emerald-rgb), 0.30), transparent 70%); + animation: drift 20s ease-in-out infinite alternate; +} +@keyframes drift { from { transform: translate3d(-4%, -3%, 0) scale(1); } to { transform: translate3d(4%, 3%, 0) scale(1.12); } } +@media (max-width: 768px) { .hero::after { animation: none; } } +.hero-eyebrow, .hero h1, .hero-sub, .hero-actions { animation: rise 1s var(--ease-out) backwards; } +.hero-eyebrow { animation-delay: 0.1s; } .hero h1 { animation-delay: 0.22s; } .hero-sub { animation-delay: 0.4s; } .hero-actions { animation-delay: 0.55s; } +.hero h1 em { background: linear-gradient(rgb(var(--brass-rgb)), rgb(var(--brass-rgb))) no-repeat 0 100% / 0 2px; padding-bottom: 0.08em; animation: drawRule 1.2s 1.1s var(--ease-out) forwards; } +@keyframes drawRule { to { background-size: 100% 2px; } } +.hero-stats { animation: rise 1.1s 0.7s var(--ease-out) backwards; } +.stat-block { transition: background 0.3s; } +.stat-block:hover { background: rgba(var(--brass-rgb), 0.08); } +.stat-figure { transition: color 0.3s, transform 0.4s var(--ease-spring); } +.stat-block:hover .stat-figure { color: var(--emerald); transform: scale(1.06); } + +/* Reveal: hidden ONLY when JS has opted in (html.motion) β€” never blank without JS / reduced motion */ +.reveal { opacity: 1; transform: none; } +html.motion .reveal:not(.in-view) { opacity: 0; transform: translateY(26px); } +html.motion .reveal .eyebrow::before { transform: scaleX(0); transform-origin: left; transition: transform 0.9s 0.25s var(--ease-out); } +html.motion .reveal.in-view .eyebrow::before { transform: scaleX(1); } +@supports (animation-timeline: view()) { + @keyframes parallaxY { from { transform: translateY(-18px) scale(1.04); } to { transform: translateY(18px) scale(1.04); } } + .about-media img { animation: parallaxY linear both; animation-timeline: view(); animation-range: cover 0% 100%; } +} + +/* Layout safety: long text inside a .badge (About page

) must wrap instead of forcing horizontal scroll */ +.badge { max-width: 100%; } +p.badge { white-space: normal; text-align: left; } + +/* ---------- Respect reduced motion ---------- */ +@media (prefers-reduced-motion: reduce) { + *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } + .scroll-progress { display: none; } +} +@media (hover: none) { :is(.stat-card, .user-card, .service-card, .card):hover { background-image: none; } } diff --git a/frontend/public/llms.txt b/frontend/public/llms.txt index 334ea64..f97a640 100644 --- a/frontend/public/llms.txt +++ b/frontend/public/llms.txt @@ -8,10 +8,10 @@ BookKeepPro handles the books, the payroll and the filings for growing businesse ## Pages -- [Home](https://aiindiacpa.duckdns.org/) -- [About Us](https://aiindiacpa.duckdns.org/about-us) -- [Services](https://aiindiacpa.duckdns.org/services) -- [Contact Us](https://aiindiacpa.duckdns.org/contact) +- [Home](https://aicpa.duckdns.org/) +- [About Us](https://aicpa.duckdns.org/about-us) +- [Services](https://aicpa.duckdns.org/services) +- [Contact Us](https://aicpa.duckdns.org/contact) ## Services diff --git a/frontend/public/robots.txt b/frontend/public/robots.txt index e36ca2f..6067cd8 100644 --- a/frontend/public/robots.txt +++ b/frontend/public/robots.txt @@ -14,4 +14,4 @@ Disallow: /reset-password Disallow: /verify-email Disallow: /resend-verification -Sitemap: https://aiindiacpa.duckdns.org/sitemap.xml +Sitemap: https://aicpa.duckdns.org/sitemap.xml diff --git a/frontend/public/sitemap.xml b/frontend/public/sitemap.xml index 3bd55d6..750984f 100644 --- a/frontend/public/sitemap.xml +++ b/frontend/public/sitemap.xml @@ -1,32 +1,32 @@ - https://aiindiacpa.duckdns.org/ + https://aicpa.duckdns.org/ monthly 1.0 - https://aiindiacpa.duckdns.org/about + https://aicpa.duckdns.org/about monthly 0.8 - https://aiindiacpa.duckdns.org/services + https://aicpa.duckdns.org/services monthly 0.8 - https://aiindiacpa.duckdns.org/contact + https://aicpa.duckdns.org/contact monthly 0.7 - https://aiindiacpa.duckdns.org/login + https://aicpa.duckdns.org/login yearly 0.5 - https://aiindiacpa.duckdns.org/signup + https://aicpa.duckdns.org/signup yearly 0.5 diff --git a/frontend/src/components/AdminChatbot.jsx b/frontend/src/components/AdminChatbot.jsx index 9422235..5a4bef5 100644 --- a/frontend/src/components/AdminChatbot.jsx +++ b/frontend/src/components/AdminChatbot.jsx @@ -98,19 +98,7 @@ export default function AdminChatbot() { // ── System overview ─────────────────────────────────────────────────────── const handleAdminStatusCheck = async () => { - setMessages(prev => [...prev, { type: 'user', role: 'user', text: 'Give me a system overview.' }]); - setView('chat'); - try { - const res = await authFetch('/api/chatbot/admin-status'); - if (res.ok) { - const data = await res.json(); - setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: data.message }]); - } else { - setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: 'Could not fetch system status right now.' }]); - } - } catch { - setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: 'Network error.' }]); - } + sendMessage('Give me a system overview.'); }; // ── Bulk action executor with confirmation ──────────────────────────────── @@ -161,18 +149,32 @@ export default function AdminChatbot() { const replyText = data.content || "Sorry, I couldn't understand that."; // Check if response contains a bulk_action JSON block - const bulkMatch = replyText.match(/\{[^{}]*"bulk_action"[^{}]*\}/s); - if (bulkMatch) { + let jsonStr = replyText; + const mdMatch = replyText.match(/```(?:json)?\s*(\{[\s\S]*?\})\s*```/); + if (mdMatch) { + jsonStr = mdMatch[1]; + } else { + const firstIdx = replyText.indexOf('{'); + const lastIdx = replyText.lastIndexOf('}'); + if (firstIdx !== -1 && lastIdx !== -1) { + jsonStr = replyText.substring(firstIdx, lastIdx + 1); + } + } + + if (jsonStr.includes('"bulk_action"')) { try { - const parsed = JSON.parse(bulkMatch[0]); + const parsed = JSON.parse(jsonStr); if (parsed.bulk_action) { setPendingBulk(parsed.bulk_action); - const cleanText = replyText.replace(bulkMatch[0], '').trim(); + const cleanText = replyText.replace(jsonStr, '').replace(/```(?:json)?|```/g, '').trim(); setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: cleanText || "I can do that. Please confirm below." }]); setIsTyping(false); return; } - } catch { /* not valid JSON, render as text */ } + } catch (e) { + console.error("Failed to parse JSON:", e, jsonStr); + /* not valid JSON, render as text */ + } } setMessages(prev => [...prev, { type: 'bot', role: 'assistant', text: replyText }]); diff --git a/frontend/src/components/CountUp.jsx b/frontend/src/components/CountUp.jsx new file mode 100644 index 0000000..f665e67 --- /dev/null +++ b/frontend/src/components/CountUp.jsx @@ -0,0 +1,43 @@ +ο»Ώimport { useEffect, useRef, useState } from 'react'; + +// Ledger-style ticking counter. Counts from the previous value to the new one +// once visible; reduced-motion users get the final number immediately. The +// animated text is aria-hidden and the final value is exposed to screen readers. +export default function CountUp({ value, duration = 1100, prefix = '', suffix = '' }) { + const target = Number(value); + const valid = Number.isFinite(target); + const [shown, setShown] = useState(0); + const ref = useRef(null); + const from = useRef(0); + + useEffect(() => { + if (!valid) return undefined; + const reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches; + if (reduce || target === from.current) { setShown(target); from.current = target; return undefined; } + let raf = 0; + let started = false; + const run = () => { + started = true; + const start = performance.now(); + const a = from.current; + const tick = (now) => { + const t = Math.min(1, (now - start) / duration); + const eased = 1 - Math.pow(1 - t, 4); // easeOutQuart + setShown(Math.round(a + (target - a) * eased)); + if (t < 1) raf = requestAnimationFrame(tick); else from.current = target; + }; + raf = requestAnimationFrame(tick); + }; + const io = new IntersectionObserver(([en]) => { if (en.isIntersecting && !started) { io.disconnect(); run(); } }, { threshold: 0.3 }); + if (ref.current) io.observe(ref.current); + return () => { io.disconnect(); cancelAnimationFrame(raf); }; + }, [target, valid, duration]); + + if (!valid) return {value}; + return ( + + + {prefix}{target.toLocaleString('en-US')}{suffix} + + ); +} diff --git a/frontend/src/components/ExpandableSummaryBlock.jsx b/frontend/src/components/ExpandableSummaryBlock.jsx index 0d7dadf..24e2da5 100644 --- a/frontend/src/components/ExpandableSummaryBlock.jsx +++ b/frontend/src/components/ExpandableSummaryBlock.jsx @@ -1,4 +1,4 @@ -import * as XLSX from 'xlsx'; + import { useState } from 'react'; import ExpandableValue from './ExpandableValue'; @@ -62,45 +62,7 @@ export default function ExpandableSummaryBlock({ extractedData, onSave }) { } }; - const handleExport = () => { - // Export extracted AI data as a proper .xlsx file using SheetJS - const { _meta, ...dataFields } = extractedData || {}; - - const rows = [['Field', 'Value']]; - Object.entries(dataFields).forEach(([key, val]) => { - let valStr = val; - if (Array.isArray(val)) valStr = val.join('; '); - else if (typeof val === 'object' && val !== null) valStr = JSON.stringify(val); - - let finalKey = String(key); - let finalVal = String(valStr ?? ''); - - // Sanitize CSV/Excel Formula Injection - if (/^[=+\-@]/.test(finalKey)) finalKey = "'" + finalKey; - if (/^[=+\-@]/.test(finalVal)) finalVal = "'" + finalVal; - - rows.push([finalKey, finalVal]); - }); - - const ws = XLSX.utils.aoa_to_sheet(rows); - - // Bold + green header - ['A1', 'B1'].forEach(ref => { - if (ws[ref]) ws[ref].s = { font: { bold: true, color: { rgb: 'FFFFFF' } }, fill: { fgColor: { rgb: '2C7A5B' } } }; - }); - - // Column widths - ws['!cols'] = [ - { wch: Math.max(10, ...Object.keys(dataFields).map(k => k.length + 2)) }, - { wch: 45 }, - ]; - - const wb = XLSX.utils.book_new(); - XLSX.utils.book_append_sheet(wb, ws, 'Extracted Data'); - XLSX.writeFile(wb, 'extracted_data.xlsx'); - } - - const showToggle = entries.length > 3; + const showToggle = entries.length > 3; const entriesToShow = expanded ? entries : entries.slice(0, 3); const confidenceStyle = CONFIDENCE_STYLES[_meta?.tier] || CONFIDENCE_STYLES.unknown; @@ -164,9 +126,6 @@ export default function ExpandableSummaryBlock({ extractedData, onSave }) { ) :

}
- diff --git a/frontend/src/components/ExpandableValue.jsx b/frontend/src/components/ExpandableValue.jsx index 52f1e74..8e60c0e 100644 --- a/frontend/src/components/ExpandableValue.jsx +++ b/frontend/src/components/ExpandableValue.jsx @@ -23,7 +23,7 @@ export default function ExpandableValue({ value, isArray }) { style={{ background: 'none', border: 'none', - color: 'var(--primary)', + color: 'var(--emerald)', fontSize: '12px', fontWeight: 600, padding: '4px 0', @@ -60,7 +60,7 @@ export default function ExpandableValue({ value, isArray }) { style={{ background: 'none', border: 'none', - color: 'var(--primary)', + color: 'var(--emerald)', fontSize: '12px', fontWeight: 600, padding: '4px 0', diff --git a/frontend/src/components/Footer.jsx b/frontend/src/components/Footer.jsx index 67623ca..7a86e11 100644 --- a/frontend/src/components/Footer.jsx +++ b/frontend/src/components/Footer.jsx @@ -20,7 +20,8 @@ export default function Footer() {

Reach us

USA Β· 2520 Indigo Dr, McKinney, TX 75072

-

India Β· 508 White Square, Hinjewadi Road, Pune 411057

+

India Β· Office no.405, Fourth floor, Above Just In Time,
+ Landmark Centre, Survey No 46/1B, Plot No 2, Satara Rd,
Opposite City Pride Theater, Pune, Maharashtra-411009

atharvg.aiindia@gmail.com

+91 8275367267

diff --git a/frontend/src/components/StatusChip.jsx b/frontend/src/components/StatusChip.jsx new file mode 100644 index 0000000..7ef6987 --- /dev/null +++ b/frontend/src/components/StatusChip.jsx @@ -0,0 +1,23 @@ +import React from 'react'; + +export default function StatusChip({ status, note }) { + const s = (status || 'pending').toLowerCase(); + + let badgeClass = 'badge-yellow'; + if (s === 'approved' || s === 'filed' || s === 'verified') badgeClass = 'badge-green'; + if (s === 'rejected' || s === 'error') badgeClass = 'badge-red'; + if (s === 'sent_for_approval') badgeClass = 'badge-blue'; + + const statusText = s.replace(/_/g, ' ').toUpperCase(); + + return ( +
+ {statusText} + {note && ( +
+ {s === 'rejected' ? 'Reason: ' : 'Note: '}{note} +
+ )} +
+ ); +} diff --git a/frontend/src/index.css b/frontend/src/index.css index 180989a..7069fe6 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -5,19 +5,19 @@ --color-brand-emerald: #1F5D46; --color-brand-emerald-dark: #163F30; --color-brand-emerald-light: #E8F1EC; - --color-brand-brass: #B0803D; + --color-brand-brass: #8F6528; --color-brand-brass-dark: #8F6528; --color-brand-brass-light: #F6EEE0; --color-brand-paper: #F5F2E9; --color-brand-card: #FFFFFF; - --color-brand-muted: #6B7268; + --color-brand-muted: #656C62; --color-brand-border: #E3DDC9; --color-status-success: #1F5D46; --color-status-success-bg: #E8F1EC; --color-status-error: #A63A3A; --color-status-error-bg: #F7E9E9; - --color-status-warn: #B0803D; + --color-status-warn: #8F6528; --color-status-warn-bg: #F6EEE0; --font-sans: "IBM Plex Sans", system-ui, sans-serif; @@ -321,3 +321,70 @@ h3 { @apply text-2xl md:text-3xl; } .toast-info { border-left: 4px solid var(--emerald); } .toast-message { flex: 1; font-size: 14px; font-weight: 500; } .toast-close { background: none; border: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; } + +/* -------------------------------- */ +/* Fixes from QA */ +/* -------------------------------- */ +.tab-bar { + display: flex; + gap: 8px; + border-bottom: 1px solid var(--border); + margin-bottom: 24px; + overflow-x: auto; + scrollbar-width: none; /* Firefox */ + position: relative; + white-space: nowrap; +} + +.tab-bar::-webkit-scrollbar { + display: none; /* Chrome/Safari */ +} + +/* Fade on the right edge to indicate scrolling */ +.tab-bar-container { + position: relative; +} +.tab-bar-container::after { + content: ""; + position: absolute; + top: 0; + right: 0; + bottom: 0; + width: 40px; + background: linear-gradient(to right, transparent, var(--paper)); + pointer-events: none; +} + +.tab-btn { + background: transparent; + border: none; + border-bottom: 2px solid transparent; + padding: 12px 16px; + font-weight: 600; + font-size: 15px; + color: var(--muted); + cursor: pointer; + display: flex; + align-items: center; + gap: 8px; + transition: all 0.2s; +} + +.tab-btn:hover { + color: var(--navy); +} + +.tab-btn.active { + color: var(--emerald); + border-bottom-color: var(--emerald); +} + +.card-title { + font-family: var(--font-sans); + font-weight: 600; +} + +.footer-copy { + color: #8c9289; /* Increased contrast for footer copyright */ +} + diff --git a/frontend/src/layouts/DashboardLayout.jsx b/frontend/src/layouts/DashboardLayout.jsx index d30bd1f..064bc8d 100644 --- a/frontend/src/layouts/DashboardLayout.jsx +++ b/frontend/src/layouts/DashboardLayout.jsx @@ -1,9 +1,10 @@ -import { Outlet, Link, useNavigate } from 'react-router-dom'; +import { Outlet, Link, useNavigate, useLocation } from 'react-router-dom'; import { useAuth } from '../context/AuthContext'; export default function DashboardLayout() { const { user, logout } = useAuth(); const navigate = useNavigate(); + const { pathname } = useLocation(); return (
@@ -21,7 +22,7 @@ export default function DashboardLayout() {
-
+
diff --git a/frontend/src/layouts/MarketingLayout.jsx b/frontend/src/layouts/MarketingLayout.jsx index 34b0df9..048efa0 100644 --- a/frontend/src/layouts/MarketingLayout.jsx +++ b/frontend/src/layouts/MarketingLayout.jsx @@ -1,12 +1,13 @@ -import { Outlet } from 'react-router-dom'; +import { Outlet, useLocation } from 'react-router-dom'; import Navbar from '../components/Navbar'; import Footer from '../components/Footer'; export default function MarketingLayout() { + const { pathname } = useLocation(); return ( <> -
+
diff --git a/frontend/src/layouts/PublicLayout.jsx b/frontend/src/layouts/PublicLayout.jsx index 7512d1d..6c56909 100644 --- a/frontend/src/layouts/PublicLayout.jsx +++ b/frontend/src/layouts/PublicLayout.jsx @@ -1,2 +1,4 @@ import { Outlet } from 'react-router-dom'; -export default function PublicLayout() { return ; } \ No newline at end of file +export default function PublicLayout() { return
+ +
; } \ No newline at end of file diff --git a/frontend/src/main.jsx b/frontend/src/main.jsx index afa6a7e..68af2f2 100644 --- a/frontend/src/main.jsx +++ b/frontend/src/main.jsx @@ -3,6 +3,7 @@ import { createRoot } from 'react-dom/client' import './index.css' import App from './App.jsx' import { initScrollReveal } from './utils/scrollReveal.js' +import { initMotion } from './utils/motion.js' createRoot(document.getElementById('root')).render( @@ -11,3 +12,4 @@ createRoot(document.getElementById('root')).render( ) initScrollReveal() +initMotion() diff --git a/frontend/src/pages/AdminDashboard.jsx b/frontend/src/pages/AdminDashboard.jsx index 6ad4b2f..a1ebac7 100644 --- a/frontend/src/pages/AdminDashboard.jsx +++ b/frontend/src/pages/AdminDashboard.jsx @@ -11,7 +11,7 @@ export default function AdminDashboard() { const [confirmConfig, setConfirmConfig] = useState({ isOpen: false, title: "", message: "", confirmText: "OK", isDestructive: false, onConfirm: () => {} }); - const [activeTab, setActiveTab] = useState("users"); + // activeTab state removed (unused) const [stats, setStats] = useState({ total_users: 0, pending_personal: 0, pending_business: 0, admins: 0 }); const [bookmarks, setBookmarks] = useState([]); const [users, setUsers] = useState([]); @@ -225,7 +225,7 @@ export default function AdminDashboard() { setSearch(e.target.value)} @@ -233,7 +233,7 @@ export default function AdminDashboard() {
{if(e.target.files[0]) uploadAdminDoc(e.target.files[0])}} /> @@ -1009,18 +986,9 @@ export default function AdminUserDetail() {
{doc.filename}
{doc.tax_year || N/A} - {new Date(doc.uploaded_at).toLocaleDateString()} + {new Date(doc.uploaded_at).toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' })} - {(() => { - const s = doc.review_status || 'pending'; - const cls = s === 'approved' ? 'badge-green' : s === 'rejected' ? 'badge-red' : s === 'sent_for_approval' ? 'badge-blue' : s === 'filed' ? 'badge-green' : 'badge-yellow'; - return ( -
- {s.replace(/_/g,' ').toUpperCase()} - {doc.review_note &&
{doc.review_note}
} -
- ); - })()} +
@@ -1031,7 +999,17 @@ export default function AdminUserDetail() { {doc.bookmarked ? 'star' : 'star_border'} - {doc.review_status !== 'filed' && doc.review_status !== 'approved' && ( + {doc.review_status === 'sent_for_approval' ? ( + + ) : (doc.review_status !== 'filed' && doc.review_status !== 'approved') ? ( + ) : null} + {doc.review_status === 'approved' ? ( + + ) : ( + )} -
@@ -1058,7 +1047,7 @@ export default function AdminUserDetail() { display:'flex', flexDirection:'column', gap:'10px' }}>
- πŸ“€ Send this document to client for review + {doc.review_status === 'sent_for_approval' ? 'πŸ“¨ Resend this document to client for review' : 'πŸ“€ Send this document to client for review'}