Documentation Index
Fetch the complete documentation index at: https://mintlify.com/aluxey/E-Commerce/llms.txt
Use this file to discover all available pages before exploring further.
Installation Guide
This guide walks you through setting up the complete Sabbels Handmade E-Commerce platform on your local machine for development.Prerequisites
Before you begin, ensure you have the following installed and configured:- Node.js ≥ 18 (recommended: v20 LTS)
- npm or pnpm package manager
- Git for cloning the repository
- Supabase account with a configured project
- Stripe account with API keys
This guide assumes you’re using a Unix-like system (macOS, Linux, WSL). Windows users should use WSL2 for the best experience.
Installation Overview
Step 1: Clone the Repository
Clone the repository and navigate to the project directory:Step 2: Set Up the Database
Create a Supabase Project
- Go to supabase.com and sign in
- Click New Project
- Fill in the project details:
- Name:
sabbels-handmade(or your choice) - Database Password: Generate a strong password
- Region: Choose closest to your location
- Name:
- Wait for the project to be provisioned (~2 minutes)
Run Database Migrations
Execute the SQL scripts in the following order via the Supabase SQL Editor:Create the database schema
Navigate to SQL Editor in your Supabase dashboard, create a new query, and paste the contents of Click Run in the SQL Editor.
Database/BDD_struct.sql. This creates all tables, indexes, triggers, and constraints.Set up Row Level Security
Create a new query and paste the contents of Click Run in the SQL Editor.
Database/RLS.sql. This sets up all security policies.Configure Storage
- In your Supabase dashboard, go to Storage
- Create a new bucket named
product-images - Set the bucket to Public
- Configure the following policies (or use the SQL in
Database/RLS.sql):- Anyone can read images
- Only admins can upload/delete images
Get Your Supabase Credentials
You’ll need these for the next steps:- Go to Project Settings → API
- Copy the following:
- Project URL (e.g.,
https://xxx.supabase.co) - Anon Public Key (starts with
eyJ...) - Service Role Key (starts with
eyJ...)
- Project URL (e.g.,
Step 3: Install and Configure the API
Install Dependencies
Configure Environment Variables
Create a.env file in the api/ directory:
.env and add your credentials:
Where to get Stripe credentials
Where to get Stripe credentials
- Log in to stripe.com
- Go to Developers → API keys
- Copy your Secret key (starts with
sk_test_) - For webhooks, see Stripe Configuration
Start the API Server
http://localhost:3001.
Test the API
Open a new terminal and test the health endpoint:Step 4: Install and Configure the Client
Install Dependencies
Open a new terminal window:Configure Environment Variables
Create a.env file in the client/ directory:
.env and add your credentials:
The
VITE_ prefix is required for Vite to expose these variables to the client.Start the Development Server
http://localhost:5173.
Step 5: Verify the Installation
Create an Admin User
- Open
http://localhost:5173in your browser - Click Sign Up and create an account
- Go to your Supabase dashboard → Table Editor → users
- Find your user and change the
rolefield fromclienttoadmin
Test Key Features
Browse Products
Navigate to the home page and verify products are displayed (if you loaded seed data)
Admin Dashboard
Go to
/admin and verify you can access the admin panelAdd to Cart
Click on a product and add it to your cart
Language Switch
Toggle between German and French using the language selector
Verify API Connection
Check the browser console for any errors. You should see successful API calls to:- Supabase (authentication, data fetching)
- Your local API server (health checks)
Common Issues
Database connection errors
Database connection errors
- Verify your
SUPABASE_URLand credentials are correct - Check that all SQL scripts ran successfully without errors
- Ensure RLS policies are properly configured
CORS errors in the browser
CORS errors in the browser
- Make sure the API server is running on port 3001
- Verify
CLIENT_ORIGINin the API.envincludeshttp://localhost:5173 - Check that both servers are running
Build errors
Build errors
- Ensure you’re using Node.js 18 or higher:
node --version - Clear
node_modulesand reinstall:rm -rf node_modules && npm install - Check for missing environment variables
Stripe payment errors
Stripe payment errors
- Verify you’re using test mode keys (starting with
sk_test_andpk_test_) - For local webhook testing, see Stripe Configuration
- Check the API server logs for webhook errors
Next Steps
Now that you have everything installed:Quickstart Guide
Follow the quickstart to understand the core workflows
Admin Guide
Learn how to manage products, orders, and customers
API Reference
Explore the backend API endpoints
Deployment
Deploy your instance to production
Development Workflow
Running Both Servers Concurrently
For convenience, you can run both servers in parallel. In the root directory, you can create apackage.json with a dev script:
concurrently:
Hot Reloading
- Client: Vite provides instant hot module replacement (HMR)
- API: Node.js
--watchflag provides automatic server restarts
Database Changes
When modifying the database schema:- Create a new migration file in
Database/migrations/ - Follow the naming convention:
YYYYMMDD_description.sql - Run the migration in the Supabase SQL Editor
- Document the changes in your changelog