VisionPitch is an automated sales proposal and business intelligence platform. It replaces tedious manual client research, competitor analysis, and static document creation with a lightning-fast, interactive generation pipeline.
Designed under a Sovereign Minimalist dark theme, it empowers sales representatives to generate bespoke proposals in seconds, and provides prospective clients with a live interactive portal to modify pricing and sign proposals digitally.
VisionPitch acts as a full-stack, decoupled application that streamlines the sales intake, AI audit, dynamic proposal customized negotiation, and final client sign-off lifecycle.
graph TD
A[Sales Rep Intake Form] -->|HTTP POST| B[FastAPI Backend Engine]
B -->|Ingest Context| C[Google Gemini 1.5 Flash API]
C -->|Deterministic JSON Audit| B
B -->|Store Option A Schema| D[Neon.tech PostgreSQL DB]
B -->|Return Proposal URL| A
E[Client User] -->|Open Custom URL| F[Dynamic Proposal Webpage]
F -->|HTTP GET Request| B
B -->|Set Status: Viewed| D
F -->|Interact with Scope Sliders| F
F -->|Draw Base64 Signature| G[HTML5 Canvas Interface]
G -->|Submit Signature POST| B
B -->|Save Signature & Set Status: Signed| D
- Sales Intake: A sales representative inputs a business profile (enforcing a constraint that at least a website URL or social media URL is present).
- AI-Powered Audit: The backend queries Google Gemini 1.5 Flash with a rigid prompt, returning a structured JSON document covering Sentiment, Competitors, and Service recommendations.
- Link Masking: The database persists the proposal using a secure, randomized
proposal_hashURL key instead of database integer IDs. - Negotiation and Adjustment: The client reviews their custom web proposal and adjusts scope multipliers via real-time pricing sliders.
- Secure Sign-Off: The client signs their name on an interactive HTML5 canvas, which exports the drawing as a Base64 string saved directly into the database.
The application relies on a decoupled full-stack architecture:
| Component | Technology | Rationale |
|---|---|---|
| Frontend UI | HTML5, CSS3, Tailwind CSS CDN | Delivers lightweight, ultra-fast dark-mode styling with zero build pipelines. |
| Frontend Logic | Vanilla JavaScript (ES6+) | Direct, framework-free browser execution for slider math, Canvas API strokes, and async fetch() requests. |
| Backend API | Python 3.11+ / FastAPI | Async framework with Pydantic serialization for high concurrency and native request verification. |
| Database | PostgreSQL (psycopg2-binary) |
Neon.tech / Render cloud cluster guaranteeing transaction persistence, relational constraints, and durability. |
| AI Orchestrator | Google Gemini 1.5 Flash | The official google-genai package for high-speed contextual auditing with deterministic JSON mode schema targets. |
The persistence layer implements a relational database structure designed for fast retrieval and data integrity:
Stores contact information, validation targets, and proposal lifecycle states.
client_id(SERIAL, Primary Key)client_name(TEXT, Not Null)company_name(TEXT, Not Null)industry(TEXT, Not Null)website_url(TEXT, Nullable)social_media_urls(TEXT, Nullable)budget(REAL, Not Null)client_status(TEXT, Default:'Proposal generated')- Lifecycle States:
'Proposal generated','Proposal sent','Proposal viewed','Proposal signed','Proposal declined'.
- Lifecycle States:
- Constraints: Enforces a check validation that both
website_urlandsocial_media_urlscannot be null simultaneously (url_presenceconstraint).
Caches structural AI analysis blocks, proposal access tokens, and digital signatures.
proposal_id(SERIAL, Primary Key)client_id(INTEGER, Foreign Key referencingclients(client_id)withON DELETE CASCADE)proposal_hash(VARCHAR(50), Unique, Not Null)audit_raw_json(TEXT, Contains full structured AI analysis, gaps, and benchmarks)recommended_services(TEXT, Contains recommended services array)final_price(REAL, Final computed invoice value)signature_data(TEXT, Base64 drawing representation)
- Python 3.11+ installed
- A PostgreSQL Database URL (e.g., Neon.tech)
- A Google Gemini API Key (from Google AI Studio)
- Navigate to the backend directory:
cd backend - Create and activate a virtual environment:
python -m venv venv # On Windows: .\venv\Scripts\activate # On macOS/Linux: source venv/bin/activate
- Install required dependencies:
pip install -r requirements.txt
- Create a
.envfile in thebackend/directory:DATABASE_URL=postgresql://<user>:<password>@<host>/<dbname>?sslmode=require GEMINI_API_KEY=your_gemini_api_key_here
- Initialize the database schema:
python database.py
- Start the FastAPI development server:
uvicorn main:app --reload
The frontend is built with static files .
- Serve the
frontend/directory using any local server, or openindex.htmldirectly in your browser. - If using Python:
Open
cd frontend python -m http.server 8080http://127.0.0.1:8080in your web browser.
Verify system stability and calculations using automated tests built inside the pytest framework.
- Navigate to the
backendfolder. - Run tests:
This executes:
pytest
- Pricing Engine Math: Validates dynamic service sliders, rush adjustments, and price recalculations.
- Form Sanitization Logic: Confirms that fields block script injections and strip HTML before compiling prompts.
The application features explicit defensive safeguards against core runtime vulnerabilities:
- API Outage Protection: Catches
google-genaiservice outages, timeouts, or rate limits. The system uses try-except blocks to route a local pre-cached fallback analysis object instead of crashing. - Hash Integrity Check: Gracefully intercepts invalid proposal hashes or malicious SQL strings. If a lookup returns empty database records, the backend responds with a structured
404 Not Foundresponse instead of exposing raw SQL logs.