Skip to content

teacupweb/teacup

Repository files navigation

Teacup - No-Code SaaS Platform

Teacup is a 100% no-code SaaS platform for retail, ecommerce, and service businesses who want a powerful website without technical headaches. Launch a fast, professional site that boosts customer acquisition automatically.

🎯 What Teacup Can Do

Teacup is designed to be a comprehensive website management platform that enables businesses to:

  • Create and Manage Websites - Build professional websites without coding knowledge
  • Blog Management - Create, edit, and publish blog posts with a rich text editor
  • Customer Communication - Manage multiple contact inboxes to handle customer inquiries
  • Analytics Tracking - Monitor website performance with detailed analytics dashboards
  • AI-Powered Assistance - Get help with website tasks through the "Hold My Tea" AI assistant
  • Multi-User Collaboration - Share website access with team members
  • Custom Domains - Connect your own domain to your Teacup-powered website
  • Subscription Management - Offer monthly or lifetime subscription plans

βœ… What's Currently Implemented

Public Features (Fully Functional)

  • βœ… Landing Page - Professional homepage with hero section and call-to-action
  • βœ… Authentication System - Complete user registration and login via Supabase
  • βœ… About Page - Company information and mission statement
  • βœ… Pricing Page - Display of subscription plans (Monthly $40/month, Lifetime $500)
  • βœ… Blog Listing - Public blog posts with category filtering (demo data)
  • βœ… Individual Blog Posts - Full blog post view with author info (demo data)
  • βœ… Responsive Design - Mobile-friendly interface across all pages
  • βœ… Theme Support - Dark/light mode toggle

Dashboard Features (Backend-Connected)

  • βœ… Main Dashboard - Overview of company data, recent messages, and blog posts
  • βœ… Blog Management - Full CRUD operations for blog posts
    • Create new blog posts with rich text editor (Quill)
    • Edit existing blog posts
    • Delete blog posts
    • View all user blogs
  • βœ… Inbox Management - Complete inbox system
    • Create multiple inboxes for different purposes
    • View messages in each inbox
    • Delete inboxes and messages
    • Latest messages overview on dashboard
  • βœ… Analytics Dashboard - Track website performance
    • Page view analytics
    • Form submission tracking
    • Button click tracking
    • Interactive charts with date range filtering
  • βœ… Company Management - Manage company information and settings
  • βœ… AI Assistant ("Hold My Tea") - AI-powered help for website tasks
  • βœ… Settings Page - User preferences and profile management

Demo/Placeholder Features (Not Yet Connected)

  • ⚠️ Contact Form - Form UI exists but doesn't submit to backend
  • ⚠️ Checkout Page - Payment form UI exists but no payment processing
  • ⚠️ Order Free Site - Form exists but doesn't process orders
  • ⚠️ Welcome Page - Onboarding UI exists but limited functionality

πŸš€ Tech Stack

Frontend

  • Framework: Next.js 16 (App Router) with TypeScript
  • Styling: TailwindCSS v4 with custom components
  • State Management: React Query (@tanstack/react-query) for server state
  • UI Components:
    • Radix UI primitives for accessibility
    • Custom shadcn/ui inspired components
    • Lucide React icons
  • Rich Text Editor: Quill for blog post creation
  • Charts: Recharts for analytics visualization
  • Forms: React Hook Form with Zod validation
  • Notifications: Sonner toast notifications

Backend Integration

  • Authentication: Supabase Auth (fully integrated)
  • API: Custom REST API (configured via BACKEND env var)
  • Data Fetching: React Query with automatic caching and revalidation

Development Tools

  • Language: TypeScript
  • Linting: ESLint
  • Package Manager: npm

πŸ“ Project Structure

src/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ page.tsx                 # Landing page
β”‚   β”œβ”€β”€ layout.tsx               # Root layout
β”‚   β”œβ”€β”€ providers.tsx            # React Query & Theme providers
β”‚   β”œβ”€β”€ auth/                    # Authentication pages
β”‚   β”‚   β”œβ”€β”€ login/              # Login page
β”‚   β”‚   └── signup/             # Signup page
β”‚   β”œβ”€β”€ dashboard/              # Protected dashboard routes
β”‚   β”‚   β”œβ”€β”€ page.tsx            # Main dashboard
β”‚   β”‚   β”œβ”€β”€ layout.tsx          # Dashboard layout with sidebar
β”‚   β”‚   β”œβ”€β”€ analytics/          # Analytics dashboard
β”‚   β”‚   β”œβ”€β”€ blogs/              # Blog management
β”‚   β”‚   β”‚   β”œβ”€β”€ new/           # Create new blog
β”‚   β”‚   β”‚   └── edit/[id]/     # Edit blog
β”‚   β”‚   β”œβ”€β”€ inboxes/           # Inbox management
β”‚   β”‚   β”‚   └── [id]/          # Individual inbox view
β”‚   β”‚   └── settings/          # Settings page
β”‚   β”œβ”€β”€ blogs/                  # Public blog pages
β”‚   β”‚   β”œβ”€β”€ page.tsx           # Blog listing
β”‚   β”‚   └── [id]/              # Individual blog post
β”‚   β”œβ”€β”€ about/                  # About page
β”‚   β”œβ”€β”€ contact/                # Contact page
β”‚   β”œβ”€β”€ pricing/                # Pricing page
β”‚   β”œβ”€β”€ checkout/               # Checkout page
β”‚   β”œβ”€β”€ order-site/             # Free site order page
β”‚   └── welcome/                # Welcome/onboarding page
β”œβ”€β”€ components/                  # Reusable UI components
β”‚   β”œβ”€β”€ ui/                     # Base UI components (buttons, cards, etc.)
β”‚   β”œβ”€β”€ app-sidebar.tsx         # Dashboard sidebar
β”‚   β”œβ”€β”€ dashboard-content.tsx   # Main dashboard content
β”‚   β”œβ”€β”€ data-table.tsx          # Reusable data table
β”‚   └── chart-area-interactive.tsx # Interactive charts
β”œβ”€β”€ Components/                  # Legacy components (mixed case)
β”‚   β”œβ”€β”€ Navbar.tsx              # Main navigation
β”‚   β”œβ”€β”€ Footer.tsx              # Page footer
β”‚   β”œβ”€β”€ HoldMyTea.tsx           # AI assistant component
β”‚   β”œβ”€β”€ Modal.tsx               # Modal component
β”‚   └── ThemeToggle.tsx         # Theme switcher
β”œβ”€β”€ Dashboard/                   # Dashboard-specific components
β”‚   β”œβ”€β”€ Dashboard.tsx           # Dashboard wrapper
β”‚   β”œβ”€β”€ Inboxes.tsx            # Inbox list component
β”‚   β”œβ”€β”€ Inbox.tsx              # Individual inbox component
β”‚   └── Analytics/             # Analytics components
β”‚       β”œβ”€β”€ Analytics.tsx      # Analytics wrapper
β”‚       β”œβ”€β”€ AnalyticsClient.tsx # Analytics client component
β”‚       └── Chart.tsx          # Chart component
β”œβ”€β”€ lib/                        # Utility libraries
β”‚   β”œβ”€β”€ analytics.ts           # Analytics utilities
β”‚   β”œβ”€β”€ blogs.ts               # Blog utilities
β”‚   └── utils.ts               # General utilities
β”œβ”€β”€ hooks/                      # Custom React hooks
β”‚   └── use-mobile.ts          # Mobile detection hook
β”œβ”€β”€ backendProvider.tsx         # API integration layer (React Query)
β”œβ”€β”€ AuthProvider.tsx            # Authentication context
β”œβ”€β”€ ThemeProvider.tsx           # Theme context
β”œβ”€β”€ supabaseClient.ts           # Supabase client configuration
└── envData.ts                  # Environment variables

public/
β”œβ”€β”€ Assets/                     # Static assets
β”‚   β”œβ”€β”€ icon.png               # App icon
β”‚   β”œβ”€β”€ icon-beside.png        # Alternative icon
β”‚   └── favicon.ico            # Favicon
β”œβ”€β”€ _redirects                  # Netlify redirects
└── netlify.toml               # Netlify configuration

πŸ”Œ Backend API Integration

The backendProvider.tsx file contains all API integration hooks using React Query.

API Configuration

  • Base URL: process.env.BACKEND || 'http://localhost:8000'
  • Authentication: Uses Supabase auth tokens in request headers
  • Caching: React Query handles automatic caching and revalidation

Available API Hooks

Blog Management

useUserBlogs(companyId); // GET /dashboard/blogs/${companyId}
useBlog(companyId, id); // GET /dashboard/blogs/${companyId}/${id}
useCreateBlog(); // POST /dashboard/blogs
useUpdateBlog(); // PUT /dashboard/blogs/${id}
useDeleteBlog(); // DELETE /dashboard/blogs/${id}

Inbox Management

useUserInboxes(companyId); // GET /dashboard/inbox/${companyId}
useCreateInbox(); // POST /dashboard/inbox
useDeleteInbox(); // DELETE /dashboard/inbox/${id}
useInboxData(id); // GET /dashboard/inbox/data/${id}
useDeleteInboxData(); // DELETE /dashboard/inbox/data/${id}
useLatestMessages(companyId, limit); // Aggregated latest messages

Company Management

useCompany(companyId); // GET /dashboard/company/${companyId}
useCreateCompany(); // POST /dashboard/company
useUpdateCompany(); // PUT /dashboard/company/${id}

Analytics

useAnalytics(owner, event); // GET /api/analytics/${owner}?event=${event}
useTrackAnalytics(); // POST /api/analytics

AI Assistant

useHoldMyTea(owner, question); // POST /holdmytea/ask

Data Types

export type blogType = {
  id?: number;
  title: string;
  image: string;
  data: string;
  owner: string;
};

export type inboxType = {
  id?: number;
  owner: string;
  name: string;
};

export type CompanyType = {
  id?: string;
  name: string;
  owner: string;
  domain: string;
  activity_data?: ActivityDataType[];
  info?: InfoItemType[];
  sharing?: SharingMemberType[];
  key: string;
};

export type ActivityDataType = {
  day: string;
  visits: number;
};

export type InfoItemType = {
  icon: string;
  title: string;
  data: string[] | number;
  description: string;
};

export type SharingMemberType = {
  name: string;
  email: string;
  status: string;
};

πŸ—οΈ Development Setup

Prerequisites

  • Node.js (Latest LTS version recommended)
  • npm or yarn
  • Supabase account (for authentication)
  • Backend API server (optional for full functionality)

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd teacupnet
  2. Install dependencies:

    npm install
  3. Environment variables: Create a .env.local file in the root directory:

    # Backend API URL (optional - defaults to localhost:8000)
    BACKEND=http://localhost:8000
    
    # Supabase Configuration (required for authentication)
    NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
    SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
  4. Run development server:

    npm run dev

    The application will be available at http://localhost:3000

  5. Build for production:

    npm run build
    npm start

Development Commands

npm run dev      # Start development server
npm run build    # Build for production
npm start        # Start production server
npm run lint     # Run ESLint

πŸ” Authentication

The application uses Supabase for authentication with the following features:

  • Email/Password Authentication - Traditional login/signup
  • Social Authentication - Support for OAuth providers (configurable in Supabase)
  • Session Management - Automatic token refresh and session persistence
  • Protected Routes - All /dashboard/* routes require authentication
  • Auth Context - Global authentication state via AuthProvider.tsx

Authentication Flow

  1. User signs up or logs in via /auth/login or /auth/signup
  2. Supabase handles authentication and returns user session
  3. Session token is stored and used for API requests
  4. Protected routes check authentication status before rendering
  5. Unauthenticated users are redirected to login page

🎨 UI Components

The application uses a comprehensive component system:

Base Components (shadcn/ui inspired)

Custom Components

Dashboard Components

πŸ“Š Key Features Breakdown

1. Blog Management System

  • Rich Text Editor: Quill-based editor with formatting options
  • Image Upload: Support for blog post images
  • CRUD Operations: Create, read, update, delete blog posts
  • Draft System: Save drafts before publishing
  • Category Support: Organize blogs by categories
  • Public View: Separate public-facing blog pages

2. Inbox Management

  • Multiple Inboxes: Create separate inboxes for different purposes
  • Message Viewing: View all messages in each inbox
  • Message Management: Delete individual messages or entire inboxes
  • Dashboard Integration: Latest messages shown on main dashboard
  • Real-time Updates: React Query keeps data fresh

3. Analytics Dashboard

  • Event Tracking: Track page views, form submissions, button clicks
  • Interactive Charts: Recharts-powered visualizations
  • Date Range Filtering: View analytics for specific time periods
  • Multiple Event Types: Separate tracking for different event types
  • Visual Insights: Area charts, bar charts, and trend lines

4. AI Assistant ("Hold My Tea")

  • Natural Language Interface: Ask questions in plain English
  • Website Help: Get assistance with website-related tasks
  • Modal Interface: Clean, focused interaction design
  • Loading States: Visual feedback during AI processing
  • Success Notifications: Confirmation when tasks complete

5. Company Management

  • Company Profiles: Store company information
  • Domain Management: Connect custom domains
  • Activity Tracking: Monitor company activity
  • Team Collaboration: Share access with team members
  • Settings Management: Configure company preferences

πŸš€ Deployment

Netlify Deployment (Recommended)

The project is pre-configured for Netlify deployment:

  1. Connect Repository: Link your Git repository to Netlify
  2. Configure Build Settings:
    • Build command: npm run build
    • Publish directory: .next
    • Node version: 18.x or higher
  3. Environment Variables: Add all required environment variables in Netlify dashboard
  4. Deploy: Netlify will automatically build and deploy

Configuration files:

Other Deployment Options

The application can also be deployed to:

  • Vercel - Native Next.js support
  • AWS Amplify - Full-stack deployment
  • Docker - Containerized deployment
  • Traditional Hosting - Build and serve static files

πŸ“ Current Limitations & Future Enhancements

Current Limitations

  • Payment processing is not implemented (checkout page is UI only)
  • Contact form doesn't submit to backend
  • Free site order form is not functional
  • Some demo data is hardcoded (public blog posts)
  • Welcome page has limited functionality

Planned Enhancements

  • Functional contact form with email notifications
  • Website builder interface
  • Template marketplace
  • Advanced SEO tools
  • Email marketing integration
  • Custom form builder
  • E-commerce functionality
  • Multi-language support
  • Advanced analytics (conversion tracking, A/B testing)

πŸ”§ Configuration

Theme Configuration

The application supports dark and light themes via ThemeProvider.tsx. Theme preference is persisted in localStorage.

API Configuration

Backend API URL is configured via environment variable:

const API_URL = process.env.BACKEND || 'http://localhost:8000';

Supabase Configuration

Supabase client is configured in supabaseClient.ts using environment variables.

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Use existing component patterns
  • Write meaningful commit messages
  • Test thoroughly before submitting PR
  • Update documentation for new features

πŸ“„ License

[Add your license information here]

πŸ†˜ Support

For support, please:

  • Open an issue on GitHub
  • Contact the development team
  • Check the documentation

πŸ™ Acknowledgments

  • Built with Next.js and React
  • UI components inspired by shadcn/ui
  • Icons by Lucide and Tabler Icons
  • Authentication by Supabase
  • Charts by Recharts

Version: 0.0.0
Last Updated: February 2026
Status: Active Development

Releases

No releases published

Packages

 
 
 

Contributors

Languages