Skip to content

Local Development

Prerequisites

Local SSL Certificates

For better production / development parity and less complexity, this project requires SSL certificates for local development.

Run the following command to create the certificate in your $HOME/certs directory

bash
./create-certificate local.com

Now you should have the certificates under $HOME/certs ready to use.

Dashboard Application Environment Variables

Create a .env file under in the fe-dashboard application directory.

You can create it from the fe-dashboard/.env.example file.

Main Environment Variables

Create a .env in the repository root directory.

You can create it from the .env.example file.

Start Developing

Now you are ready to start the env environment with the following command:

bash
make develop

This command watches file changes, builds and runs the docker-compose.yaml continuously.

This should be enough for development in the backend golang services but when you are working on the frontend services you will want to run an additional pnpm run dev in the respective application directories fe-dashboard or fe-website

Google

For the "Login with Google" feature you will need to prepare the Google Cloud project ID and secret.

  1. Sign-in to your Google Cloud account
  2. Create or pick an existing project
  3. Search / Open "APIs and Services"
  4. Navigate to "Credentials" from the left sidebar navigation
  5. Under "Create Credentials" Choose the option "OAuth client ID"
  6. Pick "Web Application" as the type
  7. Configure "Authorized JavaScript origins" with https://local.com
  8. Configure "Authorized redirect URIs" with https://local.com/app/auth/oauth/google

After you have the project ID and secret, you will need to set those values in the repository root .env

text
GOOGLE_CLIENT_ID=""
GOOGLE_SECRET=""

Stripe

For running payments locally you will need a stripe secret and webhook secret from a stripe test account.

Read the Stripe docs to understand how to obtain the secrets

You will need to set these env variables in the repository root .env

text
STRIPE_SECRET_KEY=""
STRIPE_WEBHOOK_SECRET=""
STRIPE_PK=""
STRIPE_DEFAULT_CURRENCY=usd

You will also need to run a local webhook listener with the following commands

bash
stripe login
bash
stripe listen --forward-to https://local.com/api/v1/payments/stripe/webhook --latest