A full-stack web application for managing lemonade stands and their products. This project allows users to create and manage their own lemonade stands, add products, and view other stands on an interactive map.
- Features
- Live Site
- Technology Stack
- Architecture
- Getting Started
- Supabase Setup
- Known Issues and Fixes
- Usage
- Deployment
- CI/CD Pipeline
- Performance Optimizations
- Testing
- Contributing
- License
-
User Authentication
- Secure signup, login, and password reset
- Social login options (Google, GitHub)
- Protected routes for authenticated users
-
Lemonade Stand Management
- Create and manage multiple lemonade stands
- Upload stand images
- Set stand location with interactive map
- Automatic stand expiration after 24 hours (with extension option)
-
Product Management
- Add, update, and remove products for each stand
- Set product prices, descriptions, and availability
- Upload product images
-
Interactive Map
- View all active stands on a map
- Filter stands by proximity
- Get directions to stands
-
Real-time Updates
- Live updates when data changes
- Notifications for stand owners
-
Responsive Design
- Works on desktop, tablet, and mobile devices
- Optimized user experience across all screen sizes
Visit the live application: Lemonade Map App
- React 19 - UI library
- React Router 7 - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- Leaflet/React-Leaflet - Interactive maps
- Vite - Build tool and development server
- Supabase - Backend-as-a-Service platform
- PostgreSQL database
- Authentication
- Storage
- Real-time subscriptions
- Edge Functions
The application follows a modern architecture pattern with a clear separation of concerns:
The React application is structured as follows:
/lemonade-map
├── public/ # Static assets
├── src/
│ ├── api/ # API functions for Supabase
│ ├── components/ # Reusable UI components
│ ├── contexts/ # React context providers
│ ├── hooks/ # Custom React hooks
│ ├── pages/ # Page components
│ ├── services/ # Service modules
│ ├── styles/ # Global styles
│ ├── utils/ # Utility functions
│ ├── App.js # Main application component
│ ├── index.js # Application entry point
│ └── supabaseClient.js # Supabase client configuration
The Supabase backend includes:
/supabase
├── migrations/ # Database migration scripts
│ ├── 01_create_users_table.sql
│ ├── 02_create_stands_table.sql
│ ├── 03_create_products_table.sql
│ ├── 04_storage_policies.sql
│ └── 05_stand_expiration.sql
├── functions/ # Edge Functions
│ └── cleanup-expired-stands/
├── seed.sql # Sample data for development
└── config.toml # Supabase configuration
- Node.js (v18 or higher)
- npm (v8 or higher)
- Git
- Supabase account
-
Clone the repository:
git clone https://github.com/beaux-riel/Lemonade-map.git cd Lemonade-map -
Install frontend dependencies:
cd lemonade-map npm install
-
Create a
.envfile in thelemonade-mapdirectory:cp .env.example .env
-
Update the
.envfile with your Supabase credentials:VITE_SUPABASE_URL=https://your-project-id.supabase.co VITE_SUPABASE_ANON_KEY=your-anon-key
- Go to Supabase and sign up or log in
- Create a new project
- Give your project a name (e.g., "Lemonade Stand")
- Set a secure database password
- Choose a region close to your users
- Click "Create new project"
Important: After setting up your Supabase project, make sure to create the required storage buckets as described in the Setting Up Storage Buckets section below. This is necessary for image uploads to work correctly.
The database consists of three main tables:
-
Users - Stores user information
- Linked to Supabase Auth users
- Stores profile information
-
Stands - Stores lemonade stand information
- Name, description, location
- Owner reference
- Expiration time
-
Products - Stores product information for each stand
- Name, description, price
- Availability status
- Stand reference
All tables have Row Level Security policies configured to ensure data security:
-
Users Table
- Users can only read and update their own profiles
-
Stands Table
- Everyone can read active stands
- Stand owners can read, insert, update, and delete their own stands
-
Products Table
- Everyone can read available products from active stands
- Stand owners can read, insert, update, and delete products for their stands
- Go to the SQL Editor in the Supabase Dashboard
- Copy and paste the contents of each migration file in order:
01_create_users_table.sql02_create_stands_table.sql03_create_products_table.sql04_storage_policies.sql05_stand_expiration.sql
- Run the SQL commands
If you have the Supabase CLI installed:
supabase link --project-ref YOUR_PROJECT_REF
supabase db pushThe application requires the following storage buckets to be created in Supabase:
stand-images- For storing lemonade stand imagesproduct-images- For storing product imagesuser-avatars- For storing user profile pictures
- Go to the Storage section in the Supabase Dashboard
- Click "Create a new bucket"
- Enter the bucket name (e.g., "stand-images")
- Check "Public bucket" to make the bucket publicly accessible
- Click "Create bucket"
- Repeat for the other required buckets
- Get your Supabase URL and service role key from the Supabase Dashboard
- Run the provided script:
# Set environment variables
export SUPABASE_URL=your-supabase-url
export SUPABASE_SERVICE_KEY=your-service-role-key
# Run the script
node create-buckets-with-service-key.jsFor detailed instructions, see STORAGE_BUCKET_SETUP.md.
- Visit the application and click "Sign Up"
- Enter your email and password
- Verify your email address
- Log in to your account
- Navigate to the Seller Dashboard
- Click "Create New Stand"
- Fill in the stand details:
- Name
- Description
- Location (using the map or address search)
- Upload an image (optional)
- Click "Create Stand"
- Navigate to your stand's detail page
- Click "Add Product"
- Fill in the product details:
- Name
- Description
- Price
- Upload an image (optional)
- Click "Add Product"
Stands automatically expire after 24 hours to ensure the map only shows currently active stands.
- Navigate to your stand's detail page
- View the expiration countdown
- Click "Extend" to add 24 hours to your stand's visibility
For administrative tasks, use the Supabase Dashboard:
- Log in to your Supabase account
- Select your project
- Use the following sections:
- Authentication - Manage users
- Table Editor - View and edit database records
- Storage - Manage uploaded files
- Edge Functions - Monitor and deploy serverless functions
This section documents known issues and their fixes.
Issue: Users were experiencing a "stack depth limit exceeded" error when attempting to deactivate a stand.
Fix: We've updated the database triggers to prevent recursive calls when deactivating stands. See Stand Deactivation Fix for details.
The application is configured for deployment to GitHub Pages:
- Update the
homepagefield inpackage.jsonwith your GitHub Pages URL - Deploy using the provided script:
npm run deploy
This will:
- Build the application
- Push the built files to the
gh-pagesbranch - Make the application available at your GitHub Pages URL
To use a custom domain with GitHub Pages:
- Update the CNAME file in the
publicdirectory with your domain name - Configure your domain's DNS settings as described in GITHUB_PAGES_SETUP.md
- Update the
homepagefield inpackage.jsonwith your custom domain
The project includes a CI/CD pipeline using GitHub Actions:
- Runs on every pull request to the
mainbranch - Runs tests and verifies the build
- Provides feedback on the pull request
- Runs on pushes to the
mainbranch - Builds and deploys the application to GitHub Pages
For detailed information, see CI_CD_SETUP.md.
The application includes several performance optimizations:
- Code Splitting - Lazy loading of components and routes
- Bundle Optimization - Vendor chunk splitting
- Image Optimization - Responsive images and lazy loading
- Caching - Effective use of browser caching
- Compression - Gzip and Brotli compression
For detailed information, see PERFORMANCE_OPTIMIZATIONS.md.
The project includes a comprehensive testing suite:
- Unit Tests - Testing individual components and functions
- Integration Tests - Testing component interactions
- End-to-End Tests - Testing complete user flows
Run tests with:
cd lemonade-map
npm testFor detailed information, see TESTING.md.
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.


