Skip to content

Automates and simplifies assigning Kingdom Hall maintenance activities.

License

Notifications You must be signed in to change notification settings

KH-Care/kh-care

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

141 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KH Care :)

Simplifies and streamlines the process of managing maintenance tasks for your entire Kingdom Hall.

Getting Started

pnpm install

Running Locally

Install and log in to your Stripe account:

stripe login

Use the included setup script to create your .env file:

pnpm db:setup

Run the database migrations and seed the database with default data:

pnpm db:migrate
pnpm db:seed

This will create the following user and team:

  • User: test@test.com
  • Password: admin123

You can also create new users through the /sign-up route.

Finally, run the Next.js development server:

pnpm dev

View the db:

pnpm db:dev

Open http://localhost:3000 in your browser to see the app in action.

You can listen for Stripe webhooks locally through their CLI to handle subscription change events:

stripe listen --forward-to localhost:3000/api/stripe/webhook

Testing Payments

To test Stripe payments, use the following test card details:

  • Card Number: 4242 4242 4242 4242
  • Expiration: Any future date
  • CVC: Any 3-digit number

Going to Production

When you're ready to deploy your SaaS application to production, follow these steps:

Set up a production Stripe webhook

  1. Go to the Stripe Dashboard and create a new webhook for your production environment.
  2. Set the endpoint URL to your production API route (e.g., https://yourdomain.com/api/stripe/webhook).
  3. Select the events you want to listen for (e.g., checkout.session.completed, customer.subscription.updated).

Deploy to Vercel

  1. Push your code to a GitHub repository.
  2. Connect your repository to Vercel and deploy it.
  3. Follow the Vercel deployment process, which will guide you through setting up your project.

Add environment variables

In your Vercel project settings (or during deployment), add all the necessary environment variables. Make sure to update the values for the production environment, including:

  1. BASE_URL: Set this to your production domain.
  2. STRIPE_SECRET_KEY: Use your Stripe secret key for the production environment.
  3. STRIPE_WEBHOOK_SECRET: Use the webhook secret from the production webhook you created in step 1.
  4. POSTGRES_URL: Set this to your production database URL.
  5. AUTH_SECRET: Set this to a random string. openssl rand -base64 32 will generate one.
  6. RESEND_API_KEY: Set this to your Resend API key.

View Supabase Studio

http://localhost:54323/project

About

Automates and simplifies assigning Kingdom Hall maintenance activities.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages