This guide will help you set up Supavec locally for development.
- Bun (version 1.0.30 or higher)
- Node.js (LTS version recommended)
- Supabase CLI
- Docker (for running Supabase locally)
- Clone the repository
git clone https://github.com/taishikato/supavec.git
cd supavec- Install dependencies
bun install- Set up environment variables
For the web app (apps/web):
- Copy
.env.sampleto.env.local
cp apps/web/.env.sample apps/web/.env.localFor the API (packages/api):
- Copy
.env.sampleto.env
cp packages/api/.env.sample packages/api/.envFor the Supabase (supabase):
- Copy
.env.sampleto.env
cp supabase/.env.sample supabase/.env- Configure environment variables:
Web app environment variables (apps/web/.env.local):
NEXT_PUBLIC_SUPABASE_URL: Your Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY: Your Supabase anonymous keyNEXT_PUBLIC_SUPABASE_PROJECT_ID: Your Supabase project IDSUPABASE_SERVICE_ROLE_KEY: Your Supabase service role keyNEXT_PUBLIC_API_URL: Local API URL (default: http://localhost:3001)POSTHOG_API_KEY: Your PostHog API keyNEXT_PUBLIC_POSTHOG_KEY: Your PostHog API keyNEXT_PUBLIC_POSTHOG_HOST: PostHog API host (default: https://app.posthog.com)DEMO_SUPA_API_KEY: Your demo Supa API keyLOOPS_API_KEY: Your Loops API keySTRIPE_SECRET_KEY: Your Stripe secret keySTRIPE_SIGNATURE_SECRET: Your Stripe signature secretNEXT_PUBLIC_STRIPE_KEY: Your public Stripe keyNEXT_PUBLIC_STRIPE_PRICE_BASIC_MONTHLY: Stripe price ID for the basic monthly planNEXT_PUBLIC_STRIPE_PRICE_BASIC_YEARLY: Stripe price ID for the basic yearly planNEXT_PUBLIC_STRIPE_PRICE_ENTERPRISE_MONTHLY: Stripe price ID for the enterprise monthly planNEXT_PUBLIC_STRIPE_PRICE_ENTERPRISE_YEARLY: Stripe price ID for the enterprise yearly planNEXT_PUBLIC_STRIPE_PRODUCT_BASIC: Stripe product ID for the basic planNEXT_PUBLIC_STRIPE_PRODUCT_ENTERPRISE: Stripe product ID for the enterprise planAPI_ROUTE_SECRET: API route secret keyNEXT_PUBLIC_GOOGLE_ANALYTICS: Your Google Analytics keyNEXT_PUBLIC_APP_URL: Local app URL (default: http://localhost:3000)
API environment variables (packages/api/.env):
OPENAI_API_KEY: Your OpenAI API keySUPABASE_URL: Your Supabase project URLSUPABASE_SERVICE_ROLE_KEY: Your Supabase service role keyUPSTASH_REDIS_REST_URL: Your Upstash Redis REST URLUPSTASH_REDIS_REST_TOKEN: Your Upstash Redis REST tokenPOSTHOG_API_KEY: Your PostHog API key (optional)POSTHOG_HOST: Your PostHog host URL (optional)
- Start the Supabase local development environment:
cd supabase
supabase start- Start the development servers:
In one terminal, start the API server:
cd packages/api
bun run devIn another terminal, start the web server:
cd apps/web
bun run devThe application should now be running at:
- Web: http://localhost:3000
- API: http://localhost:3001
- Create a new branch for your feature/fix:
git checkout -b feature/your-feature-name- Make your changes and commit them:
git add .
git commit -m "feat: your feature description"- Push your changes and create a pull request:
git push origin feature/your-feature-nameFrom the root directory:
bun run dev: Start all development serversbun run build: Build all packagesbun run build:api: Build only the API packagebun run lint: Run lintingbun run format: Format code using Prettier
- If you encounter dependency issues:
bun install --force- If the development server isn't working:
- Check if all environment variables are properly set
- Ensure Supabase is running locally
- Verify that ports 3000 and 3001 are available
If you need help or have questions:
- Check the existing issues
- Create a new issue if your problem hasn't been addressed
- Ensure your code follows the project's coding standards
- Add tests for new features when applicable
- Update documentation as needed
- Follow the conventional commits specification for commit messages