instructSite

byDarren Hopwood

import os from fastapi import FastAPI, File, UploadFile, HTTPException from fastapi.middleware.cors import CORSMiddleware from pydantic import BaseModel from supabase import create_client, Client app = FastAPI(title="instructBrain™ AI Engine", version="1.0.0") # Enable Cross-Origin Resource Sharing (CORS) so your Lovable frontend can talk to it safely app.add_middleware( CORSMiddleware, allow_origins=["*"], # In production, restrict this to your Lovable deployment URL allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) # Initialize Supabase Client Connection SUPABASE_URL = os.getenv("SUPABASE_URL") SUPABASE_KEY = os.getenv("SUPABASE_SERVICE_ROLE_KEY") # Use service role key to bypass RLS limits during testing if not SUPABASE_URL or not SUPABASE_KEY: raise RuntimeError("Missing Supabase configuration environment variables.") supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY) class AnalysisRequest(BaseModel): project_id: str drawing_name: str @app.get("/") def read_root(): return {"status": "online", "engine": "instructBrain v1.0.0"} @app.post("/api/v1/analyze-blueprint") async def analyze_blueprint(project_id: str, drawing_name: str, file: UploadFile = File(...)): """ Accepts an architectural drawing PDF, runs text/vector extraction, matches rules from Supabase, and inserts found scope gaps. """ try: # Read raw binary data from uploaded file pdf_bytes = await file.read() # TODO: Insert Phase 2 extraction logic here (PyMuPDF parser) return { "success": True, "message": f"Successfully initialized parsing for {drawing_name}", "bytes_received": len(pdf_bytes) } except Exception as e: raise HTTPException(status_code=500, detail=str(e))

LandingLoginDashboardAnalysisSignupSettingsResultsHomeUploadsRulesUploadScopeGaps
Landing

Comments (0)

No comments yet. Be the first!

Project Tasks

114 workspace tasks
#1

Implement Navigation for Landing

52.72 cr estimated
To Do
#2

Implement Landing Hero for Landing

87.87 cr estimated
To Do
#3

Implement Trust Badges for Landing

35.15 cr estimated
To Do
#4

Implement Landing Features for Landing

35.15 cr estimated
To Do
#5

Implement Interactive Blueprint Showcase for Landing

87.87 cr estimated
To Do
#6

Implement How It Works for Landing

35.15 cr estimated
To Do
#7

Implement Testimonials for Landing

52.72 cr estimated
To Do
#8

Implement Landing Pricing for Landing

52.72 cr estimated
To Do
#9

Implement Landing FAQ for Landing

35.15 cr estimated
To Do
#10

Implement Landing CTA for Landing

52.72 cr estimated
To Do
#11

Implement Footer for Landing

35.15 cr estimated
To Do
#12

Implement Navigation for Login

17.57 cr estimated
Backlog
#13

Implement Login Hero for Login

52.72 cr estimated
Backlog
#14

Implement Login Form for Login

35.15 cr estimated
Backlog
#15

Implement Login Footer for Login

17.57 cr estimated
Backlog
#16

Implement Navigation for Signup

35.15 cr estimated
Backlog
#17

Implement Signup Form for Signup

70.3 cr estimated
Backlog
#18

Implement Signup Benefits for Signup

17.57 cr estimated
Backlog
#19

Implement Dashboard Navigation for Dashboard

17.57 cr estimated
Backlog
#20

Implement Dashboard Sidebar for Dashboard

35.15 cr estimated
Backlog
#21

Implement Dashboard Header for Dashboard

35.15 cr estimated
Backlog
#22

Implement Dashboard Metrics for Dashboard

35.15 cr estimated
Backlog
#23

Implement Dashboard Analysis Overview for Dashboard

52.72 cr estimated
Backlog
#24

Implement Dashboard Recent Uploads for Dashboard

52.72 cr estimated
Backlog
#25

Implement Dashboard Conflict Summary for Dashboard

35.15 cr estimated
Backlog
#26

Implement Dashboard Quick Actions for Dashboard

35.15 cr estimated
Backlog
#27

Implement Dashboard Footer for Dashboard

17.57 cr estimated
Backlog
#28

Implement Navigation for Home

17.57 cr estimated
Backlog
#29

Implement Home Hero for Home

52.72 cr estimated
Backlog
#30

Implement Home Trust Badges for Home

35.15 cr estimated
Backlog
#31

Implement Home Features for Home

35.15 cr estimated
Backlog
#32

Implement Home Blueprint Explorer for Home

70.3 cr estimated
Backlog
#33

Implement Home Analysis Flow for Home

35.15 cr estimated
Backlog
#34

Implement Home Conflict Visualization for Home

52.72 cr estimated
Backlog
#35

Implement Home Use Cases for Home

35.15 cr estimated
Backlog
#36

Implement Home Pricing for Home

35.15 cr estimated
Backlog
#37

Implement Home Testimonials for Home

35.15 cr estimated
Backlog
#38

Implement Home FAQ for Home

35.15 cr estimated
Backlog
#39

Implement Home CTA for Home

35.15 cr estimated
Backlog
#40

Implement Footer for Home

17.57 cr estimated
Backlog
#41

Implement Navigation for Upload

35.15 cr estimated
Backlog
#42

Implement Upload Hero for Upload

17.57 cr estimated
Backlog
#43

Implement Upload Zone for Upload

52.72 cr estimated
Backlog
#44

Implement Upload Progress for Upload

35.15 cr estimated
Backlog
#45

Implement Upload Guidance for Upload

35.15 cr estimated
Backlog
#46

Implement Upload Preview for Upload

70.3 cr estimated
Backlog
#47

Implement Upload Results for Upload

70.3 cr estimated
Backlog
#48

Implement Upload Actions for Upload

17.57 cr estimated
Backlog
#49

Implement Footer for Upload

17.57 cr estimated
Backlog
#50

Implement Navigation for Analysis

17.57 cr estimated
Backlog
#51

Implement Analysis Hero for Analysis

17.57 cr estimated
Backlog
#52

Implement Analysis Upload for Analysis

35.15 cr estimated
Backlog
#53

Implement Analysis Progress for Analysis

52.72 cr estimated
Backlog
#54

Implement Analysis Conflicts for Analysis

52.72 cr estimated
Backlog
#55

Implement Analysis Details for Analysis

52.72 cr estimated
Backlog
#56

Implement Analysis Blueprint for Analysis

70.3 cr estimated
Backlog
#57

Implement Analysis Actions for Analysis

35.15 cr estimated
Backlog
#58

Implement Analysis Related for Analysis

17.57 cr estimated
Backlog
#59

Implement Footer for Analysis

17.57 cr estimated
Backlog
#60

Implement Navigation for Results

17.57 cr estimated
Backlog
#61

Implement Results Header for Results

35.15 cr estimated
Backlog
#62

Implement Conflicts Summary for Results

35.15 cr estimated
Backlog
#63

Implement Conflicts List for Results

52.72 cr estimated
Backlog
#64

Implement Conflict Detail for Results

52.72 cr estimated
Backlog
#65

Implement Action Panel for Results

35.15 cr estimated
Backlog
#66

Implement Export Options for Results

35.15 cr estimated
Backlog
#67

Implement Footer for Results

17.57 cr estimated
Backlog
#68

Implement Navigation for Scope Gaps

17.57 cr estimated
Backlog
#69

Implement Scope Gaps Header for Scope Gaps

17.57 cr estimated
Backlog
#70

Implement Filter Bar for Scope Gaps

35.15 cr estimated
Backlog
#71

Implement Gaps List for Scope Gaps

52.72 cr estimated
Backlog
#72

Implement Detail Modal for Scope Gaps

70.3 cr estimated
Backlog
#73

Implement Status Update Bar for Scope Gaps

35.15 cr estimated
Backlog
#74

Implement Footer for Scope Gaps

17.57 cr estimated
Backlog
#75

Implement Navigation for Uploads

17.57 cr estimated
Backlog
#76

Implement Uploads Hero for Uploads

35.15 cr estimated
Backlog
#77

Implement Upload Zone for Uploads

35.15 cr estimated
Backlog
#78

Implement Uploads History for Uploads

35.15 cr estimated
Backlog
#79

Implement Analysis Progress for Uploads

52.72 cr estimated
Backlog
#80

Implement Conflict Summary for Uploads

35.15 cr estimated
Backlog
#81

Implement Quick Actions for Uploads

17.57 cr estimated
Backlog
#82

Implement Footer for Uploads

17.57 cr estimated
Backlog
#83

Implement Navigation for Rules

35.15 cr estimated
Backlog
#84

Implement Rules Hero for Rules

35.15 cr estimated
Backlog
#85

Implement Rules Introduction for Rules

52.72 cr estimated
Backlog
#86

Implement Rules Keyword Management for Rules

87.87 cr estimated
Backlog
#87

Implement Rules Template Library for Rules

87.87 cr estimated
Backlog
#88

Implement Rules Conflict Definition for Rules

52.72 cr estimated
Backlog
#89

Implement Rules Severity Levels for Rules

52.72 cr estimated
Backlog
#90

Implement Rules Advanced Options for Rules

70.3 cr estimated
Backlog
#91

Implement Rules Action Bar for Rules

52.72 cr estimated
Backlog
#92

Implement Footer for Rules

35.15 cr estimated
Backlog
#93

Implement Navigation for Settings

17.57 cr estimated
Backlog
#94

Implement Settings Sidebar for Settings

35.15 cr estimated
Backlog
#95

Implement Settings Header for Settings

35.15 cr estimated
Backlog
#96

Implement Settings Profile for Settings

35.15 cr estimated
Backlog
#97

Implement Settings Severities for Settings

35.15 cr estimated
Backlog
#98

Implement Settings System Config for Settings

35.15 cr estimated
Backlog
#99

Implement Settings Notifications for Settings

52.72 cr estimated
Backlog
#100

Implement Settings Data Retention for Settings

35.15 cr estimated
Backlog
#101

Implement Settings Danger Zone for Settings

52.72 cr estimated
Backlog
#102

Implement Footer for Settings

17.57 cr estimated
Backlog
#103

PDF Analysis API Endpoint

47.95 cr estimated
Backlog
#104

Supabase Schema & Migrations

60 cr estimated
Backlog
#105

Rules CRUD API Endpoints

35.96 cr estimated
Backlog
#106

Scope Gaps CRUD API Endpoints

35.96 cr estimated
Backlog
#107

Uploads History API Endpoints

35.96 cr estimated
Backlog
#108

Export Report API Endpoint

35.96 cr estimated
Backlog
#109

Settings Persistence API Endpoints

35.96 cr estimated
Backlog
#110

Dashboard Metrics & Stats API

23.98 cr estimated
Backlog
#111

Environment Configuration Setup

9.75 cr estimated
Backlog
#112

CORS & Security Middleware

23.98 cr estimated
Backlog
#113

Global State Management Setup

35.15 cr estimated
Backlog
#114

Design System & Theme Tokens

17.57 cr estimated
Backlog
Landing design preview
Landing: View Platform
Login: Sign In
Dashboard: View Overview
Dashboard: Review Conflicts
ScopeGaps: View Flagged Items
ScopeGaps: Update Status
Rules: Manage Keywords
Rules: Edit Templates
Settings: Configure System
Settings: Set Severities
Uploads: Monitor Analyses
Landing design preview
Landing: View Platform
Login: Sign In
Dashboard: View Overview
Dashboard: Review Conflicts
ScopeGaps: View Flagged Items
ScopeGaps: Update Status
Rules: Manage Keywords
Rules: Edit Templates
Settings: Configure System
Settings: Set Severities
Uploads: Monitor Analyses