Database (Supabase)
Setup and configure your database to work with serviceCRM.
Supabase
SlappShell serviceCRM uses Supabase for its database and authentication services. Follow these steps to set up your Supabase project:
- Create a Supabase Account: Sign up at supabase.com.
- New Project: Create a new project in the Supabase dashboard.
- Database Configuration: Note down your database URL and API keys for later use. Recommend using the new API and JWT signing keys.
You will need the following details from your Supabase project:
- Database URL
- Publishable/Anon Key
- Secret/Service Role Key
In Auth > Coniguration > URL Configuration, set your Site URL to your deployed serviceCRM URL (e.g., https://your-domain.com) or localhost if developing locally.
These values will be set as environment variables in your SlappShell serviceCRM configuration.
After running the database migration, you'll also need to enable Custom Access Token (JWT) Claims hooks in the Supabase dashboard under Authentication > Configuration > Auth Hooks.
Select 'Add Custom Access Token' and set the function to custom_access_token_hook (which is created during the migration).
Image Uploads
If you wish to collect images from customers from your lead forms, you'll need to set up a storage bucket within your Supabase project.
- In Storage,
create a new bucket called 'uploads' - Set the bucket to
Public - Restric the file size to 10MB
- Restrict MIME types to:
image/jpeg, image/jpg, image/png, image/HEIC - Create a Policy called
"Allow Public Uploads"with CommandINSERTtargeted to Public with check (bucket_id = 'uploads'::text)
You can now include the image upload form field and collect images from your leads. These images will be available in the Lead Details page.
Check out the docs for Local Development to also run Supabase locally.
Enviroment Variables
Supabase Environment Variables
# In your .env file, set the following:
NEXT_PUBLIC_SUPABASE_URL="https://your-project.supabase.co"
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_OR_ANON_KEY="your-anon-key"
SUPABASE_SECRET_OR_SERVICE_ROLE_KEY="your-service-role-key"
Start with env.template and rename it to env.local