diff --git a/.github/workflows/deploy-ec2.yml b/.github/workflows/deploy-ec2.yml
index c7d0216..e0899c2 100644
--- a/.github/workflows/deploy-ec2.yml
+++ b/.github/workflows/deploy-ec2.yml
@@ -4,7 +4,7 @@ env:
IMAGE_NAME: junohub-app
CONTAINER_NAME: junohub-app
# Absolute directory on the EC2 instance where app + compose live
- REMOTE_DIR: /home/ubuntu/JUNOHUB
+ REMOTE_DIR: /home/ubuntu/JUNO
on:
workflow_dispatch:
diff --git a/Documents/DETAIL.md b/Documents/DETAIL.md
new file mode 100644
index 0000000..8d48ad4
--- /dev/null
+++ b/Documents/DETAIL.md
@@ -0,0 +1,350 @@
+## Project Overview
+
+This project JUNO is an **AI-powered communication hub for Shopify-based dropshipping businesses**.
+It focuses on fixing the broken, slow, and inconsistent communication that happens:
+- **From customer to vendor** (the buyer talking to the Shopify store).
+- **From vendor to supplier** (the store owner coordinating with the inventory/fulfilment partner).
+
+The goal is to **automate, standardize, and speed up** these conversations while keeping humans in control for sensitive or high‑risk cases. This document explains the real problems we see in today’s Shopify dropshipping workflows and how our solution addresses them end to end. It is intended as a **high-level narrative and feature breakdown** so a designer can understand the flows and design a clear, compelling standee around them.
+
+---
+
+## The Problem in Shopify Dropshipping
+
+### 1. Fragmented and slow communication
+- **Multiple channels**: Customers contact the vendor via email, Shopify chat, social media DMs, WhatsApp, etc., while the vendor talks to suppliers via email, WhatsApp groups, or proprietary portals.
+- **No unified view**: A vendor often cannot see, in one place, the full story of an order: customer messages, supplier updates, tracking, refunds, and exceptions.
+- **Slow response times**: Vendors manually read every message, look up order data in Shopify or in supplier dashboards, and then type replies. This causes:
+ - Delays in replying to customers.
+ - Delays in sending instructions to suppliers.
+ - Lost sales and poor customer experience.
+
+### 2. High support load and repetitive questions
+- Customers repeatedly ask:
+ - “Where is my order?”
+ - “Can I change my address?”
+ - “When will it ship?”
+ - “Can I return this item?”
+- Vendors must **manually search orders, tracking links, and policies** to answer the same questions again and again.
+- During peak periods (sales, holidays), messages spike and vendors cannot keep up, leading to:
+ - Unanswered tickets.
+ - Angry customers.
+ - Negative reviews and chargebacks.
+
+### 3. Miscommunication between vendor and supplier
+- Vendors depend on suppliers for:
+ - Stock availability and substitutions.
+ - Shipping timelines and carrier issues.
+ - Order modifications (cancellations, address changes, quantity updates).
+ - Returns, refunds, and exchanges.
+- Today this is often handled via:
+ - Unstructured emails or chats.
+ - Messages without clear order references, SKUs, or deadlines.
+ - Language barriers and time zone differences.
+- This leads to:
+ - Wrong items shipped.
+ - Late shipments.
+ - Failed cancellations or address changes.
+ - Confusion about responsibility for refunds or reships.
+
+### 4. No intelligence or prioritization
+- All messages look the same in a generic inbox.
+- **Critical messages** (fraud risk, legal threats, VIP customers, high‑value orders, very angry customers) are not automatically prioritized.
+- Vendors lack:
+ - Automated sentiment analysis.
+ - Intent detection (e.g., “refund request” vs “simple question”).
+ - Smart routing/escalation (e.g., “send this to a human immediately”).
+
+### 5. Lack of consistency and brand tone
+- Different team members reply with different wording and policies.
+- Emotional messages from customers or suppliers may receive emotional, inconsistent responses.
+- There is no system to:
+ - Enforce tone of voice.
+ - Ensure policy‑correct, legally safe replies.
+ - Reuse what worked well in previous successful resolutions.
+
+---
+
+## Our Solution Overview
+
+We introduce a **two-sided AI communication system** tightly integrated with Shopify and the vendor’s suppliers:
+
+- **Side 1: Customer → Vendor**
+ - A dedicated AI assistant reads customer messages, understands intent and mood, fetches data from the database (orders, tracking, policies), and proposes or sends consistent replies on behalf of the vendor.
+
+- **Side 2: Vendor → Supplier**
+ - A second AI assistant reads vendor-side instructions and system events, understands what must be communicated to suppliers, and generates structured, clear messages into a **dedicated vendor–supplier chat system** named **JUNOCHAT**.
+
+Both sides use **trained AI models** tailored to dropshipping language, policies, and edge cases, with human override options and safety checks.
+
+---
+
+## Customer → Vendor Communication
+
+### 1. Inputs and data sources
+For each customer message, our system has access to:
+- **Customer message content** (email, chat, social DM, etc.).
+- **Shopify data**:
+ - Orders linked by email, phone, name, or order ID.
+ - Order status (paid, fulfilled, in transit, delivered).
+ - Tracking information from carriers.
+- **Internal policies**:
+ - Refund and return rules.
+ - Shipping times and regions.
+ - Discount and compensation limits.
+- **Knowledge base**:
+ - Product FAQs.
+ - Size guides, material descriptions, usage instructions.
+
+The system automatically links the incoming message with the most relevant order(s) and context.
+
+### 2. AI model behavior (customer side)
+We use a **trained model** that:
+- **Detects intent**:
+ - Examples: pre‑purchase question, order status request, address change, refund request, cancellation request, complaint, product issue, technical question, generic feedback, spam, etc.
+- **Detects mood/sentiment**:
+ - Examples: happy, neutral, confused, frustrated, angry, urgent, threatening (legal/chargeback).
+- **Understands multi‑turn context**:
+ - Reads past messages in the same thread.
+ - Respects previous promises made to the customer.
+
+Based on intent + mood + context, the model:
+- Fetches required data from the **database** (orders, tracking, policy rules).
+- Generates a **draft response** in the vendor’s tone of voice.
+- Ensures:
+ - Policy compliance (e.g., does not promise unauthorized full refunds).
+ - Factual accuracy based on live data (e.g., correct tracking status).
+
+The response can be:
+- **Automatically sent** for low‑risk, common cases (e.g., standard “where is my order”).
+- **Queued for human review** for higher‑risk or unusual cases (e.g., legal threats, high cart value, repeated complaints).
+
+### 3. Key features for the designer to highlight
+- **Unified inbox**: All customer messages from multiple channels appear in one place, enriched with order data.
+- **Intent + mood labels**: Each conversation is tagged (e.g., “Refund request – Angry – High priority”).
+- **Smart reply suggestions**: The AI proposes ready‑to‑send answers, saving the vendor time.
+- **Auto‑actions**:
+ - Automatically includes links, tracking numbers, or return instructions.
+ - Automatically asks clarifying questions when essential data is missing (e.g., order ID).
+- **Brand‑consistent tone**: Replies follow the store’s style (friendly, professional, etc.).
+
+### 4. Edge cases we handle (customer side)
+- **No matching order found**:
+ - The model asks for additional information (order ID, email) instead of guessing.
+- **Multiple possible orders for the same customer**:
+ - The system clarifies which order the customer is asking about or summarises all relevant orders clearly.
+- **Angry or abusive messages**:
+ - Calm, de‑escalating tone.
+ - Option to auto‑escalate to a human.
+ - Ability to flag for potential fraud or chargeback risk.
+- **Language differences**:
+ - Automatically detects language and responds in the customer’s language (where configured).
+- **Complex policy cases** (e.g., partial refunds, used products, out‑of‑policy requests):
+ - AI applies rules and, if unsure, marks for human approval rather than auto‑committing.
+- **Time‑critical changes** (cancellation/address change before fulfilment):
+ - High‑urgency flag.
+ - Passes structured instructions into the vendor → supplier flow (see next section).
+
+---
+
+## Vendor → Supplier Communication
+
+### 1. Core idea
+The **vendor → supplier side** ensures that what the customer needs (refunds, reships, changes, information) is translated into **clear, actionable, and timely instructions for suppliers**.
+
+Instead of the vendor writing ad‑hoc emails or chat messages, our system:
+- Understands the **vendor’s intent and mood**.
+- Converts that into a **structured, standardized message** to the supplier.
+- Sends it via a **dedicated vendor–supplier chat system** or the supplier’s preferred channel/integration.
+
+### 2. Inputs and data sources
+For each required vendor → supplier communication, we combine:
+- **Vendor actions and messages** inside our system:
+ - Clicking actions like “request cancellation”, “request reship”, “ask for stock confirmation”.
+ - Manual notes or additional comments by the vendor.
+- **Customer side context**:
+ - What the customer requested.
+ - How urgent or time‑sensitive the situation is.
+ - Any promises already made to the customer.
+- **Order and product data**:
+ - Order ID, SKUs, quantities, prices, shipping method.
+ - Tracking IDs and previous supplier updates.
+- **Supplier configuration**:
+ - Time zone and typical response speed.
+ - Preferred language.
+ - Business rules (MOQs, restocking times, RMA process).
+
+### 3. AI model behavior (vendor side)
+We use a **separate AI model** specialized in:
+- **Vendor intent + mood detection**:
+ - Examples: stock inquiry, urgent cancellation, change of address, reshipment request, quality complaint, bulk pricing discussion, general update.
+ - Mood: calm, neutral, urgent, frustrated, high‑severity.
+- **Message generation to suppliers**:
+ - Converts intent into a clear message that contains:
+ - All necessary reference IDs.
+ - Clear requests and deadlines.
+ - Structured bullet points for actions.
+ - Uses suitable tone (firm but professional), regardless of the vendor’s emotional state.
+- **Chat system integration**:
+ - Automatically posts the generated message into the **dedicated vendor–supplier chat** or connected supplier system.
+ - Organizes conversations per order or ticket so everyone sees complete history.
+
+### 4. Key features for the designer to highlight
+- **Dedicated vendor–supplier chat**:
+ - One place to see all messages to and from each supplier, grouped by order.
+- **Automatic message drafting**:
+ - Vendor clicks an action (e.g., “request cancellation”) and the system drafts a supplier message with all required details pre‑filled.
+- **Structured, unambiguous supplier requests**:
+ - No more vague messages like “pls cancel”; instead, clear instructions listing:
+ - Order details.
+ - Items affected.
+ - Requested action (cancel, reship, refund, investigation).
+ - Time constraints.
+- **Two‑way visibility**:
+ - Supplier replies are pulled back into the vendor’s system.
+ - Customer‑facing side is updated based on supplier confirmations (e.g., updated ETAs, reship tracking).
+
+### 5. Edge cases we handle (vendor side)
+- **Multiple suppliers per order**:
+ - The system splits the instructions appropriately and sends them to each relevant supplier.
+- **Backorders and out‑of‑stock situations**:
+ - Supplier response is interpreted by the AI and reflected back into customer‑facing options (e.g., refund vs alternative product).
+- **No response from supplier**:
+ - Automated reminders after configurable time windows.
+ - Escalation markers for the vendor.
+- **Language and time zone differences**:
+ - Messages can be localized; scheduling considers supplier local hours.
+- **Conflicting information**:
+ - If supplier information contradicts existing tracking or data, the system flags it for human review rather than auto‑resolving.
+- **Policy alignment**:
+ - Ensures requests sent to suppliers remain aligned with vendor’s commitment to customers and legal guidelines.
+
+---
+
+## End-to-End Flow: From Customer Message to Supplier Action
+
+At a high level, the journey works like this:
+1. **Customer writes a message** (e.g., “I used the wrong address, please change it”).
+2. The **customer-side AI model**:
+ - Detects intent (address change) and mood (worried/urgent).
+ - Fetches order data and checks fulfilment status.
+3. If the order is not yet shipped:
+ - The AI replies to the customer, acknowledging the request and explaining the next steps.
+ - At the same time, it triggers a **vendor → supplier action** to update the address.
+4. The **vendor-side AI model**:
+ - Crafts a precise update request to the supplier with the new address and delivery instructions.
+ - Sends it through the dedicated vendor–supplier chat.
+5. **Supplier responds** (e.g., “address updated successfully” or “too late, package shipped”).
+6. The system:
+ - Updates internal status.
+ - Notifies the customer with an accurate outcome, again via the customer-side AI assistant.
+
+Throughout this flow:
+- **All actions are logged and auditable**.
+- **Humans can override or adjust AI decisions**.
+- **Customers receive quick, consistent, data‑driven replies**.
+- **Suppliers receive clear, actionable instructions**, reducing errors and back‑and‑forth.
+
+---
+
+## Vendor Onboarding Journey
+
+This section explains the **actual onboarding flow implemented in JUNO** for a new vendor, based directly on the signup screens, onboarding wizard, and backend routes.
+
+### Step 0: Create a Vendor Account
+- The user goes to the signup page and chooses the **VENDOR** role (or signs in with Google where the callback leads to onboarding).
+- After registration and login:
+ - If the user is a vendor **without any store that has `onboardingComplete = true`**, they are sent to the **multi‑step onboarding wizard** at the `/onboarding` route.
+ - If they already have at least one fully onboarded store, they are redirected straight to the **dashboard** instead of seeing onboarding again.
+
+### Step 1: Business Profile (Business Info)
+- In the first step of the onboarding wizard, the vendor fills in basic business details:
+ - **Business name** (public name of the brand).
+ - **Business email** (main contact address).
+ - **Country**.
+ - **Timezone**.
+- This information is stored with the store record and is used to:
+ - Pre‑fill communication details.
+ - Align timestamps and reporting with the vendor’s local time.
+
+### Step 2: Connect Shopify (Store + Credentials)
+- In the second step, the vendor connects their **Shopify store** by entering:
+ - **Shopify store name**.
+ - **Shopify domain** (e.g., `mystore.myshopify.com`, which the backend cleans and normalizes).
+ - **Admin API Key**.
+ - **Admin API Secret**.
+ - **Admin Access Token**.
+- When the vendor clicks the validation button:
+ - The client calls the **Shopify validation endpoint** with these values.
+ - If required fields (domain and access token) are missing or the credentials are invalid, the UI shows a clear error and **does not proceed to the next step**.
+ - On success, the wizard moves the vendor forward, ensuring that only a verified Shopify connection continues in the flow.
+
+### Step 3: Sync & Fulfilment Preferences
+- In the third step, the vendor configures preferences that control how JUNO interacts with Shopify and suppliers:
+ - **Sync frequency** for pulling Shopify data (options like real‑time, hourly, or daily).
+ - A toggle for **automated fulfilment** (whether new orders should be automatically pushed to suppliers).
+- These options become part of the onboarding payload so that, when the account is finalized, the backend knows:
+ - How aggressively to sync data.
+ - Whether to immediately trigger supplier workflows for new orders.
+
+### Step 4: Finalize and Persist Onboarding
+- In the final step, the vendor submits all onboarding data:
+ - The frontend sends the collected fields (business info, Shopify details, preferences) to the **`/api/onboarding/complete`** endpoint.
+- On the backend:
+ - The system checks authentication and ensures the user is valid.
+ - It validates the critical fields (e.g., business name, domain, access token).
+ - It **cleans the Shopify domain** (removing protocol, trailing slashes, and whitespace).
+ - It then either:
+ - **Updates an existing store** for this user + domain, or
+ - **Creates a new store record** if one does not exist yet.
+ - The store is saved with:
+ - Business name + email.
+ - Country + timezone (or sensible defaults).
+ - Shopify store name + normalized domain.
+ - Admin API key, secret, and access token.
+ - Onboarding flags:
+ - `onboardingComplete = true`.
+ - `isActive` set for the first store.
+ - If this is the **first store** for the vendor:
+ - The user’s `activeStoreId` is updated to point to this new store.
+ - The backend also **registers Shopify webhooks** for events such as:
+ - `orders/create` and `orders/updated`.
+ - `products/create`, `products/update`, `products/delete`.
+ - These webhooks are pointed to the correct app URL so JUNO can receive live updates from Shopify.
+- Once the API call succeeds:
+ - The UI shows a **“Setup Complete”** screen.
+ - The vendor is then redirected to the **dashboard**, where syncing and AI‑driven workflows take over.
+
+### Multi‑Store and Onboarding Checks
+- A vendor can have **multiple Shopify stores** under one JUNO account:
+ - Each store is stored separately with its own domain, credentials, and `onboardingComplete` flag.
+ - Additional store connections use a streamlined Shopify onboarding flow that collects the same core fields and persists another store record.
+- The **`/api/onboarding/check`** endpoint is used to:
+ - Confirm if a vendor already has at least one fully onboarded store.
+ - Skip the onboarding wizard for non‑vendor roles (e.g., suppliers) by immediately marking them as complete.
+
+---
+
+## What the Designer Should Take Away
+
+- **Core message**: We fix broken communication in Shopify dropshipping by using AI on both sides:
+ - **Customer → Vendor**: Intelligent support assistant for customer messages.
+ - **Vendor → Supplier**: Intelligent coordination assistant for supplier communication.
+ - **Vendor Onboarding**: A concrete, four‑step wizard (business profile → Shopify connection → sync/fulfilment preferences → finalize) backed by real API endpoints and webhook setup.
+- **Key benefits to visualize**:
+ - Faster replies, fewer mistakes, less manual typing.
+ - Happier customers (clear answers, faster resolutions).
+ - Happier vendors (less support load, more control).
+ - Happier suppliers (clear, structured instructions).
+- **Feel of the product**:
+ - Central, unified communication hub.
+ - AI co‑pilot on both ends of the chain.
+ - Human‑in‑the‑loop safety for sensitive cases.
+ - Smooth onboarding path from day one to full automation.
+
+This document should provide enough depth to design a standee that clearly shows:
+- The **two main flows** (customer → vendor and vendor → supplier).
+- The **vendor onboarding journey** from connect → configure → automate.
+- The **before vs. after** pain points and improvements.
+- The **AI‑powered, data‑aware, and automated nature** of the solution.
+
diff --git a/Documents/GMAIL_SETUP.md b/Documents/GMAIL_SETUP.md
deleted file mode 100644
index 9ec4336..0000000
--- a/Documents/GMAIL_SETUP.md
+++ /dev/null
@@ -1,164 +0,0 @@
-# Gmail Integration Setup Guide
-
-This guide explains how to set up Gmail integration so that **every vendor can connect their own Gmail account** to receive and send customer emails.
-
-## How It Works
-
-- **One OAuth App**: You create ONE Google OAuth application in Google Cloud Console
-- **Shared Credentials**: All vendors use the same `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET`
-- **Individual Authorization**: Each vendor authorizes their own Gmail account when connecting
-- **Separate Tokens**: Each vendor's Gmail tokens are stored separately in the database
-
-## Login Method vs Gmail Integration
-
-**IMPORTANT**: These are TWO separate things:
-
-1. **Login Method** (How vendor logs into YOUR app):
- - Email/Password login ✅
- - Google OAuth login ✅
- - Both work independently
-
-2. **Gmail Integration** (Authorizing Gmail API access):
- - Separate OAuth flow
- - Works regardless of login method
- - Vendor can connect ANY Gmail account (doesn't need to match login email)
-
-### Example Scenarios:
-
-**Scenario 1**: Vendor logs in with email/password (`talatfaheem2@gmail.com`)
-- ✅ Can connect Gmail integration
-- When clicking "Connect Gmail", they'll be redirected to Google OAuth
-- Can authorize the same Gmail (`talatfaheem2@gmail.com`) OR a different one (`business@gmail.com`)
-
-**Scenario 2**: Vendor logs in with Google OAuth (`talatfaheem2@gmail.com`)
-- ✅ Can connect Gmail integration
-- When clicking "Connect Gmail", they'll be redirected to Google OAuth again
-- Can authorize the same Gmail (`talatfaheem2@gmail.com`) OR a different one (`business@gmail.com`)
-
-**Key Point**: The Gmail account they authorize doesn't need to match their login email!
-
-## Step-by-Step Setup
-
-### 1. Create Google Cloud Project (One Time Setup)
-
-1. Go to [Google Cloud Console](https://console.cloud.google.com/)
-2. Create a new project (or select existing)
-3. Enable **Gmail API**:
- - Go to [APIs & Services > Library](https://console.cloud.google.com/apis/library)
- - Search for "Gmail API"
- - Click "Enable"
-
-### 2. Create OAuth 2.0 Credentials
-
-1. Go to [APIs & Services > Credentials](https://console.cloud.google.com/apis/credentials)
-2. Click "Create Credentials" > "OAuth client ID"
-3. **If prompted**, configure OAuth consent screen (Google will prompt you the first time):
- - Choose "External" (unless you have Google Workspace)
- - Fill in app name, support email, developer contact
- - **Note**: You don't need to manually add scopes here - they're automatically requested when vendors connect
- - **IMPORTANT**: Add test users - Add ALL Gmail addresses that will connect (e.g., `krypttech4@gmail.com`, `talatfaheem2@gmail.com`, etc.)
- - Click "Save and Continue" through the steps
-
- **OR if consent screen is already configured:**
- - Go to [APIs & Services > OAuth consent screen](https://console.cloud.google.com/apis/credentials/consent)
- - Scroll down to "Test users" section
- - Click "+ ADD USERS"
- - Add the Gmail addresses that will connect (one per line or comma-separated)
- - Click "Add"
-4. Create OAuth client:
- - Application type: "Web application"
- - Name: "JunoHub Gmail Integration" (or your choice)
- - **Authorized redirect URIs** (CRITICAL - must match exactly):
- ```
- http://localhost:3000/api/integrations/gmail/callback
- https://your-production-domain.com/api/integrations/gmail/callback
- ```
- - If using ngrok: `https://your-ngrok-url.ngrok-free.dev/api/integrations/gmail/callback`
- - **Important**: Add ALL environments you'll use (dev, staging, production, ngrok URLs)
-
-### 3. Configure Environment Variables
-
-Add to your `.env` file:
-
-```env
-# Your Google Cloud OAuth credentials (shared for all vendors)
-GOOGLE_CLIENT_ID="your-client-id-here.apps.googleusercontent.com"
-GOOGLE_CLIENT_SECRET="your-client-secret-here"
-
-# Your app URL (used for OAuth redirects)
-NEXTAUTH_URL="http://localhost:3000" # or your production URL
-```
-
-### 4. Test the Integration
-
-1. Start your application
-2. Log in as a vendor
-3. Go to Juno Engine > Gmail Connect
-4. Click "Connect Gmail Account"
-5. Sign in with **any Gmail account** (doesn't need to match the OAuth app owner)
-6. Authorize the requested permissions
-7. You should be redirected back and see "Gmail Connected"
-
-## Troubleshooting
-
-### Error: `redirect_uri_mismatch`
-
-**Problem**: The redirect URI in your code doesn't match what's configured in Google Cloud Console.
-
-**Solution**:
-1. Check the error message - it will show the redirect URI being used
-2. Go to Google Cloud Console > Credentials > Your OAuth Client
-3. Add the exact redirect URI shown in the error to "Authorized redirect URIs"
-4. Wait a few minutes for changes to propagate
-5. Try again
-
-### Error: `invalid_client`
-
-**Problem**: The `GOOGLE_CLIENT_ID` or `GOOGLE_CLIENT_SECRET` is incorrect.
-
-**Solution**:
-1. Double-check your `.env` file
-2. Make sure there are no extra spaces or quotes
-3. Restart your application after changing `.env`
-
-### Error: `access_denied` or "Access blocked: has not completed the Google verification process"
-
-**Problem**: The OAuth app is in "Testing" mode and the user's Gmail address is not added as a test user.
-
-**Solution**:
-1. Go to [APIs & Services > OAuth consent screen](https://console.cloud.google.com/apis/credentials/consent)
-2. Scroll down to "Test users" section
-3. Click "+ ADD USERS"
-4. Add the Gmail address that's trying to connect (e.g., `krypttech4@gmail.com`)
-5. Click "Add"
-6. Wait a few minutes for changes to propagate
-7. Try connecting again
-
-**Note**: In testing mode, you must add each Gmail address as a test user. For production, you'll need to publish your app (requires Google verification).
-
-## Important Notes
-
-- **OAuth Consent Screen**: Google will prompt you to configure this the FIRST time you create OAuth credentials. After that, you can skip it. The scopes are automatically requested in the OAuth flow - you don't need to manually add them in the consent screen.
-- **OAuth App Owner**: The email that created the OAuth app (`i221735@nu.edu.pk`) doesn't matter. Any Gmail account can authorize access.
-- **Vendor Gmail**: Each vendor connects their own Gmail account (`talatfaheem2@gmail.com`, etc.). They don't need their own OAuth credentials.
-- **Redirect URI**: Must match EXACTLY (including protocol, domain, port, path). No trailing slashes.
-- **Multiple Environments**: Add redirect URIs for all environments (localhost, staging, production, ngrok).
-
-## Security Considerations
-
-- OAuth tokens are stored securely in the database
-- Each vendor's tokens are isolated (can't access each other's emails)
-- Tokens are automatically refreshed when expired
-- Vendors can disconnect their Gmail at any time
-
-## Production Checklist
-
-- [ ] Gmail API enabled in Google Cloud Console
-- [ ] OAuth consent screen configured
-- [ ] **Test users added** (for testing mode) - Add all Gmail addresses that will connect
-- [ ] OAuth client created with correct redirect URIs
-- [ ] Environment variables set (`GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`, `NEXTAUTH_URL`)
-- [ ] Database migration run (`prisma db push`)
-- [ ] Tested with at least one vendor account
-- [ ] Production redirect URI added to Google Cloud Console
-- [ ] **For production**: Publish your app (requires Google verification) OR keep adding test users as needed
diff --git a/Documents/GMAIL_WEBHOOK_SETUP.md b/Documents/GMAIL_WEBHOOK_SETUP.md
deleted file mode 100644
index 38ecabc..0000000
--- a/Documents/GMAIL_WEBHOOK_SETUP.md
+++ /dev/null
@@ -1,154 +0,0 @@
-# Gmail Webhook Setup Guide
-
-This guide explains how to set up automatic email detection and AI-powered replies using Gmail push notifications.
-
-## Overview
-
-When a customer sends an email to your Gmail account, Gmail will send a push notification to our webhook endpoint. The webhook then:
-1. Fetches the incoming email
-2. Analyzes it using your store's knowledge base
-3. Generates an AI-powered reply
-4. Sends the reply automatically
-
-## Prerequisites
-
-1. **Gmail Integration**: Your Gmail account must be connected via `/dashboard/juno-engine/gmail-connect`
-2. **Knowledge Base**: Your store must have FAQs or documents in the knowledge base
-3. **Google Cloud Pub/Sub**: Required for Gmail push notifications
-
-## Step 1: Set Up Google Cloud Pub/Sub
-
-Gmail push notifications require Google Cloud Pub/Sub. Follow these steps:
-
-### 1.1 Create a Pub/Sub Topic
-
-1. Go to [Google Cloud Console](https://console.cloud.google.com/)
-2. Navigate to **Pub/Sub** > **Topics**
-3. Click **Create Topic**
-4. Name it `gmail-notifications` (or any name you prefer)
-5. Click **Create**
-
-### 1.2 Create a Subscription
-
-1. In the topic page, click **Create Subscription**
-2. Name it `gmail-webhook-subscription`
-3. Choose **Push** delivery type
-4. Set the **Endpoint URL** to: `https://yourdomain.com/api/webhooks/gmail`
- - Replace `yourdomain.com` with your actual domain
- - For local development with ngrok: `https://your-ngrok-url.ngrok-free.dev/api/webhooks/gmail`
-5. Click **Create**
-
-### 1.3 Grant Gmail API Access
-
-1. Go to **IAM & Admin** > **Service Accounts**
-2. Find or create a service account for Gmail API
-3. Grant it the `pubsub.topics.publish` permission on your topic
-
-### 1.4 Get Topic Name
-
-Copy the full topic name in the format:
-```
-projects/YOUR_PROJECT_ID/topics/gmail-notifications
-```
-
-## Step 2: Configure Environment Variables
-
-Add the Pub/Sub topic name to your `.env` file:
-
-```env
-GMAIL_PUBSUB_TOPIC=projects/YOUR_PROJECT_ID/topics/gmail-notifications
-```
-
-## Step 3: Enable Gmail Watch
-
-Once Pub/Sub is set up, enable Gmail push notifications:
-
-### Option A: Via API
-
-Make a POST request to:
-```
-POST /api/integrations/gmail/watch
-```
-
-This will set up Gmail to send push notifications to your webhook.
-
-### Option B: Via UI (Recommended)
-
-Add a button in the Gmail connect page to enable webhooks (coming soon).
-
-## Step 4: Verify Webhook
-
-Gmail will send a verification request to your webhook endpoint. The endpoint automatically handles verification by returning the challenge token.
-
-## How It Works
-
-### Webhook Flow
-
-1. **Customer sends email** → Gmail receives it
-2. **Gmail sends push notification** → Webhook endpoint receives notification
-3. **Webhook processes email**:
- - Fetches the email content
- - Extracts sender, subject, and body
- - Searches knowledge base for relevant information
- - Generates AI-powered reply using Bedrock
-4. **Reply is sent** → Customer receives automated response
-5. **Email is marked as read** → Prevents duplicate processing
-
-### Email Processing Logic
-
-- Only processes emails from external senders (not same domain)
-- Uses knowledge base to find relevant answers
-- Generates contextual replies using AI
-- Maintains email threading (replies are properly threaded)
-- Logs all sent emails for tracking
-
-## Monitoring
-
-Check logs for:
-- Webhook notifications received
-- Emails processed
-- Replies sent
-- Any errors during processing
-
-## Troubleshooting
-
-### Webhook Not Receiving Notifications
-
-1. Verify Pub/Sub topic exists and is configured correctly
-2. Check that Gmail watch is active (watch expires after 7 days)
-3. Verify webhook URL is accessible (not behind firewall)
-4. Check Google Cloud Console logs for Pub/Sub errors
-
-### Replies Not Being Sent
-
-1. Verify Gmail integration is connected
-2. Check that store has active knowledge base content
-3. Review error logs for specific issues
-4. Ensure Bedrock API credentials are configured
-
-### Watch Expired
-
-Gmail watch requests expire after 7 days. You need to renew them:
-- Call `/api/integrations/gmail/watch` again
-- Or set up a cron job to renew automatically
-
-## Security
-
-- Webhook endpoint verifies Gmail notifications
-- Only processes emails for authenticated users
-- Validates store ownership before processing
-- Logs all actions for audit trail
-
-## Limitations
-
-- Gmail watch expires after 7 days (needs renewal)
-- Only processes unread emails in inbox
-- Requires active knowledge base for quality replies
-- May have rate limits from Gmail API
-
-## Next Steps
-
-- Set up automatic watch renewal (cron job)
-- Add email filtering rules (only reply to certain senders)
-- Implement reply templates
-- Add analytics dashboard for email metrics
diff --git a/Documents/REMOVE_OAUTH_WARNING.md b/Documents/REMOVE_OAUTH_WARNING.md
deleted file mode 100644
index dd5b9c1..0000000
--- a/Documents/REMOVE_OAUTH_WARNING.md
+++ /dev/null
@@ -1,154 +0,0 @@
-# How to Remove "Google hasn't verified this app" Warning
-
-## Quick Answer
-
-The warning appears because your app requests **Gmail scopes** which are sensitive/restricted and require Google verification. You have 3 options:
-
-## Option 1: Keep in Testing Mode (Easiest - For Development)
-
-**Best for**: Development, testing, or apps with fewer than 100 users
-
-### Steps:
-1. Go to [Google Cloud Console > OAuth consent screen](https://console.cloud.google.com/apis/credentials/consent)
-2. Click **"Back to testing"** button (if your app is currently "In production")
-3. Add all Gmail addresses as **test users**:
- - Scroll to "Test users" section
- - Click "+ ADD USERS"
- - Add each Gmail address (one per line)
- - Click "Add"
-4. Save changes
-
-### Result:
-- ✅ Test users won't see the warning
-- ✅ Can connect Gmail without verification
-- ❌ Limited to 100 test users
-- ❌ Must manually add each user
-
----
-
-## Option 2: Get Google Verification (For Production)
-
-**Best for**: Production apps that need to scale beyond 100 users
-
-### Prerequisites:
-Before starting verification, you need:
-
-1. **Privacy Policy** (Required)
- - Must be publicly accessible URL
- - Must explain how you use Gmail data
- - Example: `https://yourdomain.com/privacy-policy`
-
-2. **Terms of Service** (Required)
- - Must be publicly accessible URL
- - Example: `https://yourdomain.com/terms`
-
-3. **App Homepage** (Required)
- - Your app's main website URL
- - Example: `https://yourdomain.com`
-
-4. **Authorized Domains**
- - Add your production domain
- - Example: `yourdomain.com`
-
-### Verification Steps:
-
-1. **Go to Verification Center**:
- - [OAuth consent screen](https://console.cloud.google.com/apis/credentials/consent)
- - Click "Verification Center" in left sidebar
- - Or go directly: [Verification Center](https://console.cloud.google.com/apis/credentials/consent/verification)
-
-2. **Start Verification**:
- - Click "Start Verification" or "Submit for verification"
- - Fill out the verification form
-
-3. **Complete Verification Form**:
- - **App name**: Your app name (e.g., "JunoHub")
- - **Support email**: Your support email address
- - **App domain**: Your production domain
- - **Authorized domains**: Add your domain
- - **Scopes**: Gmail scopes will be automatically listed
- - **Privacy Policy URL**: Your privacy policy URL
- - **Terms of Service URL**: Your terms of service URL
- - **App homepage**: Your app's homepage URL
- - **App logo**: Optional but recommended
-
-4. **Additional Information** (may be requested):
- - **Video demonstration**: Show how your app uses Gmail
- - **Use case explanation**: Why you need Gmail access
- - **Data handling**: How you store/process Gmail data
-
-5. **Submit for Review**:
- - Review all information
- - Submit the form
- - Google will review (typically 4-6 weeks)
-
-### After Verification:
-- ✅ Warning disappears for ALL users
-- ✅ No user limit
-- ✅ Can request sensitive/restricted scopes
-- ✅ Professional appearance
-
----
-
-## Option 3: Use Domain-Wide Delegation (Advanced - For Google Workspace)
-
-**Best for**: Google Workspace organizations only
-
-If you're using Google Workspace, you can use domain-wide delegation instead of OAuth, but this requires admin access and is more complex.
-
----
-
-## Current Status Check
-
-Based on your Google Cloud Console screenshot:
-- ✅ App is "In production"
-- ✅ User type is "External"
-- ⚠️ OAuth user cap: 0/100 users
-- ⚠️ Warning appears because Gmail scopes are unapproved
-
-## Recommended Action
-
-**For now (Development/Testing)**:
-1. Click "Back to testing" in OAuth consent screen
-2. Add test users (your vendors' Gmail addresses)
-3. Test users won't see the warning
-
-**For later (Production)**:
-1. Create Privacy Policy and Terms of Service pages
-2. Submit app for Google verification
-3. Wait for approval (4-6 weeks)
-4. Warning will disappear automatically
-
----
-
-## Privacy Policy Template (Gmail Data Usage)
-
-Your Privacy Policy must mention Gmail data usage. Example section:
-
-```markdown
-## Gmail Integration
-
-When you connect your Gmail account to [Your App Name], we access:
-- Read emails: To sync customer emails and create support tickets
-- Send emails: To send automated responses and notifications
-- Modify emails: To manage email threads and mark emails as read
-
-We store:
-- OAuth tokens (encrypted) for Gmail API access
-- Email addresses for account identification
-
-We do NOT:
-- Store email content permanently
-- Share your emails with third parties
-- Access emails outside of the app's functionality
-
-You can revoke access at any time by disconnecting Gmail in your account settings.
-```
-
----
-
-## Need Help?
-
-- [Google OAuth Verification Guide](https://support.google.com/cloud/answer/9110914)
-- [OAuth Consent Screen Documentation](https://developers.google.com/identity/protocols/oauth2/policy)
-- [Gmail API Scopes Documentation](https://developers.google.com/gmail/api/auth/scopes)
diff --git a/Documents/STANDEE_GUIDELINES.md b/Documents/STANDEE_GUIDELINES.md
new file mode 100644
index 0000000..6692716
--- /dev/null
+++ b/Documents/STANDEE_GUIDELINES.md
@@ -0,0 +1,178 @@
+### Standee Technical Setup (For the Designer)
+
+This document defines the **exact technical and visual setup** for the JUNO FYP standee so the designer can produce a print-ready PSD that matches both **university requirements** and **project branding**.
+
+---
+
+## 1. Technical Specifications
+
+- **Dimensions**: 24" width × 60" height (**portrait** orientation)
+- **Resolution**: **330 DPI**
+- **File Type**: **PSD** (Adobe Photoshop source file)
+- **Design Tools**:
+ - Use **Adobe Photoshop** or **Adobe Illustrator**
+ - **Strictly no Canva**
+- **Color Palette**:
+ - **Deep Navy**: `#0B0D17` (primary background)
+ - **Electric Indigo**: `#5842FF` (primary accent)
+ - **Neon Purple**: `#A230FF` (secondary accent / highlight)
+
+Use gradients and glassmorphism effects based on these three core colors.
+
+---
+
+## 2. Section 1 – The Academic Header (Mandatory)
+
+This is the **top band** of the standee and must respect academic branding rules.
+
+- **Top Left**:
+ - **FAST-NUCES Logo** (clean version, **no Ayah**)
+ - Ensure the logo is high-resolution and not stretched.
+
+- **Top Center**:
+ - **Project Title (Largest Font)**:
+ - Text: **JUNO**
+ - This should be the **most prominent text** on the header.
+
+- **Top Right**:
+ - **Supervisor**:
+ - Format: `Supervisor: Dr./Mr./Engr. [Full Name]`
+ - **Team** (directly below supervisor line):
+ - Format:
+ `Team: [Name 1 – Roll No], [Name 2 – Roll No], ...`
+
+- **Main Headline (Below Header Bar)**:
+ - Place this just under the header strip, centered across the standee:
+ - Text:
+ **"The Pulse of Global Commerce: AI-Powered Shopify Communication"**
+
+Use a slightly smaller size than the JUNO title, but still bold and easily readable from ~5 feet.
+
+---
+
+## 3. Section 2 – Problem vs. Solution (Chaos → Control Flow)
+
+This is the **hero visual area** of the standee. Divide it into **two vertical or diagonally slanted panes** to show the transition from chaos to control.
+
+### Left Side – “The Communication Gap” (The Chaos)
+
+- **Label**:
+ - **"The Communication Gap"**
+- **Visual Style**:
+ - Darker background using **Deep Navy** with red/orange accents.
+ - Use **tangled lines** or messy connectors between bubbles to show disorganization.
+- **Notification Bubbles (examples)**:
+ - “Where is my order?”
+ - “Wrong Address!”
+ - “Supplier hasn’t replied.”
+- **Supporting Text (Bullets)**:
+ - **Fragmented Channels**
+ - **Slow Response Times**
+
+Keep text minimal; this side should visually feel **stressful and cluttered**.
+
+### Right Side – “The JUNO Standard” (The Control)
+
+- **Label**:
+ - **"The JUNO Standard"**
+- **Visual Style**:
+ - Clean, bright **indigo gradient** background (Electric Indigo + Neon Purple).
+ - Use **glassmorphism**: translucent panels with blur and subtle borders.
+- **Dashboard Mockup (Key Highlights)**:
+ - **Unified Inbox**:
+ - Visual: single clean inbox pane.
+ - Caption: *“Orders linked to messages.”*
+ - **Smart Labels**:
+ - Example label: *“Refund Request – Angry”* with an obvious “AI tag / chip”.
+ - Emphasize AI-detected **intent and mood**.
+ - **JUNOCHAT Panel**:
+ - Show structured supplier instructions:
+ - Order ID
+ - Item(s)
+ - Clear requested action (e.g., “Reship”)
+ - Priority / deadline
+ - Caption: *“Structured, unambiguous supplier instructions.”*
+
+This side should feel **calm, controlled, and futuristic**, clearly opposite to the left side.
+
+---
+
+## 4. Section 3 – Core Value Pillars (“How It Works”)
+
+Use the **three-column card layout** from your existing UI/theme. Each column is a **card** with a small icon, title, and one-line description.
+
+| **For Vendors** | **The AI Hub** | **For Suppliers** |
+|------------------------------|----------------------------|--------------------------------------|
+| **Automated Fulfillment** | **Intent Intelligence** | **Structured Coordination** |
+| Real-time sync of Shopify orders to suppliers instantly. | AI detects mood and intent to prevent chargebacks. | No more vague emails; just clear, actionable data. |
+
+Design notes:
+- Cards should use **glassmorphic panels** with Electric Indigo / Neon Purple highlights.
+- Icons should be simple and tech-forward (e.g., truck/order icon, brain/AI icon, network/flow icon).
+
+---
+
+## 5. Section 4 – Tech Stack & Onboarding
+
+This is a **smaller informational band**, likely below the value pillars.
+
+### 5.1 Technologies Used
+
+Use **small, clean icons** beside short labels. Suggested entries:
+
+- **Shopify API**
+- **OpenAI / LLMs**
+- **React / Node.js**
+- **Webhooks**
+
+Keep this to one line or a compact grid—avoid long descriptions.
+
+### 5.2 Onboarding Journey (Horizontal Timeline)
+
+Show a **3-step horizontal timeline** with minimal text:
+
+1. **Connect** – Secure Shopify API Sync.
+2. **Configure** – Set Sync & Fulfillment Preferences.
+3. **Automate** – AI-driven workflows go live.
+
+Visually, each step can be a small node with a short label and icon.
+
+---
+
+## 6. Section 5 – Footer & Engagement
+
+This is the **bottom band** of the standee, driving interaction.
+
+- **Main Tagline**:
+ - Text:
+ **"Everything you need to dominate the market"**
+ - Centered or slightly left-aligned above the QR and buttons.
+
+- **QR Code**:
+ - Place a **large, branded QR code** in the **bottom right corner**.
+ - Label under/next to it:
+ - **"Scan for Live Demo/Project Details"**
+
+- **Role Call-to-Action (Mock Buttons)**:
+ - Use **button-style graphics** (not real buttons) to show the two sides of the platform:
+ - **Sign Up as Vendor**
+ - **Sign Up as Supplier**
+ - Place these near the QR code or centered above it, clearly indicating it is a **two-sided marketplace**.
+
+---
+
+## 7. Important Instructions for the Designer
+
+- **Readability**:
+ - Ensure the **project title** (`JUNO`) and **core value pillars** are clearly readable from at least **5 feet away**.
+ - Avoid overly thin fonts for key headings.
+
+- **Visuals Over Text**:
+ - Prioritize **dashboard screen captures**, **AI icons**, and **simple diagrams** over paragraphs.
+ - All descriptions should be **1–2 short lines** only.
+
+- **Consistency & Branding**:
+ - Use the specified **indigo gradient** and **glassmorphism** (transparency + blur + soft borders) to match app screenshots and maintain brand identity.
+ - Keep spacing, corner radii, and typography style consistent across all cards and panels.
+
+The goal is a standee that is **instantly scannable, visually premium, and clearly communicates JUNO’s value** to both vendors and suppliers.
diff --git a/Documents/faq_test.json b/Documents/faq_test.json
deleted file mode 100644
index 4218305..0000000
--- a/Documents/faq_test.json
+++ /dev/null
@@ -1,28 +0,0 @@
-[
- {
- "question": "What is your standard order processing time?",
- "answer": "Orders are typically processed within 1–2 business days. During peak seasons, processing may take up to 3 business days.",
- "tags": ["orders", "shipping", "processing_time"]
- },
- {
- "question": "How long does shipping usually take?",
- "answer": "Standard shipping within the US takes 3–7 business days after the order has been processed. International shipping can take 7–21 business days depending on the destination and carrier.",
- "tags": ["shipping", "delivery"]
- },
- {
- "question": "What is your return policy?",
- "answer": "You can return most items within 30 days of delivery in their original condition for a full refund. Items marked as final sale are not eligible for returns.",
- "tags": ["returns", "refunds", "policy"]
- },
- {
- "question": "How do I start a return?",
- "answer": "To start a return, go to your Orders page, select the order you want to return, and click \"Request Return\". Our team will email you a prepaid return label and instructions within 24 hours.",
- "tags": ["returns", "how_to"]
- },
- {
- "question": "Can I change or cancel my order after placing it?",
- "answer": "Orders can be changed or canceled within 1 hour of placement. After that, we start processing and cannot guarantee changes. Please contact support as soon as possible with your order number.",
- "tags": ["orders", "changes", "cancellations"]
- }
-]
-
diff --git a/Documents/suggestiondesign.md b/Documents/suggestiondesign.md
new file mode 100644
index 0000000..62f7ff8
--- /dev/null
+++ b/Documents/suggestiondesign.md
@@ -0,0 +1,136 @@
+### Standee Concept: “Chaos to Control”
+
+This concept is designed to be **high-impact** and instantly relatable to both **Vendor** and **Supplier** personas, visually contrasting the “old way” of dropshipping operations with **The JUNO Way**.
+
+---
+
+## Top Header
+
+- **Main Headline**:
+ **SCALE YOUR REACH. SIMPLIFY YOUR SUPPLY.**
+
+Position this prominently at the top of the standee, above the split-screen section, with strong, bold typography.
+
+---
+
+## Split-Screen Comparison (Problem vs Solution)
+
+Use a **left/right split** to immediately show “before vs after”.
+
+### Left Side – The Problem (“The Old Way”)
+
+- **Visual Style**:
+ - Darker, slightly noisy / cluttered background.
+ - Red or orange accents to convey stress and urgency.
+- **Notification Bubbles** (examples):
+ - “Where is my order?”
+ - “Wrong Address!”
+ - “Supplier hasn’t replied.”
+- **Label / Tagline**:
+ - **Fragmented & Slow**
+- **Overall Feel**:
+ - Chaotic, multiple channels, unclear ownership, lots of manual work.
+
+### Right Side – The Solution (“The JUNO Way”)
+
+- **Visual Style**:
+ - Bright, clean, glowing **indigo** background.
+ - Futuristic but minimal UI elements.
+- **Dashboard Mockup (Key Elements)**:
+ - **Unified Inbox**:
+ - Messages and orders are visually connected.
+ - Example annotation: *“Orders linked to messages automatically.”*
+ - **Smart Labels**:
+ - Tag examples:
+ “Refund Request – Angry – High Priority”
+ - Emphasize AI-driven mood + intent detection.
+ - **JUNOCHAT Panel**:
+ - Show a clear, structured reshipment request:
+ - Order reference
+ - Items
+ - Action: “Reship”
+ - Deadline / priority
+ - Callout text: *“Clear, structured reshipment requests.”*
+- **Label / Tagline**:
+ - **Connected & Controlled**
+
+---
+
+## Middle Section – Core Value Pillars
+
+Use a **three-column card layout**, consistent with your existing UI/theme.
+
+Each card should have:
+- An icon or small illustration.
+- A short title.
+- 1–2 lines of supporting text.
+
+### Card 1 – For Vendors
+
+- **Title**: **Automated Fulfillment**
+- **Subtitle / Description**:
+ - “Sync Shopify orders to suppliers instantly.”
+ - Emphasize reduced manual work and faster response time.
+
+### Card 2 – The AI Hub
+
+- **Title**: **Intent Intelligence**
+- **Subtitle / Description**:
+ - “AI detects mood and promises to prevent chargebacks.”
+ - Highlight:
+ - Intent detection
+ - Sentiment/mood analysis
+ - Policy-aware responses that reduce disputes
+
+### Card 3 – For Suppliers
+
+- **Title**: **Structured Coordination**
+- **Subtitle / Description**:
+ - “No more vague emails; just actionable data.”
+ - Emphasize:
+ - Clear order references
+ - Standardized requests
+ - Less back-and-forth
+
+---
+
+## Footer Area
+
+The footer should reinforce the overall promise and invite action.
+
+### Tagline
+
+- **Text**:
+ **Everything you need to dominate the market**
+
+Place this as a bold line above the QR and buttons.
+
+### QR Code
+
+- Large, branded **QR code** in one bottom corner (e.g., bottom-right).
+- Label near the QR, e.g.:
+ - “Scan to book a demo”
+ - or “Scan to explore JUNO”
+
+### Call-to-Action Buttons (Visual Only)
+
+Use button-style graphics to show that JUNO is a **two-sided marketplace**:
+
+- **Button 1**:
+ **Sign Up as Vendor**
+- **Button 2**:
+ **Sign Up as Supplier**
+
+These are **mock-up UI buttons** on the standee (not functional), but they visually communicate:
+- There are dedicated paths for both vendors and suppliers.
+- JUNO serves the entire chain from **customer → vendor → supplier**.
+
+---
+
+## Overall Design Notes
+
+- Keep text **short and punchy**; the standee should be scannable in a few seconds.
+- Use your **brand colors** (especially indigo and accent colors) to tie the standee back to the product UI.
+- Lean on **icons, highlights, and short captions** rather than long paragraphs.
+- Ensure the **“Chaos vs Control”** contrast is immediately visible from a distance.
+
diff --git a/README.md b/README.md
index 5251d86..1322982 100644
--- a/README.md
+++ b/README.md
@@ -1,31 +1,270 @@
-## JUNOHUB
+## JUNO
-JUNOHUB is a Next.js application that powers an admin and supplier portal with:
+
-- Authentication and multi-factor auth
-- Gmail integration for support tickets (Juno Engine)
-- Shopify integration for orders, products, and inventory
-- Knowledge base and FAQ management
-- Admin dashboards for stores, suppliers, and email events
+**Tech stack:** ⚛️ Next.js · 💙 TypeScript · 🐘 PostgreSQL · ☁️ AWS Bedrock · 📬 Gmail API · 🐳 Docker · 🔐 NextAuth
-The frontend and backend are implemented in a single Next.js App Router project.
+Modern commerce and support infrastructure for Shopify‑based dropshipping businesses. 🚀
+
+JUNO is a full‑stack Next.js application that powers:
+
+- A **Vendor Portal** for Shopify merchants
+- A **Supplier Portal** for product providers
+- An **Admin view** for operations
+- An AI‑powered helpdesk and knowledge engine called **JUNOCHAT / Juno Engine**
+
+Everything runs inside a single Next.js App Router project (frontend + backend + background jobs).
---
-## Tech Stack
+## Table of Contents
+
+1. [High‑Level Overview](#high-level-overview)
+2. [Core Features](#core-features)
+ - [Vendor Portal](#vendor-portal)
+ - [Supplier Portal](#supplier-portal)
+ - [Admin / Ops](#admin--ops)
+ - [JUNOCHAT (AI Helpdesk)](#junochat-ai-helpdesk)
+3. [Architecture & Tech Stack](#architecture--tech-stack)
+4. [Problems & Solutions](#problems--solutions)
+5. [Future Enhancements](#future-enhancements)
+ - [JUNOCHAT & AI](#future-enhancements-for-junochat--ai)
+6. [Local Development](#local-development)
+7. [Docker & Deployment](#docker--deployment)
+8. [AWS Bedrock & AI Setup](#aws-bedrock--ai-setup)
+9. [Prisma & Database](#prisma--database)
+10. [License](#license)
+
+---
+
+## High‑Level Overview
+
+JUNO centralizes communication and operations between **vendors** (Shopify stores) and **suppliers**:
+
+- Vendors can:
+ - Connect Shopify stores and sync products.
+ - Receive products and price offers from suppliers.
+ - See new products in a clean, auto‑refreshing **New Products** view.
+ - Get notifications when suppliers change prices or withdraw products.
+
+- Suppliers can:
+ - Manage their product catalog with images and pricing.
+ - Accept product sync requests from vendors.
+ - Provide products and custom pricing per vendor.
+ - Edit synced product price/quantity **per vendor** with inline controls.
+
+- Both sides are supported by:
+ - **JUNOCHAT** – an AI assistant powered by AWS Bedrock (Titan + Claude) that can answer questions based on the knowledge base and FAQs.
+ - A **Juno Engine** area for Gmail and ticketing workflows.
+
+---
+
+## Core Features
+
+### Vendor Portal
+
+- **Shopify connections**
+ - Connect one or more Shopify stores to JUNO.
+ - Webhooks keep orders, inventory, and products in sync.
+
+- **New Products**
+ - Consolidated list of:
+ - Products vendors requested and had **synced** by suppliers.
+ - Products **provided directly** by suppliers via offers.
+ - Clean row‑based layout (no heavy cards) that:
+ - Auto‑refreshes in the background on an interval and when the tab becomes visible.
+ - Avoids UI flicker by only updating when data actually changes.
+ - Product detail sheet with:
+ - Price
+ - Supplier
+ - Optional quantity/amount
+ - Description and image
+ - Clicking outside the detail closes it (no need to aim at a tiny “X”).
+
+- **Suppliers Directory**
+ - Discover global suppliers.
+ - Send connection invitations.
+ - Track connection status (PENDING / CONNECTED / REJECTED).
+
+- **Notifications**
+ - Vendors are notified when:
+ - A supplier accepts a product sync request.
+ - A supplier provides a new product.
+ - A supplier updates the price or quantity of an offered/synced product.
+
+### Supplier Portal
+
+- **Vendor Connections**
+ - Accept invitations using secure tokens.
+ - See all connected vendors with status filters.
+ - Accept / reject product sync requests from vendors with a dedicated panel.
+
+- **Synced Products Per Vendor**
+ - For each vendor, suppliers see a **synced products** block:
+ - Compact, scrollable list for large catalogs.
+ - Shows image, title, SKU, description.
+ - Inline edit controls for:
+ - **Price** (for that vendor)
+ - **Available amount / quantity** (for that vendor)
+ - Updates flow through `ProductSync` so the vendor’s New Products view reflects the new price/amount.
+
+- **Provided Products (Offers)**
+ - Suppliers can:
+ - Select products from their catalog.
+ - Specify **per‑vendor price** and **total quantity**.
+ - See all offers in a tidy list with image, SKU, and timestamps.
+ - **Edit offer**:
+ - Opens a modal (no page jump) to change price and quantity.
+ - Sends a notification to the vendor about the update.
+ - **Withdraw offer**:
+ - Opens a custom confirmation dialog:
+ - “You are about to withdraw *{productName}* from *{vendorName}*…”
+ - On confirm, removes the offer and the product disappears from the vendor’s New Products list.
+
+- **Products Catalog**
+ - Manage own products (create/update/delete).
+ - Upload images via:
+ - S3 in hosted environments, or
+ - Local `public/uploads` in pure local dev.
+ - Safeguards:
+ - Synced products from vendors are **editable but not deletable**.
+ - UI labels clarify when a product is “Synced” and where it came from.
+
+### Admin / Ops
+
+- Admin page with an overview of:
+ - Stores
+ - Vendors
+ - Suppliers
+ - Juno Engine activity
+
+- Email‑centric ops:
+ - Gmail polling and webhook endpoints.
+ - Email logs and templates.
+ - MFA setup, notifications, and account hygiene flows.
+
+### JUNOCHAT (AI Helpdesk)
+
+JUNOCHAT (a.k.a. Juno Engine chat) is the AI layer that:
+
+- Uses **AWS Bedrock**:
+ - **Amazon Titan Text Embeddings V2** for vector embeddings.
+ - **Anthropic Claude 3 Haiku** for chat and knowledge‑base answers.
+- Supports:
+ - FAQ ingestion and retrieval.
+ - Knowledge document upload + chunking.
+ - RAG‑style responses for store‑specific questions (orders, products, policies, etc.).
+- Integrates with the rest of JUNO:
+ - Can respond based on vendor/supplier context.
+ - Ties into the Juno Engine Gmail / ticketing workflow so AI can assist with replies.
+
+---
+
+## Future Enhancements
+
+### Future Enhancements for JUNOCHAT & AI
+
+- **Deeper Shopify awareness**
+ - Let JUNOCHAT answer questions like:
+ - “Which supplier provides the top‑selling items in the last 30 days?”
+ - “What is the margin per vendor on synced products?”
+
+- **Multi‑channel support**
+ - Extend Juno Engine beyond Gmail:
+ - WhatsApp / SMS
+ - Messenger / Instagram DMs
+ - Shopify Inbox
+
+- **Active suggestion engine**
+ - Use embeddings + usage data to:
+ - Suggest products suppliers should offer to specific vendors.
+ - Recommend pricing bands per market/region.
+
+- **Self‑service playbooks**
+ - Let admins define reusable “AI playbooks”, e.g.:
+ - “Handle delayed shipment” flow.
+ - “Out‑of‑stock product” flow.
+ - JUNOCHAT would follow these playbooks when generating replies.
+
+---
+
+## Architecture & Tech Stack
- **Framework**: Next.js (App Router, TypeScript)
-- **UI**: React + modern Tailwind-style components
+- **UI**: React + Tailwind‑style utility classes
- **Auth**: NextAuth
-- **Database**: PostgreSQL (Prisma ORM)
+- **Database**: PostgreSQL via Prisma ORM
- **Background / Integrations**:
- - Gmail APIs (via OAuth)
- - Shopify APIs
- - AWS Bedrock for embeddings and chat (Titan Text Embeddings V2 + Claude 3 Haiku)
+ - Gmail APIs (OAuth)
+ - Shopify APIs (orders, products, inventory)
+ - AWS Bedrock (Titan embeddings + Claude 3 Haiku chat)
- **Deployment**: Docker + GitHub Actions → AWS EC2
---
+## Problems & Solutions
+
+### 1. Dropshipping is glued together with spreadsheets and chats 😵💫
+
+**Typical Shopify dropshipping today:**
+
+- Vendors discover suppliers in WhatsApp groups, email threads, or random marketplaces.
+- Product info, pricing, and availability live in:
+ - Google Sheets
+ - Excel files
+ - Long chat histories and voice notes
+- When something changes (price increases, product discontinued), it’s easy to miss and very hard to trace.
+
+**How JUNO helps:**
+
+- Formal **connections** between Shopify stores and suppliers.
+- Structured models (`ProductSync`, `SupplierProductOffer`) instead of ad‑hoc spreadsheets.
+- Every new product or change becomes:
+ - A record in the database.
+ - A visible entry in the **New Products** list.
+ - A notification to the affected party (vendor or supplier).
+
+👉 Result: less “Did you see my message?” and more “The system already updated this.”
+
+### 2. No single source of truth for cost, price, and margin per vendor 💸
+
+**In a typical Shopify setup:**
+
+- Supplier sends a Google Sheet with “latest prices”.
+- Vendor copies that into Shopify, maybe with manual mark‑ups.
+- If the supplier changes cost for **one** vendor, everyone else may still see old prices.
+- Nobody is sure what the **current agreed cost** is for a given product/vendor pair.
+
+**How JUNO helps:**
+
+- Suppliers manage **per‑vendor offers** directly in the Supplier Portal:
+ - Price and quantity are editable inline.
+ - Synced products from vendors can be overridden per store.
+- Vendors see the resulting price and available amount in one place:
+ - The **New Products** page, refreshed in the background.
+ - Notifications whenever suppliers change price/quantity.
+
+👉 Result: vendors always see the latest cost per product per supplier, and suppliers stay in control of what each partner gets.
+
+### 3. Operational noise across email, tickets, and knowledge 💬
+
+**Pain today:**
+
+- Support lives in Gmail, while operations live in Shopify, and documentation is buried in Notion/Docs.
+- Agents manually copy/paste order IDs, tracking links, and policy snippets into replies.
+- Repeated questions (“Where is my order?”, “What’s your return policy?”) steal time from real issues.
+
+**How JUNO helps:**
+
+- **JUNOCHAT + Juno Engine**:
+ - Ingest FAQs and internal docs into a vectorized knowledge base (via Bedrock embeddings).
+ - Answer questions using **RAG** against that knowledge.
+ - Integrate with Gmail so tickets and AI context live in the same place.
+
+👉 Result: fewer repetitive replies, faster accurate responses, and a single surface for “what we know” + “what customers ask”.
+
+---
+
## Local Development
1. **Install dependencies**
@@ -66,7 +305,7 @@ Visit `http://localhost:3000` in your browser.
---
-## Docker
+## Docker & Deployment
The project can be run via Docker using the provided `Dockerfile` and `docker-compose.yml`.
@@ -78,9 +317,7 @@ docker compose up -d --build
Make sure your `.env` is present next to the app code so the container can read it.
----
-
-## CI/CD on AWS EC2
+### CI/CD on AWS EC2
This repo includes a GitHub Actions workflow at `.github/workflows/deploy-ec2.yml` that:
@@ -91,7 +328,7 @@ This repo includes a GitHub Actions workflow at `.github/workflows/deploy-ec2.ym
5. Uses `docker compose` / `docker-compose` to build and run the app.
6. Performs a health check and **automatically rolls back** to the previous commit if the deployment or health check fails.
-### Required GitHub Secrets
+#### Required GitHub Secrets
Set the following secrets in **GitHub → Settings → Secrets and variables → Actions**:
@@ -102,7 +339,7 @@ Set the following secrets in **GitHub → Settings → Secrets and variables →
- `EC2_ENV` – **multi-line secret containing the full contents of the `.env` file** used in production.
This is written to `.env` on the server during deployment.
-### Deployment Flow
+#### Deployment Flow
- Push to `main`.
- GitHub Actions:
@@ -119,29 +356,24 @@ This gives you a sharp deployment with an automatic rollback path.
---
-## AWS Bedrock Setup
+## AWS Bedrock & AI Setup
-The knowledge base feature uses AWS Bedrock for AI-powered embeddings and chat completion.
+The knowledge base and JUNOCHAT features use AWS Bedrock for AI‑powered embeddings and chat completion.
### Prerequisites
-1. **AWS Account**: Create an account at https://aws.amazon.com/
+1. **AWS Account**: Create an account at `https://aws.amazon.com/`
2. **Enable Bedrock Access**:
- - Go to https://console.aws.amazon.com/bedrock/
- - Navigate to "Model access" in the left sidebar
+ - Go to `https://console.aws.amazon.com/bedrock/`
+ - Navigate to **Model access**
- Request access to:
- **Amazon Titan Text Embeddings V2** (for embeddings)
- **Anthropic Claude 3 Haiku** (for chat completion)
- - Wait for approval (usually instant for Titan, may take a few hours for Claude)
### IAM Setup
Create an IAM user or role with Bedrock permissions:
-1. Go to IAM Console → Users (or Roles)
-2. Create a new user/role or select existing
-3. Attach the following policy (or create a custom policy):
-
```json
{
"Version": "2012-10-17",
@@ -158,16 +390,7 @@ Create an IAM user or role with Bedrock permissions:
}
```
-4. **Create Access Keys** (for IAM user):
- - Go to Security credentials tab
- - Click "Create access key"
- - Choose "Application running outside AWS" or "EC2" depending on your deployment
- - Copy the Access Key ID and Secret Access Key
- - Add these to your `.env` file
-
-### Environment Variables
-
-Add to your `.env` file:
+Create access keys for that user and add them to `.env`:
```bash
AWS_ACCESS_KEY_ID="your-access-key-id"
@@ -175,61 +398,39 @@ AWS_SECRET_ACCESS_KEY="your-secret-access-key"
AWS_REGION="us-east-1" # or your preferred region
```
-### Database Migration
+### Database Migration & Re‑Embedding
-After setting up AWS Bedrock, you need to migrate existing embeddings:
+After setting up AWS Bedrock:
-1. **Run the database migration** to change embedding dimensions from 1536 to 1024:
- ```bash
- npx prisma migrate deploy
- ```
-
-2. **Re-embed existing knowledge base data**:
- ```bash
- npm run re-embed-knowledge-base
- ```
-
- This script will:
- - Read all existing `KnowledgeChunk` records
- - Generate new 1024-dimension embeddings using Bedrock Titan V2
- - Update the database with new embeddings
- - Process in batches to avoid rate limiting
-
-### Models Used
-
-- **Embeddings**: Amazon Titan Text Embeddings V2 (`amazon.titan-embed-text-v2:0`)
- - Output dimension: 1024 (configurable: 256, 512, or 1024)
- - Used for: FAQ embeddings, document chunk embeddings, query embeddings
-
-- **Chat**: Anthropic Claude 3 Haiku (`anthropic.claude-3-haiku-20240307-v1:0`)
- - Used for: RAG (Retrieval-Augmented Generation) query responses
- - Fast and cost-effective for knowledge base Q&A
-
-### Optional: Override Models
-
-You can override the default models via environment variables:
+1. Apply Prisma migrations:
```bash
-BEDROCK_EMBEDDING_MODEL="amazon.titan-embed-text-v2:0"
-BEDROCK_CHAT_MODEL="anthropic.claude-3-haiku-20240307-v1:0"
+npx prisma migrate deploy
```
-### Prisma:
+2. Re‑embed existing knowledge base data:
-If you want to visualize the database:
+```bash
+npm run re-embed-knowledge-base
```
+
+This script:
+
+- Reads all existing `KnowledgeChunk` records.
+- Generates new embeddings using Titan V2.
+- Updates the database in batches to avoid rate limiting.
+
+---
+
+## Prisma & Database
+
+To inspect the database locally:
+
+```bash
export DATABASE_URL='
- JUNOHUB eliminates these bottlenecks by providing a unified, high-octane + JUNO eliminates these bottlenecks by providing a unified, high-octane platform where data flows as fast as the commerce it supports.
diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index 182f09f..4ff866c 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -140,7 +140,7 @@ export default async function AdminOverviewPage() {High-level, read-only visibility into how data flows between Shopify - stores, vendors and suppliers across JUNOHUB. + stores, vendors and suppliers across JUNO.
diff --git a/src/app/api/auth/password-reset/request/route.ts b/src/app/api/auth/password-reset/request/route.ts index d7736cb..f381292 100644 --- a/src/app/api/auth/password-reset/request/route.ts +++ b/src/app/api/auth/password-reset/request/route.ts @@ -73,7 +73,7 @@ export async function POST(req: Request) { -|
-
JUNOHUB+JUNO |
@@ -114,7 +114,7 @@ export async function POST(req: Request) {
await sendEmail({
to: email,
- subject: "Reset Your JUNOHUB Password",
+ subject: "Reset Your JUNO Password",
html: emailHtml
})
diff --git a/src/app/api/auth/verify-email/send/route.ts b/src/app/api/auth/verify-email/send/route.ts
index ccf690f..0913a2e 100644
--- a/src/app/api/auth/verify-email/send/route.ts
+++ b/src/app/api/auth/verify-email/send/route.ts
@@ -72,7 +72,7 @@ export async function POST(req: Request) {
-
|
-
JUNOHUB+JUNO |
@@ -113,7 +113,7 @@ export async function POST(req: Request) {
await sendEmail({
to: user.email,
- subject: "Verify Your JUNOHUB Email",
+ subject: "Verify Your JUNO Email",
html: emailHtml
})
diff --git a/src/app/api/integrations/gmail/poll/route.ts b/src/app/api/integrations/gmail/poll/route.ts
index 04cc6f6..eaa30d6 100644
--- a/src/app/api/integrations/gmail/poll/route.ts
+++ b/src/app/api/integrations/gmail/poll/route.ts
@@ -58,7 +58,7 @@ export async function POST(_req: Request) {
|
-
JUNOHUB+JUNO |
@@ -77,7 +77,7 @@ function generateNewsletterWelcomeHtml(email: string): string {
YOU'RE IN THE LOOP. ⚡