This repository hosts the code used to run the Skagit Alpine Club Basic Mountaineering Course sign up website. This site uses django with Vue sprinkled in for interactivity. Stripe is used to process payments. The website is hosted through AWS Lightsail, allowing for a very affordable hosting solution. CI is handled through github actions and the website deploys with every push to production.
Required Environment Variables:
DJANGO_SECRET_KEY: Required django secret keyDEBUG: Defaults to False, only set to True if you are developing locallyALLOWED_HOSTS: Sets allowed hosts as a comma separated list. e.g.127.0.0.1,0.0.0.0DATABASE_URL: Url for the database in accordance with the url scheme of dj-database-urlDEFAULT_FROM_EMAIL: The default email django will use to send emailsUSE_AWS_EMAIL: Defaults to false, set to true to use aws email.EMAIL_HOST_USER: AWS smtp host userEMAIL_HOST_PASSWORD: AWS smtp host passwordSTRIPE_API_KEY: Stripe private API keySTRIPE_PUBLIC_API_KEY: Stripe public API keySTRIPE_ENDPOINT_SECRET: Stripe API endpoint secret for end point (/api/stripe_webhook/) that fulfills ordersSENTRY_DSN: DSN link from sentry to track errorsSENTRY_SAMPLE_RATE: A rate from 0.0-1.0. Determines what percent of transactions are tracked for performance.
To deploy with pulumi the supabase sdk will need to be generated
pulumi package add terraform-provider supabase/supabaseSet dev env
source set_dev_env.shSetup Postgres
docker run --name skagit-bmc -e POSTGRES_HOST_AUTH_METHOD=trust -p 5432:5432 -d postgresSeeding data
python manage.py migrate && aws s3 cp s3://skagit-bmc-dev/dev-dump.json - | python manage.py loaddata --format=json -Build
docker buildx build --platform linux/amd64 --provenance=false -t docker-image:test -f lambda.Dockerfile .Run
docker run --platform linux/amd64 --rm -it -p 9000:8080 --env-file .env-local --name django-lambda docker-image:test "SkagitRegistration.asgi.handler"Test
curl "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"resource": "/", "path": "/", "httpMethod": "GET", "requestContext": {}, "multiValueQueryStringParameters": null}'