Skip to content

kimhons/KetoWell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

53 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

KetoWell

Transform Your Health with the Science of Ketogenic Living

πŸ—οΈ Monorepo Structure

This repository is organized as a monorepo containing multiple packages:

KetoWell/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ web/              # React web application
β”‚   β”œβ”€β”€ mobile/           # Flutter mobile app (coming soon)
β”‚   └── shared/           # Shared code and types
β”œβ”€β”€ docs/                 # Documentation
β”œβ”€β”€ scripts/              # Build and deployment scripts
└── README.md             # This file

πŸ“¦ Packages

Web Application (packages/web)

Full-featured web application built with React, Express, and TypeScript.

Tech Stack:

  • Frontend: React 19, Tailwind CSS 4, shadcn/ui
  • Backend: Express.js, tRPC
  • Database: MySQL with Drizzle ORM
  • Payment: Stripe
  • Email: Resend
  • AI: OpenAI GPT-4

Features:

  • Book purchase and delivery system
  • Referral rewards program
  • Social sharing integration
  • Email notifications
  • Analytics tracking
  • User authentication

View Web App Documentation β†’

Mobile Application (packages/mobile)

🚧 Coming Soon - Flutter mobile app for iOS and Android.

View Mobile App Documentation β†’

Shared Package (packages/shared)

Common types, constants, and utilities shared between web and mobile apps.

View Shared Package Documentation β†’

πŸš€ Quick Start

Prerequisites

  • Node.js 22.x or higher
  • pnpm 9.x or higher
  • MySQL database

Installation

# Clone the repository
git clone https://github.com/kimhons/KetoWell.git
cd KetoWell

# Install dependencies
pnpm install

# Set up environment variables
cp packages/web/.env.example packages/web/.env
# Edit packages/web/.env with your configuration

# Push database schema
pnpm db:push

# Start development server
pnpm dev

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

πŸ“š Documentation

πŸ› οΈ Development

Workspace Commands

# Run web app in development mode
pnpm dev:web

# Build web app for production
pnpm build:web

# Run tests across all packages
pnpm test

# Lint all packages
pnpm lint

# Format code
pnpm format

# Database operations
pnpm db:push        # Push schema changes
pnpm db:studio      # Open Drizzle Studio

Package-Specific Commands

# Work on a specific package
cd packages/web
pnpm dev

# Or use workspace filter
pnpm --filter web dev

πŸ—οΈ Architecture

Web Application

packages/web/
β”œβ”€β”€ client/           # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ pages/        # Page components
β”‚   β”‚   β”œβ”€β”€ components/   # Reusable components
β”‚   β”‚   β”œβ”€β”€ lib/          # Utilities and helpers
β”‚   β”‚   └── hooks/        # Custom React hooks
β”‚   └── public/       # Static assets
β”œβ”€β”€ server/           # Express backend
β”‚   β”œβ”€β”€ routes/       # API routes
β”‚   β”œβ”€β”€ _core/        # Core server setup
β”‚   └── db.ts         # Database connection
β”œβ”€β”€ drizzle/          # Database schema
└── shared/           # Shared types

Database Schema

Key Tables:

  • users - User accounts and authentication
  • book_purchases - Book purchase records
  • referral_codes - Referral code generation
  • referral_tracking - Referral usage tracking

View Full Schema Documentation β†’

πŸ’³ Stripe Integration

The application uses Stripe for payment processing:

  1. Book Sales: One-time $9.99 purchases
  2. Checkout Flow: Stripe Checkout for secure payments
  3. Email Delivery: Automatic purchase confirmation emails
  4. Download Access: Secure PDF download links

View Stripe Integration Guide β†’

🎁 Referral System

Viral growth engine with automatic reward generation:

  • Referral Codes: Unique codes for each purchaser (BOOKREF-XXXXX)
  • Tracking: Automatic referral attribution via URL parameters
  • Rewards: 20% off KetoWell Premium for 3 months per referral
  • Limits: 10 referrals per code, 90-day expiration

View Referral System Guide β†’

πŸ“Š Analytics

Comprehensive tracking with Google Analytics 4:

  • Page Views: Track all page visits
  • Events: Custom events for user actions
  • Conversions: Purchase and referral tracking
  • Funnels: Conversion funnel visualization

View Analytics Guide β†’

🌐 Deployment

Web Application

The web app can be deployed to any platform that supports Node.js:

  • Recommended: Vercel, Railway, Render
  • Requirements: Node.js 22+, MySQL database
  • Environment Variables: See packages/web/.env.example

Database

  • Production: MySQL 8.0+
  • Migrations: Handled by Drizzle Kit
  • Backups: Recommended daily backups

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

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

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ”— Links

πŸ™ Acknowledgments

  • Built with Manus - AI-powered development platform
  • UI components from shadcn/ui
  • Icons from Lucide
  • Powered by Stripe for payments

Made with ❀️ by the KetoWell Team

About

KetoWell - Transform Your Health with the Science of Ketogenic Living. Evidence-based ketogenic health platform with AI-powered guidance, comprehensive book, and referral rewards system.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages