Skip to content

Heaney-Investments/Live-Smart-Growth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

41 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SmartGrowth Grants & Services – Full Stack Web App

πŸš€ Overview

SmartGrowth is a modern, full-stack web application that empowers small businesses to discover, apply for, and leverage growth grants (up to $10,000) and professional services. The platform features a seamless multi-step grant application, a robust service marketplace, a dynamic blog, and deep integration with Wix and Supabase for data, automation, and content management.


πŸ–₯️ Live Demo

URL: [Your Production URL Here]


✨ Key Features

  • Grant Application Wizard: 9-step, user-friendly survey to determine grant eligibility and maximize bonus earnings.
  • Service Marketplace: Browse, filter, and purchase digital marketing, AI automation, consulting, and print services.
  • Wix Blog Integration: Dynamic blog with categories, featured posts, and rich content, synced from Wix.
  • Wix API Integration: Real-time sync for products, bookings, events, and contacts.
  • Admin Dashboard: Monitor sync status, manage content, and trigger manual or automated syncs.
  • Responsive UI: Mobile-first, accessible, and brand-consistent design.
  • Authentication: Supabase Auth and custom SmartGrowth Auth.
  • Edge Functions: Serverless backend for data sync, validation, and automation.
  • Testing Suite: Robust, organized, and extensible test system for frontend, backend, and data integrity.

πŸ› οΈ Tech Stack

  • Frontend: React 18, TypeScript, Vite, shadcn/ui, Tailwind CSS, Radix UI, React Router, React Query, Zod, React Hook Form
  • Backend: Supabase (PostgreSQL, Edge Functions), Wix REST APIs, Node.js
  • State Management: React Query, Context API
  • Testing: Custom scripts, Jest/Vitest (unit), Playwright/Cypress (E2E), data validation, integration, and debug tools

πŸ“¦ Project Structure

src/
  components/      # UI, forms, features, Wix, auth, layout, navigation, survey
  contexts/        # React contexts (App, Auth, SmartGrowth)
  hooks/           # Custom hooks (Wix, Supabase, Survey, etc.)
  integrations/    # Third-party integrations (Supabase, Wix)
  lib/             # Utility libraries and validation
  pages/           # All page-level components (Home, Survey, Blog, Packages, etc.)
  services/        # API and backend service logic (Wix, Supabase, Blog, Sync)
  types/           # TypeScript types
  utils/           # Utility functions
test/
  unit/            # (Jest/Vitest unit tests)
  integration/     # Integration/data validation scripts (see below)
  e2e/             # (Playwright/Cypress E2E tests)
  data-validation/ # Data cleanup, migration, validation
  debug/           # Debug and environment scripts
  results/         # Test results, logs, coverage

πŸ§‘β€πŸ’» Local Development

1. Clone & Install

git clone <YOUR_GIT_URL>
cd growth-grant-wizard
npm install

2. Environment Setup

Copy and edit .env:

cp .env.example .env

Set your Supabase and Wix credentials:

VITE_SUPABASE_URL=...
VITE_SUPABASE_ANON_KEY=...
VITE_WIX_API_KEY=...
VITE_WIX_SITE_ID=...
SUPABASE_SERVICE_ROLE_KEY=...

3. Run the App

npm run dev

Visit http://localhost:5173 (or as shown in your terminal).


πŸ—οΈ Backend & Integration

  • Supabase: Used for authentication, data storage, and edge functions.
  • Wix APIs: Used for products, bookings, events, contacts, and blog content.
  • Edge Functions: Automated and manual sync for all major entities.
  • Blog System: Blog posts are synced from Wix, stored in Supabase, and rendered with rich content and SEO.

See docs/README_WIX_INTEGRATION.md and docs/WIX_BACKEND_SETUP.md for full backend and integration setup.


🧩 Frontend Features

  • Home Page: Hero, features, service highlights, and CTAs.
  • Survey: 9-step grant application with progress, bonus tracking, and validation.
  • Packages/Services: Browse and purchase digital, AI, consulting, and print services.
  • Blog: Dynamic, filterable, and SEO-optimized blog synced from Wix.
  • Admin/Dashboard: Monitor sync status, trigger syncs, and view data health.
  • Authentication: Secure login/signup with Supabase and custom flows.
  • Responsive Design: Fully mobile-optimized and accessible.

πŸ§ͺ Testing & Quality

Test Directory Structure

  • unit/ – (to be added) Unit tests for components and services (Jest/Vitest)
  • integration/ – Integration/data validation scripts:
    • check-services.js – Service table checks (local/remote, REST/client, summary, breakdown)
    • check-products.js – Product table checks, sync status, and sync function
    • check-wix-sync.js – Run all sync edge functions
    • check-synced-data.js – Validate all local Wix data
    • check-synced-services.js – Service sync validation
    • check-sync-status.js – Print latest sync status
    • verify-database.js – Comprehensive DB CRUD/schema test
  • e2e/ – (to be added) End-to-end browser tests (Playwright/Cypress)
  • data-validation/ – Data cleanup, migration, and validation scripts
  • debug/ – Debug and environment scripts
  • results/ – Test results, logs, and coverage

Running Tests

# Example: Check all services (prod)
node test/integration/check-services.js

# Example: Check all products and sync status (local)
node test/integration/check-products.js --local --sync-status

# Example: Run all sync edge functions
node test/integration/check-wix-sync.js

# Example: Validate all synced data
node test/integration/check-synced-data.js

πŸš€ Deployment

  • Vercel/Netlify/Custom: Standard Vite/React deployment.
  • Supabase: Deploy edge functions and configure environment variables.
  • Wix: Set up API keys, webhooks, and CORS as described in the docs.

πŸ”’ Security & Best Practices

  • All API keys and secrets are stored in environment variables.
  • Supabase RLS (Row Level Security) is enabled for all sensitive tables.
  • Edge functions use service role keys and are never exposed to the frontend.
  • Regular audits and monitoring for API usage and data integrity.

πŸ“š Documentation


🀝 Contributing

  • Fork the repo and create a feature branch.
  • Add/modify code and tests.
  • Run all tests and linting before submitting a PR.
  • Document new features and update the README as needed.

πŸ“ License

MIT


Ready for the next step? Clone, configure, and start building with SmartGrowth!

Automated Dependency Management, CI/CD, and Publishing Setup

This project is configured for robust dependency management, automated testing, and package publishing using GitHub Actions and Renovate. Below is an overview of the key files and how to use them.

File Overview

1. package.json & package-lock.json

  • Purpose: Define project metadata, dependencies, scripts, and lock dependency versions for reproducibility and security.
  • Usage:
    • Add dependencies with npm install <package>.
    • Run tests with npm test.
    • Build with npm run build.

2. .npmrc

  • Purpose: Configures npm to use GitHub Packages as the registry and authenticates using the GITHUB_TOKEN.
  • Usage:
    • Required for publishing and installing packages from GitHub Packages.
    • No manual changes needed unless your username or registry changes.

3. renovate.json

  • Purpose: Configures Renovate to automate dependency updates.
  • Key Features:
    • Weekly checks for updates (Monday 2am UTC).
    • Minor/patch updates are grouped and auto-merged if tests pass.
    • Major updates require manual review.
    • Supports npm and GitHub Actions dependencies.
    • Runs tests before merging PRs.
    • Supports monorepos (grouping updates across multiple package.json files).

4. .github/workflows/dependency-updates.yml

  • Purpose: Runs Renovate weekly to check for and PR dependency updates.
  • Usage:
    • PRs are created for updates, with changelogs and test results.
    • Minor/patch updates may be auto-merged if tests pass.

5. .github/workflows/build-and-test.yml

  • Purpose: Runs on PRs and pushes to ensure all code builds and tests pass before merging.
  • Usage:
    • Installs dependencies, builds the project, and runs tests.
    • Required for PRs created by Renovate or contributors.

6. .github/workflows/publish.yml

  • Purpose: Publishes the package to GitHub Packages on pushes to release branches or tags.
  • Usage:
    • Triggered by pushes to release/** branches or tags like v1.2.3.
    • Uses the GITHUB_TOKEN for secure authentication.

Setup Instructions

  1. Install dependencies:
    npm install
  2. Run tests locally:
    npm test
  3. Build the project:
    npm run build
  4. Publishing:
    • Push to a release/* branch or tag a commit (e.g., v1.0.0) to trigger publishing.

Security & Best Practices

  • All workflows use GITHUB_TOKEN for authentication (no personal tokens needed).
  • Dependencies are pinned in package-lock.json for security.
  • Workflows run on ubuntu-latest for compatibility and security.
  • Dependency caching is enabled for faster CI runs.

Monorepo Support

  • Renovate is configured to group updates across multiple package.json files if present.
  • For monorepos, ensure each package has its own package.json and lock file.

References


This setup ensures your Node.js project is always up-to-date, secure, and reliably published with minimal manual intervention.

About

Live Smart Growth - A comprehensive platform for business growth and grant management

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •