Quickextract.ai is an online SAAS platform designed to convert Bank PDF statements into CSV files for seamless import into various accounting software. The platform is composed of multiple projects, each with a distinct role in the overall architecture. This document provides an overview of the workspace and each sub-project.
- finease-web: The main SAAS application (user dashboard and PDF-to-CSV interface)
- finease-api: The backend API (handles authentication, PDF parsing, and business logic)
- finease-app: The branding/marketing website
- finease-infra: Infrastructure-as-code, AWS Lambda functions, and deployment configuration
- Tech Stack: Next.js, TypeScript, Tailwind CSS
- Purpose: Provides the user‑facing dashboard for uploading bank statements, managing documents, and downloading CSVs. Handles user authentication (email/password, Google via Firebase), and interacts with the backend API for processing.
- Key Features:
- Secure login/registration (Firebase integration)
- PDF upload and conversion UI
- Document management (view, download, delete)
- Responsive, modern interface
- Important Files & Directories:
app/register/– registration flow, free‑plan auto‑assignmentapp/login/– login page and Google sign‑in componentcomponents/DocumentTable.tsx– table UI for listing documentscomponents/GoogleSignInButton.tsx– Google auth buttonapp/api/– client wrappers for backend endpointsnext.config.ts,tailwind.config.ts– build and styling configuration
- Tech Stack: Python, FastAPI, PostgreSQL, AWS S3, Firebase, Stripe
- Purpose: Implements all server‑side logic: authentication, PDF parsing, CSV generation, file storage, subscription & quota management.
- Key Features:
- REST API endpoints for auth, document upload, management, and subscription handling
- Firebase authentication integration
- Stripe subscription & payment processing
- AWS S3 for secure file storage
- Quota enforcement per subscription tier
- Important Files & Directories:
app/api.py– main FastAPI application, router registrationapp/models/– Pydantic models (document.py,user_profile.py,receipt.py, etc.)app/database/db.py– thin PostgreSQL wrapper (psycopg2)app/utils/quota.py– quota checking & usage updatesapp/subscriptions/index.py– Stripe subscription creation, upgrade/downgrade, webhook handlingapp/firebase_proxy/– Firebase token exchange utilitiesapp/rag/– (future) Retrieval‑augmented generation chat endpointrequirements.txt– Python dependencies
The API uses PostgreSQL. The relevant tables are created implicitly via SQL statements in the code (no separate migration files are present). The current schema inferred from the code is:
documents
| Column | Type | Description |
|---|---|---|
document_id |
SERIAL PRIMARY KEY |
Unique identifier for the document |
uid |
VARCHAR |
Owner user ID (Firebase UID) |
document_name |
VARCHAR |
Human‑readable name supplied by the user |
actual_file_name |
VARCHAR |
S3 object key |
document_type |
VARCHAR (enum: bank, receipt) |
Type of document |
pages |
INTEGER |
Number of pages detected (used for quota) |
should_process |
BOOLEAN |
Whether the document passed quota checks |
approved |
BOOLEAN |
Admin approval flag for receipts |
processed |
BOOLEAN |
Whether the document has been parsed and CSV generated |
processed_at |
TIMESTAMP |
When processing finished |
created_at |
TIMESTAMP |
Insertion time |
updated_at |
TIMESTAMP |
Last update time |
details |
JSONB |
Raw JSON from AI extraction (bank statements) |
ai_details |
JSONB |
Structured AI output |
processed_file_name |
VARCHAR |
S3 key for the generated CSV |
user_profile
| Column | Type | Description |
|---|---|---|
uid |
VARCHAR PRIMARY KEY |
Firebase UID |
subscription_plan |
VARCHAR |
Current plan (free, basic, premium) |
subscription_id |
VARCHAR |
Stripe subscription ID |
subscription_status |
VARCHAR |
Stripe status (active, canceled, …) |
stripe_customer_id |
VARCHAR |
Stripe customer reference |
details |
JSONB |
JSON blob storing quota counters, e.g. pages_used_today, last_usage_date, pages_used_month |
postcode |
VARCHAR |
User's postal code (used for tax calculations) |
monthly_budget |
NUMERIC |
User‑defined budget limit |
currency_symbol |
VARCHAR |
Currency for the budget |
created_at / updated_at |
TIMESTAMP |
Record timestamps |
Additional tables may be added in the future (e.g., expenses, categories), but the above are the core tables used by the current code.
- ExpenseCategory (
app/models/expense_category.py): Stores expense categories with fieldscategory(string) andamount(float). Used for categorizing receipt items. - Receipt (
app/models/receipt.py): Represents a receipt document with fieldsuid,document_name,actual_file_name,details(JSON), etc., similar toDocumentbut for receipt type. - UserProfileCreate / UserProfileUpdate (
app/models/user_profile.py): Schemas for creating/updating user profile information such aspostcode,monthly_budget,currency_symbol. - Register Model (
app/models/register.py): Simplified registration model after UX improvement; only includes user credentials, automatically assigns the free plan.
- Endpoints (in
app/subscriptions/index.py):POST /create-subscription– creates a new Stripe subscription (or free plan) for a user.POST /upgrade-plan– upgrades or downgrades the user's plan, handling payment method attachment and Stripe subscription modification.GET /my-plan– returns the current plan, subscription status, and quota usage.GET /get-quota-status– provides detailed quota information (pages used, limits, reset dates).
- Logic: Uses
QuotaManagerto enforce daily limits for free users and monthly limits for paid plans. Subscription details are stored inuser_profile.detailsJSON field. - Email Notifications:
app/utils/email_notifications.pysends emails on subscription changes (new subscription, upgrade, downgrade). - Audit Logging: Changes are logged to
subscription_audit.logfor traceability.
- Tech Stack: Next.js, TypeScript
- Purpose: Public marketing site for Quickextract.ai – showcases features, pricing, FAQs, and provides contact forms.
- Key Features:
- Static informational pages (Home, Features, About, Contact, Subscribe) and legal pages (Privacy, Terms)
- SEO‑optimized meta tags and Open Graph data
- Built with the Next.js App Router for modern routing/layouts
- Important Files & Directories:
app/home/page.tsx– Home pageapp/features/page.tsx– Features pageapp/about/page.tsx– About pageapp/contact/page.tsx– Contact pageapp/subscribe/page.tsx– Subscribe/Pricing entryapp/privacy/page.tsxandapp/terms/page.tsx– Legal pagesapp/layout.tsx,app/globals.css– root layout and global stylesapp/components/– page‑scoped UI componentscomponents/– shared UI components (e.g., Hero, PricingCard, Footer)public/– static assets (logo, images)next.config.ts,tailwind.config.ts– configuration files
- Tech Stack: AWS CDK (TypeScript), Docker, AWS Lambda
- Purpose: Defines cloud resources (S3 buckets, Lambda functions, IAM roles, API Gateway) and deployment pipelines.
- Key Features:
- CDK stacks for S3, Lambda, IAM, and CloudWatch logging
- Dockerfile for Lambda runtime containing PDF parsing dependencies
- CI/CD scripts for automated deployment
- Important Files & Directories:
infra/– CDK stack definitions (stack.ts,lambda-stack.ts)lambdaexpense/– source code for the PDF‑parsing Lambda functioncdk.json,package.json– CDK project configurationREADME.md– instructions for deploying the stack
- Routing & Pages: All UI pages live under the
app/directory (e.g.,app/register/page.tsx,app/login/page.tsx,app/dashboard/page.tsx). Next.js automatically maps these to routes. - Authentication Flow: Uses Firebase Auth via the
auth-provider.tsxcontext. TheGoogleSignInButton.tsxcomponent triggers Google OAuth, while email/password login is handled bycomponents/LoginForm.tsx. - Document Upload & Management:
components/DocumentUpload.tsx(or similar) calls the backend/create-documentendpoint. Thecomponents/DocumentTable.tsxdisplays the list of documents fetched from/get-documents. - State Management: Global state (e.g., current user, auth token) is stored in React Context defined in
app/_hooks/andapp/_services/. - API Client Layer: Wrapper functions in
app/api/abstract HTTP calls to the FastAPI backend, handling token injection and error handling. - Styling: Tailwind CSS configuration in
tailwind.config.ts; global styles inglobals.css.
- Entry Point:
app/api.pycreates the FastAPI app, registers routers (register,expense,chat,subscriptions). - Models: Pydantic models in
app/models/define request/response schemas (document.py,user_profile.py,receipt.py, etc.). - Database Layer:
app/database/db.pyprovides a thin wrapper aroundpsycopg2with helper methodsexecute,fetchone,fetchall. - Quota Management:
app/utils/quota.pyimplementsQuotaManagerto enforce daily/monthly limits based on the user's subscription plan. - Subscription Logic:
app/subscriptions/index.pyhandles Stripe integration for creating, upgrading, downgrading, and cancelling subscriptions, plus webhook processing. - Firebase Proxy:
app/firebase_proxy/index.pyexchanges Google ID tokens for Firebase custom tokens and validates Firebase ID tokens. - RAG Chat Endpoint:
app/rag/chat.py(future) provides a Retrieval‑Augmented Generation chat interface. - Dependency Injection:
app/dependencies.pydefinesverify_auth_tokento decode and validate Firebase tokens for protected routes. - Utility Functions:
app/utils/index.pyincludes helpers likedetect_document_typeandget_total_pages_by_userused in document processing.
- Static Site: Built with Next.js; pages are defined in
app/page.tsxand additional route folders. - Components: UI components such as
Hero,PricingCard,Footerlive incomponents/. - Assets: Images, logos, and other static files are stored in
public/. - Configuration:
next.config.tsandtailwind.config.tsconfigure the build and styling.
- CDK Stacks: Defined in
infra/stack.ts(core resources) andinfra/lambda-stack.ts(Lambda functions, IAM roles, S3 buckets). - Lambda Code: The PDF‑parsing Lambda resides in
lambdaexpense/; Dockerfilelambdaexpense.Dockerfilebuilds the runtime with required native dependencies. - Deployment Scripts:
cdk.jsonandpackage.jsonmanage CDK CLI commands. Usecdk synthto generate CloudFormation andcdk deployto provision resources. - CI/CD: The repository includes GitHub Actions workflows (not shown) that run
npm run buildandcdk deployon merges to main.
Each sub‑project contains its own README with setup instructions. Below are the recommended steps to run projects locally. Commands are shown for this repository (finease‑app) first, followed by pointers for the others.
# finease-app (this repository)
npm install
npm run dev # starts Next.js dev server on http://localhost:3000
# finease-web (SAAS app) – run in its own repo
# npm install && npm run dev
# finease-api (FastAPI backend) – run in its own repo
# pip install -r requirements.txt && uvicorn app.api:app --reload # http://localhost:8000
# finease-infra (CDK) – run in its own repo directory
# npm install && cdk synth && cdk deploy # requires AWS credentialsEnvironment variables (see .env.example in each project) typically include:
- PostgreSQL connection details (
DB_HOST,DB_PORT,DB_NAME,DB_USER,DB_PASSWORD) - Firebase credentials (
FIREBASE_API_KEY,FIREBASE_PROJECT_ID) - Stripe keys (
STRIPE_SECRET_KEY,STRIPE_PUBLISHABLE_KEY, price IDs) - AWS credentials for S3/Lambda (
AWS_ACCESS_KEY,AWS_SECRET_ACCESS_KEY,AWS_REGION,AWS_BUCKET_NAME)
- Follow the contribution guidelines in each sub‑project’s README.
- For questions, open an issue in the appropriate repository or contact the maintainer.
- Ensure you run the backend and frontend locally with matching environment configurations to avoid authentication or CORS errors.
Quickextract.ai – Making bank data import effortless for everyone!