Skip to content

rasulkireev/statushen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StatusHen

Getting Started

All the information on how to run, develop and update your new application can be found in the documentation.

  1. Update the name of the .env.example to .env and update relevant variables.

To start you'll need to run these commands:

  1. poetry install
  2. poetry export -f requirements.txt --output requirements.txt --without-hashes
  3. poetry run python manage.py makemigrations
  4. make serve : Make sure you have a Docker Engine running. I recommend OrbStack.

Next steps

Stripe

  • For local. When you run make serve for the first time, a stripe-cli container will be created. Looks at the logs for this container and at the top you will see a webhook secret generated. Copy this and add it to your .env file.

The following notes are applicable only after you got the app running locally via make serve:

  • Add Test and Prod Secret keys in the admin panel: /admin/djstripe/apikey/ (djstripe will figure out if they are live or test keys automatically)
  • Create a webhook in Django admin panel: /admin/djstripe/webhookendpoint/
    • you can't use localhost as the domain for the webhook, so use something like https://statushen.xyz/webhook/ or a real one if you have it. It doesn't matter for local.
    • When creating a webhook in the admin, specify the latest version from here https://stripe.com/docs/api/versioning
  • Create your products in stripe (monthly, annual and one-time, for example), then sync them via make stripe-sync command.
  • Current (user-settings.html and pricing.html) template assumes you have 3 products: monthly, annual and one-time. I haven't found a reliable way to programmatcialy set this template. When you have created your products in Stripe and synced them, update the template with the correct plan id.

Deployment

  1. Create 4 apps on CapRover.
  • statushen
  • statushen-workers
  • statushen-postgres
  • statushen-redis
  1. Create a new CapRover app token for:

    • statushen
    • statushen-workers
  2. Add Environment Variables to those same apps from .env.

  3. Create a new GitHub Actions secret with the following:

    • CAPROVER_SERVER
    • CAPROVER_APP_TOKEN
    • WORKERS_APP_TOKEN
    • REGISTRY_TOKEN
  4. Then just push main branch.

Notes

  • Don't forget to update the site domain and name on the Admin Panel.