A fully production-ready, automated multichannel AI SaaS platform for fitness studios, built on top of a modern Next.js marketing site template.
Get the platform running locally in 5 minutes:
# 1. Clone the repository
git clone https://github.com/PilarSystems/pilarsystems.git
cd pilarsystems
# 2. Install dependencies
yarn install
# 3. Set up environment variables
cp .env.example .env.local
# Edit .env.local and fill in all required values (see ENV_SETUP.md for details)
# 4. Generate Prisma client and run migrations
npx prisma generate
npx prisma migrate dev
# 5. Create Stripe products (optional for local testing)
npx ts-node scripts/create-stripe-products.ts
# Copy the returned Price IDs to your .env.local
# 6. Start development server
yarn devOpen http://localhost:3000 to see the marketing site.
Navigate to http://localhost:3000/signup to test the SaaS platform.
π For detailed setup instructions, see ENV_SETUP.md
This repository contains two integrated applications:
- Marketing Site (
src/directory) - Modern Next.js 15 template with 20+ homepage variations - SaaS Platform (
app/directory) - Complete AI-powered fitness studio management system
- Complete Authentication System - Supabase Auth with email/password, magic link, password reset, and email verification
- Stripe Billing Integration - Full subscription management with setup fees (BASIC β¬100/mo + β¬500 setup, PRO β¬149/mo + β¬1000 setup, WhatsApp addon β¬20/mo)
- 7-Step Onboarding Wizard - Guided setup for studio information, integrations, and AI rules
- Comprehensive Dashboard - KPIs, charts, activity timeline, and analytics
- WhatsApp AI - Automated responses, lead qualification, and follow-up sequences
- Phone AI - Missed call handling, voicemail transcription, and AI summaries
- Email AI - Inbox classification, auto-replies, and lead conversion
- Lead Engine - Automatic A/B/C classification and prioritization
- Follow-up Engine - Multichannel automated sequences
- Leads Management - Unified inbox, detail pages, A/B/C classification
- Messages - WhatsApp and Email unified chat with AI auto-replies
- Phone AI - Call logs, transcripts, and AI-generated summaries
- Calendar - Event management with Google Calendar integration
- Growth Analytics - Conversion tracking, KPIs, and custom filters
- Settings - Studio info, team invites, AI rules, and billing portal
- WhatsApp Cloud API
- Twilio (Phone & SMS)
- Google Calendar OAuth
- Email IMAP/SMTP
- n8n Automation Workflows
- 20+ Homepage Variations - Different layouts and styles for various business needs
- 50+ Inner Pages - Authentication, pricing, blog, about, services, contact, and more
- 500+ Components - Reusable React components with modern design
- Dark/Light Mode - Seamless theme switching with next-themes
- Smooth Animations - GSAP and Lenis for premium interactions
- Responsive Design - Mobile-first approach with Tailwind CSS
- Frontend: Next.js 16 (App Router), React 19, TypeScript, Tailwind CSS 4, shadcn/ui
- Backend: Next.js API Routes, Prisma ORM
- Database: PostgreSQL (via Supabase)
- Authentication: Supabase Auth
- Payment: Stripe
- AI: OpenAI GPT-4 and GPT-4o-mini
- Animations: GSAP 3.13, Lenis smooth scrolling
- Maps: Leaflet with React integration
- Deployment: Vercel
The platform includes 12 comprehensive database tables:
- users, workspaces, subscriptions
- wizard_progress, integrations
- leads, messages, call_logs
- followups, calendar_events
- ai_rules, activity_logs, tasks
- Node.js 18+
- PostgreSQL database (or Supabase account)
- Stripe account
- OpenAI API key
- Twilio account (for phone integration)
- WhatsApp Business API access
- Google Cloud project (for Calendar API)
- Clone the repository:
git clone https://github.com/PilarSystems/pilarsystems.git
cd pilarsystems- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env.localEdit .env.local and fill in all required values (see .env.example for all 40+ required variables).
- Set up the database:
npx prisma generate
npx prisma migrate dev- Create Stripe products:
npx ts-node scripts/create-stripe-products.tsAdd the returned price IDs to your .env.local file.
- Run the development server:
npm run devOpen http://localhost:3000 in your browser.
See .env.example for all required environment variables. Key variables include:
DATABASE_URL- PostgreSQL connection stringNEXT_PUBLIC_SUPABASE_URL- Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY- Supabase anonymous keySUPABASE_SERVICE_ROLE_KEY- Supabase service role key
STRIPE_SECRET_KEY- Stripe secret keySTRIPE_WEBHOOK_SECRET- Stripe webhook signing secretNEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY- Stripe publishable key
OPENAI_API_KEY- OpenAI API keyTWILIO_ACCOUNT_SID- Twilio account SIDTWILIO_AUTH_TOKEN- Twilio auth tokenWHATSAPP_API_TOKEN- WhatsApp Business API tokenGOOGLE_CLIENT_ID- Google OAuth client IDGOOGLE_CLIENT_SECRET- Google OAuth client secret
ENCRYPTION_KEY- 64-character hex key for encrypting integration credentialsNEXTAUTH_SECRET- NextAuth secret for session encryption
-
Push to GitHub:
git push origin main
-
Import to Vercel:
- Go to Vercel Dashboard
- Click Add New β Project
- Import your GitHub repository
- Click Import
-
Configure Environment Variables:
- Go to Settings β Environment Variables
- Add ALL variables from
.env.local(see ENV_SETUP.md for complete list) - IMPORTANT: Add variables as plain environment variables, NOT as secret references
- Select environments: Production, Preview, Development
-
Deploy:
- Click Deploy
- Wait for build to complete
- Your app will be live at
https://your-project.vercel.app
-
Configure Webhooks:
- Update webhook URLs in Stripe, Twilio, and WhatsApp to use your production domain
- See ENV_SETUP.md for detailed instructions
-
Custom Domain (Optional):
- Go to Settings β Domains
- Add your custom domain
- Update
NEXT_PUBLIC_APP_URLenvironment variable
Before going live, ensure:
- All environment variables are set in Vercel
- Database migrations have been run
- Stripe products have been created
- Stripe webhooks are configured
- Twilio webhooks are configured (if using Phone AI)
- WhatsApp webhooks are configured (if using WhatsApp AI)
- Google Calendar OAuth is configured (if using Calendar sync)
- Custom domain is connected (optional)
- SSL certificate is active
- Test signup β checkout β onboarding β dashboard flow
π For detailed deployment instructions, see ENV_SETUP.md
pilarsystems/
βββ src/ # Marketing site (Next.js 15 template)
β βββ app/ # Marketing pages and routes
β βββ components/ # Marketing site components
β βββ data/ # Static content (blogs, services, team)
β βββ utils/ # Marketing site utilities
βββ app/ # SaaS Platform (Next.js App Router)
β βββ (auth)/ # Authentication pages
β βββ dashboard/ # Dashboard pages
β βββ onboarding/ # Onboarding wizard
β βββ checkout/ # Stripe checkout page
β βββ api/ # API routes
βββ components/ # SaaS platform components
βββ lib/ # Utility libraries
βββ services/ # Business logic services
βββ types/ # TypeScript type definitions
βββ prisma/ # Prisma schema and migrations
βββ scripts/ # Utility scripts
βββ n8n-workflows/ # n8n workflow exports
βββ public/ # Static assets
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
# Database
npx prisma generate # Generate Prisma client
npx prisma migrate dev # Run migrations
npx prisma studio # Open Prisma Studio
# Stripe
npm run stripe:setup # Create Stripe products
# Code Quality
npm run lint # Run ESLintFor issues and questions:
- SaaS Platform: support@pilarsystems.com
- Marketing Template: hello@pixel71.com
Proprietary - All rights reserved
Link to Devin run: https://app.devin.ai/sessions/231e7cbe34d34249a7244e67ec0eb2a9
Requested by: Freddi LΓΆrcher (ytraide@gmail.com) / @PilarSystems
Built with β€οΈ by PILAR SYSTEMS



