Setup
This guide walks you through installing Python and Pipenv, configuring AWS credentials, and setting up Supabase locally with Docker.
Python (and Pipenv)
Zap is built using Python 3.9. Ensure it’s installed:
python3 --version
To manage dependencies, we use Pipenv, a virtual environment tool.
Install it via pip:
pip install --user pipenv
Verify installation:
pipenv --version
AWS CLI & Credentials
Zap uses multiple AWS services. Before interacting with them:
Installation
Follow directions at AWS CLI
Configure AWS CLI
aws configure
Ask a member of the PCT Tech Team for the credentials.
How to confirm your AWS credentials
Run the following:
cat ~/.aws/credentials
Verify that the access keys match the IAM console on AWS. Or simply confirm with the PCT Tech Team member who gave you them.
Do not share your credentials with anyone.
Example config:
AWS Access Key ID [****************]: YOUR_ACCESS_KEY
AWS Secret Access Key [****************]: YOUR_SECRET_KEY
Default region name [us-east-1]: us-east-1
Default output format [json]: json
Supabase
As of dev/v4.0
, Zap uses Supabase for its database, replacing DynamoDB and MongoDB. You’ll run a local Supabase stack using Docker.
Docker Desktop and Supabase CLI
- Install Docker Desktop
- Install Supabase CLI
Important: Do not run supabase init
. Supabase is already initialized in the zap
repo.
Navigate to the zap
directory
cd zap
Start the Supabase local stack
supabase start
If successful, you’ll see URLs and keys printed to your terminal:
Started supabase local development setup.
API URL: http://127.0.0.1:54321
GraphQL URL: http://127.0.0.1:54321/graphql/v1
S3 Storage URL: http://127.0.0.1:54321/storage/v1/s3
DB URL: postgresql://postgres:postgres@127.0.0.1:54322/postgres
Studio URL: http://127.0.0.1:54323
JWT secret: ...
anon key: ...
service_role key: ...
Create .env.local
:
Copy your API URL
and anon key
from above into the following file.
# zap/.env.local
SUPABASE_URL=<API URL>
SUPABASE_KEY=<anon key>
Stop Supabase
When you are done using the backend, be sure to stop Supabase.
supabase stop
Do I really need to run supabase stop
?
Technically, you can quit Docker Desktop directly to stop the services, but running supabase stop
is safer to avoid corruption or orphaned containers.
Just make sure to fully quit Docker Desktop or your CPU will want to kill you 😡.
