Skip to content

Sales website for ContPAQi AI Bridge - AI-powered invoice processing for Mexican accounting

Notifications You must be signed in to change notification settings

danribes/contpaqi-website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ContPAQi AI Bridge - Sales Website

CI

Sales and marketing website for ContPAQi AI Bridge, featuring product information, pricing, payment processing, license delivery, and customer portal.

Tech Stack

  • Framework: Next.js 14 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS
  • Database: PostgreSQL with Prisma ORM
  • Authentication: NextAuth.js v5
  • Payments: Stripe
  • Email: Resend
  • i18n: next-intl (English & Spanish)
  • Deployment: Vercel

Features

  • Marketing Pages: Landing, Features, Pricing, Contact
  • Bilingual Support: English and Spanish
  • Payment Processing: Stripe Checkout with subscription support
  • License Management: Automatic license key generation and delivery
  • Customer Portal: License viewing, machine management, downloads
  • Email Notifications: Purchase confirmation, license delivery, renewal reminders

Getting Started

Prerequisites

  • Node.js 18+ (recommended: 20.x)
  • PostgreSQL database (local or cloud-hosted)
  • Stripe account (test mode for development)
  • Resend account (for emails)

Local Development Setup

1. Clone the repository

git clone https://github.com/danribes/contpaqi-website.git
cd contpaqi-website

2. Install dependencies

npm install

3. Set up environment variables

cp .env.example .env.local

Edit .env.local with your credentials:

# Database
DATABASE_URL="postgresql://user:password@localhost:5432/contpaqi_website"

# Authentication (generate with: openssl rand -base64 32)
NEXTAUTH_SECRET="your-generated-secret"
NEXTAUTH_URL="http://localhost:3000"

# Stripe (use test keys for development)
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."

# Email
RESEND_API_KEY="re_..."

# Application
NEXT_PUBLIC_APP_URL="http://localhost:3000"

4. Set up the database

# Generate Prisma client
npx prisma generate

# Create database tables
npx prisma db push

# (Optional) Seed with sample data
npm run db:seed

5. Run the development server

npm run dev

Open http://localhost:3000 in your browser.

Available Scripts

Command Description
npm run dev Start development server
npm run build Create production build
npm run start Start production server
npm run lint Run ESLint
npm run typecheck Run TypeScript compiler check
npm run test Run tests in watch mode
npm run test:run Run tests once
npm run db:migrate Create new database migration
npm run db:migrate:deploy Apply pending migrations
npm run db:seed Seed database with sample data
npm run db:studio Open Prisma Studio (database GUI)

Stripe Setup

  1. Create products and prices in Stripe Dashboard:

    • Starter Monthly ($49/month)
    • Starter Yearly ($490/year)
    • Professional Monthly ($99/month)
    • Professional Yearly ($990/year)
  2. Add the price IDs to your environment variables

  3. Set up webhook endpoint in Stripe:

    • Endpoint: https://your-domain.com/api/webhooks/stripe
    • Events: checkout.session.completed, customer.subscription.*, invoice.*
  4. For local development, use Stripe CLI:

stripe listen --forward-to localhost:3000/api/webhooks/stripe

Project Structure

contpaqi-website/
├── src/
│   ├── app/                    # Next.js App Router
│   │   ├── api/                # API routes
│   │   │   ├── checkout/       # Stripe checkout
│   │   │   ├── license/        # License validation/activation
│   │   │   └── webhooks/       # Stripe webhooks
│   │   ├── (marketing)/        # Marketing pages
│   │   │   ├── features/
│   │   │   ├── pricing/
│   │   │   └── contact/
│   │   ├── portal/             # Customer portal
│   │   └── checkout/           # Checkout success/cancel
│   ├── components/
│   │   ├── layout/             # Header, Footer
│   │   ├── ui/                 # Reusable UI components
│   │   ├── marketing/          # Marketing-specific components
│   │   └── portal/             # Portal-specific components
│   ├── lib/                    # Utilities
│   │   ├── db.ts               # Prisma client
│   │   ├── stripe.ts           # Stripe configuration
│   │   ├── license.ts          # License management
│   │   ├── email.ts            # Email sending
│   │   └── i18n.ts             # Internationalization
│   └── types/                  # TypeScript types
├── prisma/
│   └── schema.prisma           # Database schema
├── messages/                   # i18n translations
│   ├── en.json
│   └── es.json
└── public/                     # Static assets

API Endpoints

License Validation

POST /api/license/validate
Content-Type: application/json

{
  "licenseKey": "XXXX-XXXX-XXXX-XXXX"
}

Machine Activation

POST /api/license/activate
Content-Type: application/json

{
  "licenseKey": "XXXX-XXXX-XXXX-XXXX",
  "fingerprint": "machine-hardware-fingerprint",
  "machineName": "Office PC"
}

Create Checkout Session

POST /api/checkout
Content-Type: application/json

{
  "priceId": "price_...",
  "email": "customer@example.com"
}

Deployment

Vercel Deployment (Recommended)

Step 1: Prepare Your Repository

Ensure your code is pushed to GitHub:

git add .
git commit -m "Prepare for deployment"
git push origin main

Step 2: Import to Vercel

  1. Go to vercel.com/new
  2. Click Import Git Repository
  3. Select your GitHub repository (contpaqi-website)
  4. Vercel will auto-detect Next.js settings

Step 3: Configure Environment Variables

Before deploying, add these environment variables in Vercel:

Variable Description
DATABASE_URL PostgreSQL connection string (use Neon, Supabase, or Railway)
NEXTAUTH_SECRET Random secret (generate with openssl rand -base64 32)
NEXTAUTH_URL Your production URL (e.g., https://your-domain.com)
NEXT_PUBLIC_APP_URL Same as NEXTAUTH_URL
STRIPE_SECRET_KEY Stripe live secret key (sk_live_...)
STRIPE_PUBLISHABLE_KEY Stripe live publishable key (pk_live_...)
STRIPE_WEBHOOK_SECRET Stripe webhook signing secret (whsec_...)
RESEND_API_KEY Resend API key for emails
CRON_SECRET Secret for cron job authentication

Step 4: Deploy

Click Deploy and wait for the build to complete. Vercel will:

  • Install dependencies
  • Generate Prisma client
  • Build the Next.js application
  • Deploy to production

Step 5: Configure Stripe Webhook

After deployment, set up the Stripe webhook:

  1. Go to Stripe Dashboard > Webhooks
  2. Click Add endpoint
  3. Enter URL: https://your-domain.com/api/webhooks/stripe
  4. Select events: checkout.session.completed, customer.subscription.*, invoice.*
  5. Copy the signing secret and update STRIPE_WEBHOOK_SECRET in Vercel

Step 6: Verify Deployment

# Check health endpoint
curl https://your-domain.com/api/health

# Verify sitemap
curl https://your-domain.com/sitemap.xml

# Verify robots.txt
curl https://your-domain.com/robots.txt

Environment Variables Reference

# Required
DATABASE_URL="postgresql://..."
NEXTAUTH_SECRET="..."
NEXTAUTH_URL="https://your-domain.com"
NEXT_PUBLIC_APP_URL="https://your-domain.com"
STRIPE_SECRET_KEY="sk_live_..."
STRIPE_PUBLISHABLE_KEY="pk_live_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
RESEND_API_KEY="re_..."

# Stripe Price IDs
STRIPE_PRICE_STARTER_MONTHLY="price_..."
STRIPE_PRICE_STARTER_YEARLY="price_..."
STRIPE_PRICE_PROFESSIONAL_MONTHLY="price_..."
STRIPE_PRICE_PROFESSIONAL_YEARLY="price_..."

# Optional
SENTRY_DSN="https://..."
NEXT_PUBLIC_PLAUSIBLE_DOMAIN="your-domain.com"
NEXT_PUBLIC_GA_MEASUREMENT_ID="G-..."
CRON_SECRET="..."
EMAIL_FROM="ContPAQi AI Bridge <noreply@your-domain.com>"

Note: For detailed deployment instructions including database setup, troubleshooting, rollback procedures, and security best practices, see DEPLOYMENT.md.

License

Proprietary - All rights reserved.

ContPAQi AI Bridge Desktop App Installation

The ContPAQi AI Bridge desktop application requires Docker Desktop to run the AI services.

Prerequisites

  1. Docker Desktop (Required)

    • Download from: https://www.docker.com/products/docker-desktop/
    • System requirements:
      • Windows 10/11 64-bit (Pro, Enterprise, or Education)
      • WSL 2 backend enabled
      • 4GB RAM minimum (8GB recommended)
    • Install Docker Desktop and restart your computer
    • Launch Docker Desktop and wait for it to start (whale icon in system tray should be steady)
  2. Windows 10/11 (64-bit)

  3. .NET 6.0 Runtime (usually included with Windows)

Installation Steps

  1. Install Docker Desktop first - The installer will check for Docker and won't proceed without it
  2. Download the installer from the Download page or directly from GitHub Releases
  3. Run the installer as Administrator
  4. Follow the setup wizard
  5. Launch the application and activate your license

Troubleshooting

Issue Solution
"Docker Desktop: NOT INSTALLED" Install Docker Desktop and ensure it's running before launching the installer
Docker not starting Enable WSL 2 in Windows Features, restart, then launch Docker Desktop
Installer blocked by Windows Click "More info" → "Run anyway" (this is normal for new software)

Related

About

Sales website for ContPAQi AI Bridge - AI-powered invoice processing for Mexican accounting

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •