A self-hosted SaaS platform for service-based businesses (landscaping, HVAC, plumbing, cleaning, roofing, electrical) with Google Business Profile integration and white-label capabilities.
-
Authentication System
- Google OAuth with NextAuth
- Session management
- Multi-account support for GBP
- Account status detection (active/suspended)
- GBP access verification per account
-
Flexible Onboarding Flow
- Manual Business Setup - Create sites without Google Business Profile
- Google Business Profile Integration - Import existing GBP data
- Real Business Search - Search for businesses using Google Places API
- Access Verification - Check GBP ownership across multiple accounts
- Business information import with auto-detection
- Industry selection and confirmation
- Site preview mode before publishing
- Photo import from GBP
- Publishing workflow
- Resume onboarding after adding Google accounts
-
Google Integration
- Places API Integration - Real-time business search with caching
- Place Details API - Fetch comprehensive business information
- GBP Access Checking - Verify user has access to claimed businesses
- Post-Setup GBP Creation - Add Google Business Profile after site creation
- Multi-account Google authentication support
- Shared caching between API endpoints
- Cost-optimized API usage with field masking
-
Multi-Tenant Architecture
- Subdomain-based routing
- Tenant isolation
- Dynamic site generation
-
Site Generation & Management
- Industry-specific templates
- Content density adaptation
- Photo gallery support
- SEO-friendly structure
- Business hours management
- Service area configuration
- Logo upload with smart resizing
- Site deletion with optional GHL cleanup
-
GoHighLevel Integration
- API connection established
- Sub-account creation implemented
- Automated snapshot deployment
- Optional deletion when removing sites
- Webhook handling pending
- CRM features partially implemented
-
Site Editing
- Basic customization (colors, logo) complete
- SEO settings management
- Content editing pending
- Page builder pending
-
Business Tools
- Lead capture forms
- Appointment booking
- CRM integration
- Email automation
-
Enhanced Customization
- Logo upload β (completed)
- Font selection
- Multiple templates
- Layout options
-
Revenue Features
- Stripe billing
- Subscription management
- Usage tracking
- White-label options
- Node.js 18+
- Docker (for PostgreSQL)
- Google Cloud Console account (for OAuth and APIs)
- GoHighLevel Pro Plan (optional)
# Clone the repository
git clone [repository-url]
cd suitebusiness
# Install dependencies
npm install
# Copy environment variables
cp .env.local.example .env.local
# Edit .env.local with your credentials
# Start Docker containers
npm run docker:up
# Push database schema
npm run db:push
# Setup agency team structure
npm run setup:agency
# Add agency team members (they'll be synced to GHL)
npm run add-agency-member team@gmail.com "Team Member" admin
# Start development server
npm run dev
See .claude/commands.md
for full team management commands and GHL integration details.
See .env.local.example
for required variables:
DATABASE_URL
- PostgreSQL connectionNEXTAUTH_*
- Authentication setupGOOGLE_CLIENT_ID
&GOOGLE_CLIENT_SECRET
- OAuth credentialsGOOGLE_MAPS_API_KEY
- For Places API (business search)GHL_*
- GoHighLevel API keys (optional)
-
Create a Google Cloud Project
- Go to https://console.cloud.google.com
- Create a new project or select existing
-
Enable Required APIs
- Places API (New) - For business search
- Maps JavaScript API - For maps display (optional)
- Google Business Profile API - For GBP management
- Google My Business Account Management API
-
Create Credentials
- OAuth 2.0 Client ID (already setup for auth)
- Add authorized redirect URIs
- Download credentials
- API Key for Places API
- Restrict to specific APIs
- Add HTTP referrer restrictions
- OAuth 2.0 Client ID (already setup for auth)
-
Configure API Key Security
- Restrict to your domains
- Limit to required APIs only
- Use environment variables
- Frontend: Next.js 15, React, Tailwind CSS
- Backend: Next.js API Routes
- Database: PostgreSQL with Prisma ORM
- Auth: NextAuth with Google OAuth
- Styling: Tailwind CSS v4, shadcn/ui
- Validation: Zod
- Forms: React Hook Form
/app # Next.js 15 app directory
/(app) # Authenticated app routes
/(auth) # Auth pages
/api # API endpoints
/onboarding # Onboarding flow
/preview # Site preview
/s/[subdomain] # Client sites
/components # React components
/lib # Core utilities
/prisma # Database schema
/public # Static assets
/docs # Documentation
- Multi-tenancy via subdomains - Each client gets subdomain.domain.com
- Self-hosted first - No cloud dependencies required
- Industry-specific - Templates and features per industry
- API-first - Clean separation of concerns
- Type-safe - Full TypeScript with Prisma
npm run dev # Start dev server
npm run build # Production build
npm run start # Start production
npm run db:studio # Prisma Studio GUI
npm run db:push # Update database
npm run docker:up # Start PostgreSQL
npm run docker:down # Stop PostgreSQL
- ZERO technical debt policy - Fix issues immediately
- No console.log - Use logger.ts instead
- No TODOs - Complete tasks or track in issues
- Native APIs - Prefer fetch over axios
- File consolidation - Update existing files when possible
Currently using manual testing. Automated tests planned:
- Unit tests with Jest
- E2E tests with Playwright
- API tests with Supertest
-
With Google Business Profile
- User signs in with Google
- Searches for or selects their business
- Imports business data automatically
- Confirms industry and details
- Site is created with rich content
-
Without Google Business Profile
- User provides business information manually
- Configures business hours
- Adds services and descriptions
- Site is created immediately
- Can add GBP later from dashboard
- Autocomplete Search - Real-time suggestions as users type
- Google-like Experience - Familiar dropdown interface
- Rich Business Data - Shows ratings, reviews, and verification status
- Smart Caching - Reduces API costs with intelligent caching
- Session Tokens - Optimized billing with autocomplete sessions
- Fallback Options - Manual entry if business not found
/CLAUDE.md
- AI assistant guidelines/docs/ONBOARDING_IMPLEMENTATION_SUMMARY.md
- Onboarding details/docs/SITE_INFRASTRUCTURE.md
- Site rendering system/docs/ONBOARDING_FLOW_PLAN.md
- Original implementation plan
API endpoints follow RESTful conventions:
GET /api/sites
- List user's sitesPOST /api/sites
- Create new site (manual or GBP)POST /api/sites/create-from-gbp
- Create from GBP with GHL integrationPOST /api/sites/[id]/publish
- Publish sitePOST /api/sites/upload-logo
- Upload and resize logoDELETE /api/sites/[id]
- Delete site (with optional GHL deletion)GET /api/gbp/accounts
- List connected Google accountsGET /api/gbp/my-locations
- Get user's GBP locationsPOST /api/gbp/search
- Search for businessesPOST /api/gbp/place-details
- Get detailed place infoPOST /api/gbp/check-access
- Verify GBP accessPOST /api/gbp/check-ownership
- Check business ownershipPOST /api/gbp/create-location
- Create new GBP listing
- Read
/CLAUDE.md
for code standards - Check open issues for tasks
- Follow existing patterns
- Test thoroughly
- Update documentation
- Create feature branch
- Implement with zero technical debt
- Test all edge cases
- Update relevant docs
- Submit PR with clear description
Google OAuth Setup
- Enable Google+ API in Cloud Console
- Add authorized redirect URIs
- Set correct scopes for GBP access
Database Connection
- Ensure Docker is running
- Check DATABASE_URL format
- Run
npm run db:push
after schema changes
Subdomain Routing
- Add subdomains to /etc/hosts for local dev
- Configure DNS for production
- Check middleware.ts for routing logic
[License Type] - See LICENSE file
For developers continuing this project:
- Read
/docs/ONBOARDING_IMPLEMENTATION_SUMMARY.md
- Check
/CLAUDE.md
for standards - Pick a feature from "Planned Features"
- Follow existing patterns
- Maintain zero technical debt
- β Fixed GBP access checking across multiple accounts
- β Added account status badges (suspended/no GBP)
- β Implemented site deletion with optional GHL cleanup
- β Fixed auth redirect flow to preserve context
- β Added shared caching system for API optimization
- β Implemented logo upload with smart resizing
- β Enhanced error handling and logging throughout
Last Updated: December 22, 2024 Status: Active Development