4. Initial Setup

Basic Setup

# config.exs

config :spunk,
  stripe_service: Stripe,
  require_subscription: true,
  page_name: "my-app.com",
  company_name: "My App Inc",
  company_address: "26955 Fritsch Bridge",
  company_zip: "54933-7180",
  company_city: "San Fransisco",
  company_state: "California",
  company_country: "United States",
  contact_name: "John Doe",
  contact_phone: "+1 (335) 555-2036",
  contact_email: "contact@my-app.com"

.env

# .env
export STRIPE_SECRET=
export STRIPE_PUBLIC=
export STRIPE_WEBHOOK_SIGNING_KEY=
export GUARDIAN_SECRET_KEY=
export GUARDIAN_SECRET_KEY_ADMINS=

Generate the GUARDIAN_SECRET_KEY with:

mix guardian.gen.secret

NOTE You need different guardian keys for admins and non admins. Guardian for non admins are used for API authentication.

Add administrator

Generate an administrator with the command:

mix generate_admin email@example.com

And then go the login page

http://localhost:4000/admin/sign_in

You can either login with the email and password or ask for a magic login link that will be sent to the admin email.

http://localhost:4000/admin/reset_password